Table of Contents

AxisLenzei550

Namespace
ZEquipmentCiA402
Extends
Inherited Properties
Inherited Methods
Implements
FUNCTION_BLOCK AxisLenzei550 EXTENDS ZEquipment.Axis IMPLEMENTS ZEquipment.IAxisMoveVelocity, ZEquipment.IAxisMoveCurrent, ZEquipment.IAxisMoveInterpolatedVelocity, ZEquipment.IAxisFeedbackVelocity, ZEquipment.IAxisFeedbackCurrent, ZEquipment.IAxisBase, ZEquipment.IAxisHalt, ZEquipment.IAxisBrake, ZCore.IBootable, ZCore.IObject, ZCore.IError (
 [output] Diagnostics : ZCore.DiagnosticMessage)

This function blocks implements the general axis interfaces by utilizing all functionalities of the Lenze i550 controller via the CiA402 standard protocol. The Lenze i550 is a simple frequency converter and therefore has much less functionality than a servo drive (only velocity and torque modes are supported here).

Internally, AxisLenzei550Impl uses CiA402 function blocks to implement the Zeugwerk Framework's axis interfaces (i.e. IAxisBase, IAxisMovePosition, ...).

However, this implementation is not only a simple wrapper of CiA402 function blocks, it also simplifies the usage of said function blocks. Any method that is suffixed with Async will automatically take care of fulfilling its preconditions. For instance, a call to MoveVelocityAsync will automatically execute an error reset if neccessary and will power on the axis.

  • Reset any drive errors if there are still errors, which have not been acknowledged yet
  • Write parameters to the drive that have been requested to read or write by using the Parameter property of each specialised axis
  • Enable the drive if it is not enabled yet

Outputs

Diagnostics DiagnosticMessage

Constructor

FB_init

METHOD FB_init (
 [input] bInitRetains : BOOL,
 [input] bInCopyCode : BOOL,
 [input] parent : ZCore.IManagedObject,
 [input] ethercatSlave : ZCore.IEthercatSlave) : BOOL

Inputs

bInitRetains BOOL

if TRUE, the retain variables are initialized (warm start / cold start)

bInCopyCode BOOL

if TRUE, the instance afterwards gets moved into the copy code (online change)

parent IManagedObject
ethercatSlave IEthercatSlave

Returns

BOOL

Properties

ActualCurrent

PROPERTY ActualCurrent : LREAL

Returns the actual current, which is used by the drive. The value returned is usually given in % of the nominal current.

Property Value

LREAL

ActualSafetyState

PROPERTY ActualSafetyState : ZEquipment.AxisSafetyStateFlags

This property can be used to test if a given safety feature of a drive is currently activated or not. Note that the property returns a "Flags" enumeration, which means that several bits of the returned value can be on at the same time.

Note

Retrieving the safety state of a drive is manufacturer specific.

  • Some drives may not support some of the features that are depicted in the returned value (some bits may always be 0).
  • Generic axes implementation (i.e. AxisPlcOpenMc) of the Zeugwerk Framework usually do not return the correct safety state of the drive. In doubt refer to the documentation of your specific implementation.
Warning

Not implemented because not standardized in CiA402

Warning

Not implemented

Property Value

AxisSafetyStateFlags

ActualVelocity

PROPERTY ActualVelocity : LREAL

Returns the actual velocity of the axis, which is usually calculated by using a position encoder or resolver. The value returned is given in drive velocity-units, which is usually millimeters-per-seconds or degree-per-seconds, respectively. In contrast to speed, velocity is a signed value such that it can have a positive or negative sign.

Property Value

LREAL

BrakeOpened

PROPERTY BrakeOpened : BOOL

Returns the state of the brake that is controlled by the drive. If the drive doesn't have any brake connected to it, this property always returns TRUE.

Property Value

BOOL

Parameter

PROPERTY Parameter : IAxisLenzei550Parameter

ToDo

Property Value

IAxisLenzei550Parameter

Simulation

PROPERTY Simulation : BOOL

Property Value

BOOL

State

PROPERTY State : ZCore.ObjectState

Returns the object state of the axis object. This exposes if an object is still in its booting phase, had an error, or is busy executing an async action.

Property Value

ObjectState

Methods

HaltAsync

METHOD HaltAsync (
 [input] startToken : ZCore.IStartToken)

By using this method the drive will stop with the same position profile (regarding jerk, acceleration and deceleration) as it is used to move the axis. Calling this method will beforehand automatically trigger the following sequences

  • Unlock the drive if it has been locked before (AxisPlcOpenMc only)

To check if the method could be started successfully, pass such an StartToken as a startToken. Then Assert this object or check for startToken.Error.

Inputs

startToken IStartToken

pass an StartToken instance here to check if the call was successfully executed

MoveCurrentAsync

METHOD MoveCurrentAsync (
 [input] startToken : ZCore.IStartToken,
 [input] current : LREAL)

Starts to move the axes with a constant current such that the axes will continously accelerate. Since current is proportional to the torque or force a motor can output, this method can be used to apply a constant, uncalibrated force or torque (depending on the axis configuration) to an object.

Note

Most of the time this method has to be used in conjunction with a setup procedure, where monitors like following-error are disabled beforehand. This heavily depends on the kind of drive/axis you are using. In doubt refer to the manufactures drive-documentation.

Warning

Starting the drive by calling this method without any obstacle or counterpart, the motor will accelerate until an equilibrium of force or torque to move the axis and force or torque which decelerates the axis is reached. This can lead to damage of the underlaying mechanical system if not used appropriately.

Executing this method while the drive is still Busy with another Async command will cause this method to fail. This can be checked by submitting an StartToken as a startToken. Simply pass such an object and Assert it or check for startToken.Error after calling this method.

Inputs

startToken IStartToken

(optional) object to check if the method was executed successfully - may be 0

current LREAL

%, target current in percent of the drive's nominal current

MoveInterpolatedCurrentAsync

METHOD MoveInterpolatedCurrentAsync (
 [input] startToken : ZCore.IStartToken)

This method is used to enter the drives interpolated current mode, i.e. CiA402 this mode is usually called cyclic-synchronous-torque (CST) mode. After the mode has been successfully switched to, SetInterpolatedCurrent has to be called every PLC cycle, with a command value, which should not exceed any drive or physicial limit. The Async method is done if the object is not in its Busy state anymore.

Note

This method is used to start a specific operation mode of the drive. Calling any other Async method of the axes interfaces, will finish this mode. This includes methods like StopAsync and HaltAsync.

Executing this method while the drive is still Busy with another Async command will cause this method to fail. This can be checked by submitting an StartToken as a startToken. Simply pass such an object and Assert it or check for startToken.Error after calling this method.

For this axis-type the switching procedure into interpolation mode for current differs to switching into switching to interpolation mode for position commanding. Here we start switching and for this action the axis stays Busy=TRUE. When it has switched successfully, it gets Busy=FALSE. By start sending the first current command values, the axis get Busy=TRUE again until you change into a different mode by stopping or halting the axis.

Inputs

startToken IStartToken

MoveInterpolatedVelocityAsync

METHOD MoveInterpolatedVelocityAsync (
 [input] startToken : ZCore.IStartToken)

This method is used to enter the drives interpolated velocity mode, i.e. CiA402 this mode is usually called cyclic-synchronous-velocity (CSV) mode. After the mode has been successfully switched to, SetInterpolatedVelocity has to be called every PLC cycle, with a command value, which should not exceed any drive or physicial limit. The Async method is done if the object is not in its Busy state anymore.

Note

This method is used to start a specific operation mode of the drive. Calling any other Async method of the axes interfaces, will finish this mode. This includes methods like StopAsync and HaltAsync.

Executing this method while the drive is still Busy with another Async command will cause this method to fail. This can be checked by submitting an StartToken as a startToken. Simply pass such an object and Assert it or check for startToken.Error after calling this method.

For this axis-type the switching procedure into interpolation mode for velocity differs to switching into switching to interpolation mode for position commanding. Here we start switching and for this action the axis stays Busy=TRUE. When it has switched successfully, it gets Busy=FALSE. By start sending the first velocity command values, the axis get Busy=TRUE again until you change into a different mode by stopping or halting the axis.

Inputs

startToken IStartToken

MoveVelocityAsync

METHOD MoveVelocityAsync (
 [input] startToken : ZCore.IStartToken,
 [input] velocity : LREAL)

Starts to move the axes a specific velocity. The method utilizes the drive's profile generator, which may offer to adjust acceleration, deceleration and jerk as PDOs or SDOs as well. The latter parameters are usually vendor specific and thus are not part of the interface. Use the Parameter property of each specialised axis to adjust said values before calling this method. Calling this method will beforehand automatically trigger the following sequences

  • Unlock the drive if it has been locked before (AxisPlcOpenMc only)
  • Reset any drive errors if there are still errors, which have not been acknowledged yet
  • Write parameters to the drive that have been requested to read or write by using the Parameter property of each specialised axis
  • Enable the drive if it is not enabled yet

Executing this method while the drive is still Busy with another Async command will cause this method to fail. This can be checked by submitting an StartToken as a startToken. Simply pass such an object and Assert it or check for startToken.Error after calling this method.

If a MoveVelocityAsync command is currently being executed, calling this method can be used to overwrite the current move command. This is an exeception to the rule that this method should not be called while the axis is busy.

Inputs

startToken IStartToken
velocity LREAL

OpenBrakeAsync

METHOD OpenBrakeAsync (
 [input] startToken : ZCore.IStartToken,
 [input] on : BOOL)

Opens and closes the brake that the drive controls. Use on:=TRUE to open the brake and on:=FALSE to close the brake.

Executing this method while the drive is still Busy with another Async command will cause this method to fail. This can be checked by submitting an StartToken as a startToken. Simply pass such an object and Assert it or check for startToken.Error after calling this method.

Inputs

startToken IStartToken

pass an StartToken instance here to check if the call was successfully executed

on BOOL

opens the brake by providing on:=TRUE and closes the brake by providing on:=FALSE

RebootAsync

METHOD RebootAsync (
 [input] startToken : ZCore.IStartToken)

Reboot of the axis, which means that the internal state is switched back to Booting. In practice, this switches the axis' fieldbus back to PREOP, writes all parameters to the drive and then switches back to OP. Internally this is achieved by parking the axis and then unparking it.

Inputs

startToken IStartToken

pass an StartToken instance here to check if the call was successfully executed

SetInterpolatedCurrent

METHOD SetInterpolatedCurrent (
 [input] startToken : ZCore.IStartToken,
 [input] current : LREAL)

This method has to be used together with MoveInterpolatedCurrentAsync to send a command value to the drive. The latter should not exceed any drive or motors physicial limit.

If this method is called when MoveInterpolatedCurrentAsync has not started before, the method will fail. Use startToken for testing if the method was executed correctly.

Inputs

startToken IStartToken
current LREAL

SetInterpolatedVelocity

METHOD SetInterpolatedVelocity (
 [input] startToken : ZCore.IStartToken,
 [input] velocity : LREAL)

This method has to be used together with MoveInterpolatedVelocityAsync to send a command value to the drive. The latter should not exceed any drive or physicial limit.

If this method is called when MoveInterpolatedVelocityAsync has not started before, the method will fail. Use startToken for testing if the method was executed correctly.

Inputs

startToken IStartToken
velocity LREAL

SetLogger

METHOD SetLogger (
 [input] logger : ZCore.ILogger)

Use this method together with SetName to enable logging for this axis. Various methods of this implementation write log messages into the passed logger interface.

Note

Sometimes it is beneficial to disable logging by passing 0 to this method (e.g. for inputs or outputs which are switch very often).

Inputs

logger ILogger

SetName

METHOD SetName (
 [input] name : ZCore.ZString)

Sets the name of this object as it will show up in any log messages that is created by this object. The name set with this method should be relatable to the name of the input in the electrical plan of your automation project to identify the corresponding input properly.

Inputs

name ZString

SetSimulation

METHOD FINAL SetSimulation (
 [input] on : BOOL)

Inputs

on BOOL