Calling function blocks in st, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 762

Advertising
background image

L-force | PLC Designer

General Editors

760

DMS 4.1 EN 03/2011 TD29

Reset operator 'R=': The value will be "reset", that is if once set to FALSE, it will remain
FALSE,
Example:

a

R=

b;

a gets set to FALSE when b = TRUE.

Note: Notice the behaviour in case of a multiple assignment: All set and reset
assignments refer to the last member of the assignment.
Example:
a S= b R= fun1(par1,par2);
In this case b gets the reset output value of fun1, BUT: a does

not

get the set value of

b, but gets the set output value of fun1 !


Assignment as expression, extension to the IEC 61131-3 standard (
ExST):
Notice that an assignment can be used as an expression.

Calling function blocks in ST
A function block (abbreviated by "FB" in the following) is called in Structured Text
according to the following syntax:
Syntax:
<name of FB instance>(FB input variable:=<value or address>|, <further FB input
variable:=<value or address>|...further FB input variables);
Example:
In the following example a timer function block (TON) is called with assignments for
the parameters IN and PT.
Then result variable Q is assigned to variable A. The timer FB is instantiated by
"TMR:TON;"
The result variable, as in IL, is addressed according to syntax <FB instance name>.<FB
variable>:

TMR(IN := %IX5, PT := 300);
A:=TMR.Q

Advertising