Cnc programming – Lenze ETC Motion Control User Manual
Page 173

CNC programming
Formula processor
Arithmetic operations
3.3
3.3.1
l
173
EDSTCXN EN 2.0
Description
Operation
Syntax
AND(x,y)
(x
¹ 0)
∧
(y
¹ 0)
Logical AND operation
OR(x,y)
(x
¹ 0)
∨
(y
¹ 0)
Logical OR operation
XOR(x,y)
(x
¹ 0)
∨
(y
¹ 0)
Logical exclusive OR operation
NOT(x)
x = 0
Logical NOT
BITAND(x,y)
x
∧
y
Bit−wise AND operation
BITOR(x,y)
x
∨
y
Bit−wise OR operation
BITXOR(x,y)
x
∨
y
Bit−wise exclusive OR operation
BITNOT(x)
x
Bit−wise NOT
PI
p
Constant 3.141592654
PI180
p/180
Constant 0.01745329252
The arithmetic operations are processed in the sequence corresponding to
the mathematical rules. To label leading positions, brackets up to a nesting
depth of 4 levels are allowed.
N10 : P1050 = sin(89.9 * P1051) / (34 + 91 * cos(P1052))
N20 : P1060 = atan2(P1,P0)
N30 : P1061 = hypot(P0,P1)
Example