Read commanded velocity with MC_ReadCommandedVelocity
MC_ReadCommandedVelocity is used to read the commanded velocity of an axis. It outputs a 32-bit and 64-bit velocity value continuously while the Enable is true.
-
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. |
Valid | Output | Indicates the position outputs are 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 | 32-bit commanded velocity value as a REAL. |
Value64 | Output | 64-bit commanded velocity value as a LREAL. |

//Set Axis Reference
Axis1 := 1;
IF (_AX01_RDY) THEN
//Example of MC_ReadCommandedVelocity
INST_READCOMMANDEDVELOCITY(Enable:=Enable_ReadCommandedVelocity, Axis:=Axis1,
ErrorID=>INST_READCOMMANDEDVELOCITY.ErrorID);
END_IF;
LM524