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
EnableBOOLEnable the Function Block if Enable = True
CommunicationReadyBOOL- 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
KernelCMC_Basic_Kernel64Reference to CMC_Basic_Kernel64
ControlParameterCMC_Axis_Control_ParameterReference to CMC_Axis_Control_Parameter
AxisReference to Axis_Ref
PersistentDataARRAY [0..7] OF LWORD
Reference to persistent data which stores position information, the variable must be declared as PERSISTENT and RETAIN variable.
Output
PositionRestoredBOOLTrue indicates that the position has been restored during the kernel`s last start-up.
PositionStoredBOOLTrue indicates that the position has been stored during the last execution.
BusyBOOLThe FB is not finished, and new output values are to be expected
ErrorBOOLSignals that an error has occurred within the Function block
ErrorIDError identification. For error details refer to Enumeration AC500_MotionControl.ERROR_ID
StoredAxisPositionLREALThe axis position stored in persistent variable
StoredDrivePositionDINTThe drive position stored in persistent variable