1
Flexible NC Programming 04.00
1.7 Com
arison and lo
ic o
erators
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
1-42
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
Logic operators
Logic operators are used to logically combine truth
values.
AND, OR, NOT and XOR can generally only be used
on variables of type BOOL, however, they can also
be used on the data types CHAR, INT and REAL by
means of implicit type conversion.
Spaces must be inserted between Boolean
operands and operators.
In logic (Boolean) operations the following applies to
the data types BOOL, CHAR, INT and REAL:
0 is equivalent to FALSE
not equal to 0 is equivalent to TRUE
Meaning of the logic operators
AND
AND
OR
OR
NOT
NOT
XOR
Exclusive OR
Parentheses can be used in arithmetic expressions
to define the order of execution for all operators and
thus to override the normal priority rules.
Programming example
IF (R10<50) AND ($AA_IM[X]>=17.5) GOTOF DEST
IF NOT R10 GOTOB START
NOT refers only to an operand.