Calling function blocks in STΒΆ
A Function Block is called in ST by writing the name of the Function Block Instances and then assigning the values of the parameters in parentheses. In the following example a timer is called with assignments for the parameters IN and PT. Then the result variable Q is assigned to the variable A.
The result variable, as in IL, is addressed with the name of the function block, a following point, and the name of the variable:
CMD_TMR(IN := %IX5, PT := 300);
A:=CMD_TMR.Q