How to Read Output of a 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 PLCopenA vendor -and product- independent worldwide association active in Industrial Control and aiming at standardizing PLC file formats based on XML 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"Structured text" A high-level language that is block structured and syntactically resembles Pascal for this instance is:
<FUNCTION BLOCK NAME>.<OUTPUT>
This FB has the following 5 outputs: Busy, Active, CommandAborted, Error, and Error ID. So for instance, the Active output has the following 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;