MCA_PersistPosition (FB)

FUNCTION_BLOCK MCA_PersistPosition

This function block implements persisting the axis position of a multi-turn absolute encoder that has a range of 2^32 with real axis.

Note

This function block has to be called within the REAL-TIME task, same task as CMC_Basic_Kernel/CMC_Basic_Kernel64, such as MotionSolution_Task built by MotionWizard.

Note

This function block has to be called immediately after CMC_Basic_Kernel/CMC_Basic_Kernel64 and ECAT_CiA402_Control_App, and before all user programs.

Note

This fucntioin block will show error RestorePositionFailed but Busy = True, PositionStored = True, if it`s the first time that this function block is applied for an axis.

Note

Do not perform other axis operations until the position is successfully restored, that is, the output PositionRestored becomes True.

InOut:

Scope

Name

Type

Comment

Input

Enable

BOOL

Enable the Function Block if Enable = True

CommunicationReady

BOOL

Communication is Ready means that the drive infomation can be receiced by the PLC, especially drive actual position.

for EthercCAT with CM579, once the output CurrentState of function block CM579EcatBusDiag becomes to OP, that means communication is ready; for Onboard EthercCAT, once SlaveDevice.wState becomes to ETC_SLAVE_STATE.ETC_SLAVE_OPERATIONAL, that means communication is ready.

Inout

Kernel

CMC_Basic_Kernel64

Reference to CMC_Basic_Kernel64

ControlParameter

CMC_Axis_Control_Parameter

Reference to CMC_Axis_Control_Parameter

Axis

Axis_Ref

Reference to Axis_Ref

PersistentData

ARRAY [0..7] OF LWORD

Reference to persistent data which stores position information, the variable must be declared as PERSISTENT and RETAIN variable.

Output

PositionRestored

BOOL

True indicates that the position has been restored during the kernel`s last start-up.

PositionStored

BOOL

True indicates that the position has been stored during the last execution.

Busy

BOOL

The FB is not finished, and new output values are to be expected

Error

BOOL

Signals that an error has occurred within the Function block

ErrorID

ERROR_ID

Error identification. For error details refer to Enumeration AC500_MotionControl.ERROR_ID

StoredAxisPosition

LREAL

The axis position stored in persistent variable

StoredDrivePosition

DINT

The drive position stored in persistent variable