L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 72

Advertising
background image

L-force | PLC Designer

Concepts and Base Components

70

DMS 4.1 EN 03/2011 TD29

Function call:
The call of a function in ST can appear as an operand in expressions.
In IL a function call only can be positioned within actions of a step or within a
transition.
Functions (in contrast to a program or function block) contain no internal state
information, that is, invocation of a function with the same arguments (input
parameters) always will yield the same values (output). For that reason functions may
not contain global variables and addresses.

Examples of function calls:
in IL:

in ST:

result := fct1(5, 3, 22);

in FBD:

Note: In contrast to »PLC Designer« V2.3 in function calls it is no longer possible to
mix explicit parameter assignment with implicit ones.
This allows to change the order of parameter input assignments.
Example:
fun(formal1 := actual1, actual2); // -> error message
fun(formal2 := actual2, formal1 := actual1); // same semantics as the following:
fun(formal1 := actual1, formal2 := actual2);
However you have to notice the different parameter assignment when using V2.3
projects!

Advertising