Read the Output of an MC Function Block in ST
A6_Inst_MC_MoveRelative( 1, Axis6, -90, 5, 300000, 300000, 0, 0 );
- A6_Inst_MC_MoveRelative is an instance of MC_MoveRelative PLCopen Motion function block.
- The values given in parenthesis correspond to the 8 inputs of this FB.
The syntax to read one of the outputs in ST for this instance is:
<FUNCTION BLOCK NAME>.<OUTPUT>
This FB has these 5 outputs: Busy, Active, CommandAborted, Error, and Error ID (e.g., the Active output has this ST expression: A6_Inst_MC_MoveRelative.Active).
Example 1
UserVariable1 := A6_Inst_MC_MoveRelative.Error ;
Example 2
IF A6_Inst_MC_MoveRelative.Active THEN
UserVariable2 := 1 ;
ELSE
UserVariable2 := 0 ;
END_IF;