Flexible NC programming
1.4 Comparison and logic operations
Job planning
66 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
1.4 Comparison and logic operations
Function
Comparison operations can be used , for example, to formulate a jump condition. Complex
expressions can also be compared.
The comparison operations are applicable to variables of type
CHAR, INT, REAL and BOOL. The
code value is compared with the
CHAR type.
For types
STRING, AXIS and FRAME, the following are possible: == and <>, which can be used
for
STRING type operations, even in synchronous actions.
The result of comparison operations is always of
BOOL type.
Logic operators are used to link truth values.
The logical operations can only be applied to type
BOOL variables. However, they can also be
applied to the
CHAR, INT and REAL data types via internal type conversion.
For the logic (Boolean) operations, the following applies to the
BOOL, CHAR,INT and REAL data
types:
● 0 corresponds to: FALSE
● not equal to 0 means: TRUE
Bit logic operators
Logic operations can also be applied to single bits of types
CHAR and INT. Type conversion is
automatic.
Programming
Relational operator Significance
==
equal to
<>
not equal to
>
greater than
<
less than
>=
greater than or equal to
<=
less than or equal to
Logic operator Significance
AND
AND
OR
OR
NOT
Negation
XOR
Exclusive OR