Flexible NC programming
1.7 Comparison and logical operations
Job planning
1-20 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
1.7 1.7 Comparison and logical 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 used for the BOOL type. 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 operators
==
or
<>
or
>
or
<
or
>=
or
<=
Logic operators
AND
or
OR
or