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

L-force | PLC Designer
Programming Reference
DMS 4.1 EN 03/2011 TD29
1017
hasvalue (define-ident, char-string)
If the define (define-ident) is defined and it has the specified
value (char-string), then its value is TRUE, otherwise FALSE
Example:
Precondition: Variable "test" is used in applications App1 and
App2, it gets value "1" in App1 and value "2" in App2:
{IF hasvalue(test,'1')}
(*the following code line will be processed in App1, because
there variable test has value 1*)
x := x + 1;
{ELSIF hasvalue(test,'2')}
(*the following code line will be processed in App2, because
there variable test has value 2*)
x := x + 2;
{END_IF}
NOT operator
Inverts the value of the operator.
Example:
Precondition: There are two applications App1 and App2.
POU "PLC_PRG1" is used in App1 and App2, POU
CheckBounds is only available in App1:
{IF defined (pou: PLC_PRG1) AND NOT (defined (pou:
CheckBounds))}
(*the following code line is only executed in App2*)
bANDNotTest := TRUE;
{END_IF}
operator AND operator
Is TRUE if both operators are TRUE
Example:
Precondition: POU "PLC_PRG1" is used in applications App1
and App2, POU CheckBounds is only available in App1:
{IF defined (pou: PLC_PRG1) AND (defined (pou:
CheckBounds))}
(*the following code line will be processed only in
applications App1, because only there "PLC_PRG1" and
"CheckBounds" are defined*)
bORTest := TRUE;
{END_IF}