Priority of the operators
The operators have the following priorities for execution in the synchronous action (highest
priority: 1):
Priori‐
ty
Operators Meaning
1 NOT, B_NOT Negation, bit-by-bit negation
2 *, /, DIV, MOD Multiplication, division
3 +, - Addition, subtraction
4 B_AND Bit-by-bit AND
5 B_XOR Bit-by-bit exclusive OR
6 B_OR Bit-by-bit OR
7 AND AND
8 XOR Exclusive OR
9 OR OR
10 << Concatenation of strings, result type STRING
11 ==, <>, <, >, >=, <= Relational operators
Note
It is strongly recommended that the individual operators are clearly prioritized by setting
parentheses "( … )" when several operators are used in an expression.
Example of a condition with an expression with several operators:
Program code
... WHEN ($AA_IM[X] > VALUE) AND ($AA_IM[Y] > VALUE1) DO ...
Arithmetic functions
Operator Meaning
SIN() Sine
COS() Cosine
TAN() Tangent
ASIN() Arc sine
ACOS() Arc cosine
ATAN2() Arc tangent 2
SQRT() Square root
ABS() Absolute value
POT() 2nd power (square)
TRUNC() Integer component
The accuracy for comparison commands can be set using TRUNC
ROUND() Round to an integer
LN() Natural logarithm
EXP() Exponential function
Fundamentals
2.15 Other information
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 387