Flexible NC Programming
1
1.8
Priority of operators
840D
840D
NCU 571
NCU 572
NCU 573
1.8
Priority of operators
Priority of operators
Each operator is assigned a priority. When an
expression is evaluated, the operators with the
highest priority are always applied first. Where
operators have the same priority, the evaluation is
from left to right.
Parentheses can be used in arithmetic expressions
to define the order of execution for all operators and
thus to override the normal priority rules.
Sequence of operators
(highest to lowest)
NOT, B_NOT
1.
*, /, DIV, MOD
2.
+, –
3.
B_AND
4.
B_XOR
5.
B_OR
6.
AND
7.
XOR
8.
OR
9.
<<
10.
==, <>, >, <, >=, <=
11.
Example for IF statement:
If (otto==10) and (anna==20) gotof end
The chain operator ":" for frames may not appear
with other operators in an expression. A priority level
is thus not required for this operator.
1-44
FM-NC
810D
840Di
Negation, bit negation
Multiplication, division
Addition, subtraction
Bit AND
Bit exclusive OR
Bit OR
AND
Exclusive OR
OR
Chaining of strings, result type STRING
Comparison operators
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA) − 04.00 Edition
04.00
1
Siemens AG 2000. All rights reserved