L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 38

Advertising
background image

L-force | PLC Designer

What is What in PLC Designer

36

DMS 3.2 EN 02/2011 TD29



Examples for calling the above described function Fct:
in IL:

LD 7

Fct 2,4

ST Ergebnis

in ST:

Ergebnis := Fct(7, 2, 4);

in FUP:



Stop!

If a local variable in a function is declared as RETAIN, this will be without any effect.
The variable will not be saved in the Retain area !

Note!

If you define a function in your project with the name CheckBounds, you can use it
to check for range overflows in arrays (see chapter Datatypes).

If you define functions in your project with the names CheckDivByte,
CheckDivWord, CheckDivDWord and CheckDivReal, you can use them to check the
value of the divisor if you use the operator DIV, for example to avoid a division by 0
(see chapter IEC Operators...).

If you define functions with the names CheckRangeSigned and
CheckRangeUnsigned, then range exceeding of variables declared with subrange
types (see chapter Data types) can be intercepted.

All these check function names are reserved for the described usage.

Advertising