Read Motion Information with MC_ReadMotionInfo
MC_ReadMotionInfo is used to read 32-bit and 64-bit motion information from an axis. While Enable input is On, the value of the item set by ParameterNumber is continuously output to Value32 and Value64.
-
ParameterNumber can be changed while the Enable is TRUE to read a different value.
-
LS_Connect must be executed before this function block can be used.
-
The examples in this topic can be found in the XMC_SingleAxis_FBs.zip downloadable from Example Applications.

Element Name | Element Type | Description |
---|---|---|
Enable | Input | Level detected request to execute the function block. |
Axis | Input/Output | Axis reference variable. This can not be a constant. |
ParameterNumber | Input | Specify the number of the parameter to read. See Parameter Number table below. |
Valid | Output | Indicates the output of the function block is valid. |
Busy | Output | Indicates the function block is currently being executed. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
Value32 | Output | Output of the 32-bit value of the parameter as a REAL. |
Value64 | Output | Output of the 64-bit value of the parameter as a LREAL. |
Parameter Number table
Parameter Number | Parameter Value | Description |
---|---|---|
0 | Current Position | Current position value of the axis. |
1 | Commanded Position | Commanded position value of the axis. |
2 | Current Velocity | Current speed value of the axis. |
3 | Commanded Velocity | Commanded speed value of the axis. |
4 | Current Torque | Current torque in percentage. |
5 | Commanded Torque | Commanded torque in percentage. |

//Set Axis Reference
Axis1 := 1;
IF (_AX01_RDY) THEN /
/Example of MC_ReadMotionInfo
INST_READMOTIONINFO(Enable:=Enable_ReadMotionInfo, Axis:=Axis1,
ParameterNumber:=INST_READMOTIONINFO.ParameterNumber, ErrorID=>INST_READMOTIONINFO.ErrorID);
END_IF;
LM504