Table of Contents

IAxisBase

Namespace
ZEquipment

This interface bundles methods and functionality, which is usually supported by an axis implementation. It covers methods to get the current state of an axis like

and methods to manipulate the state of an axis, which are commonly used for drives, no matter of the drive is meant to power a stepper method, variable-frequency drive, servo drive, ...

By implementing IObject any axes can be used in combination with common methods like Assert, Await and so on.

INTERFACE IAxisBase EXTENDS ZCore.IObject, ZCore.IBootable, ZCore.IError
Extends
Inherited Properties
Inherited Methods

Properties

ActualMotionState

This property returns the actual motion state of a drive to find out if the axis is currently accelerating, deceleration, moving with constant velocity or standing still.

Note

While some drives support a dedicated status to retrieve this information, some implementation have to rely on a software implementation. The latter may be not as accurate as a hardware status and rely on settings as the speed-monitoring-window or position-window parameter.

PROPERTY ActualMotionState : AxisMotionState

Property Value

AxisMotionState

ActualSafetyState

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.
PROPERTY ActualSafetyState : AxisSafetyStateFlags

Property Value

AxisSafetyStateFlags

DriveEnabled

This property can be used to check if an axis is powered by its drive. On the one hand, after successfully running an enable drive command with EnableDriveAsync(on:=TRUE) it is expected that this property is returning TRUE. On the other hand, after successfully executing EnableDriveAsync(on:=FALSE) it is expected that this property is returning FALSE.

If the STO of a drive is active or not enabled for any other reason, this property returns FALSE as well.

PROPERTY DriveEnabled : BOOL

Property Value

BOOL

DrivePowered

This property returns TRUE if the drive itself is powered and can provide power to an axis by calling EnableDriveAsync. If this property returns FALSE usually an emergency-stop is pressed or power is missing for some other reason.

PROPERTY DrivePowered : BOOL

Property Value

BOOL

DriveStateAsString

Returns the current state of the drive as string. The returned string may differ may differ severly between implementations, manufactures and depends if the axis is simulated or not. So, this should only be used for logging, debugging and visualization and not be linked to any logic.

PROPERTY DriveStateAsString : ZCore.ZString

Property Value

ZString

Manufacturer

Returns the manufacturer name of the axis as human-readable text

PROPERTY Manufacturer : ZCore.ZString

Property Value

ZString

Parked

Axes can be parked by calling ParkAsync(on:=TRUE). Parking means that any cyclic methods are skipped after executing a parking sequence. If this property returns TRUE, an axis can be "unparked" by using ParkAsync(on:=FALSE).

PROPERTY Parked : BOOL

Property Value

BOOL

Simulation

This property has to be overwritten by an actual axis implementation (i.e. AxisPlcOpenMc). It is used to switch the axis from a physical instance (i.e. AxisPlcOpenMcImpl) to a simulated axis-instance (i.e. AxisSimulatedImpl).

Settings this property with TRUE or FALSE takes care of automatically parking the unused axis instance and starting the booting sequence for the axis instance that should be used.

PROPERTY Simulation : BOOL

Property Value

BOOL

Methods

EnableDriveAsync

By using this method the power output of a drive to an axis can be enabled (on:=TRUE) or disabled(on:=FALSE), respectively. 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

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.

METHOD EnableDriveAsync (
 startToken : ZCore.IStartToken,
 on : BOOL)

Inputs

startToken IStartToken

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

on BOOL

enable the power output of a drive and put the motor in controlling state on:=TRUE, disable the drive by providing on:=FALSE

Name

Returns the names of all objects that are used within this axis and were set by calling [SetName](xref:ZEquipment.IAxisBase#SetName].

This method should be used with care. It copies several strings and should be called rarely and that means of course not every cycle, but only at initialization phases.

METHOD Name () : ZCore.ZString

Returns

ZString

ParametrizeAsync

This method executes parametrization to the drive. Parameters to read and write can be set-up by using the Parameter property of each axis. Usually this method doesn't have to be called manually, because most other Async method of an axes are calling this method automatically internally. However, use this method if reading or writing is explicitly required at a specific point in the PLC.

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.

METHOD ParametrizeAsync (
 startToken : ZCore.IStartToken)

Inputs

startToken IStartToken

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

ParkAsync

This method can be used to skip any internal cyclic method. Parking an axes and then "unparking" it will automatically execute a booting sequences, where the PLC variables are reinitialized. Parking is usually needed for drives that are optional for a machine and can be hotplugged.

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.

METHOD ParkAsync (
 startToken : ZCore.IStartToken,
 on : BOOL)

Inputs

startToken IStartToken

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

on BOOL

ResetErrorAsync

By using this method any remaining unacknowledged errors on the drive are reset. Usually this method doesn't have to be called manually, because most other Async method of an axes are calling this method automatically internally. However, use this method if resetting the error manually is required for some reason.

  • Unlock the drive if it has been locked before (AxisPlcOpenMc only)
  • Write parameters to the drive that have been requested to read or write by using the Parameter property of each specialised axis

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.

METHOD ResetErrorAsync (
 startToken : ZCore.IStartToken)

Inputs

startToken IStartToken

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

SetLogger

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).

METHOD SetLogger (
 logger : ZCore.ILogger)

Inputs

logger ILogger

interface of a logger instance or a logger decorator instance

SetName

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.

METHOD SetName (
 name : ZCore.ZString)

Inputs

name ZString

name of the object, should match the name of the equipment list e.g. in the electrical plan

StopAsync

By using this method the drive will stop with the quickstop profile (regarding jerk, acceleration and deceleration), usually this profile is quicker than the normal position profile, which is used for normal movement profiles and sometimes also for halt. Calling this method will beforehand automatically trigger the following sequences

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. However, usually StopAsync can always be called, only some very specific implementations may behave differently. In doubt, refer to the documenation of a specific implementation.

Note

If an ongoing task was started with an ExecutionToken as the token parameter (e.g. _axis.AxisName.MoveAbsolutAsync(THIS^) in a Sequence), it gets informed (aborted), if not the same ExecutionToken is used here with this call.

METHOD StopAsync (
 startToken : ZCore.IStartToken)

Inputs

startToken IStartToken

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