Programming instructions
10-8
Variable Assignments and Arithmetic Functions NC Programming 17VRS
DOK-MTC200-NC**PRO*V17-ANW1-EN-P
Operators
The standard symbols for basic mathematical operations can be used as
operators.
+
Addition
−
Subtraction
∗
Multiplication
/
Division
%
Remainder integer whole division (modulo)
•
Division by "0" will cause an error.
•
Higher-order operations are implemented by functions.
Parentheses
To nest expressions and circumvent the integrated point-before-line logic,
partial expressions can be placed within parentheses. The number of
nesting levels is unlimited.
Functions
The CNC provides the following mathematical functions:
ABS Absolute value
INT Integer component
SQRT Square root
SIN Sine
COS Cosine
TAN Tangent
ASIN Arc sine
ACOS Arc cosine
ATAN Arc cotangent
E^ Power to the base "e"
10^ Power to the base 10
2^ Power to the base 2
LN Logarithm to the base "e"
LG Logarithm to the base 10
LD Logarithm to the base 2
TIME Time in seconds
The mathematical functions enclose their operands in parentheses The
operands used in functions can also be expressions — in other words, the
functions can be nested.
The absolute value function delivers the positive value of its operand.
x < 0: ABS(x) =-x
x = 0: ABS(x) = 0
x > 0: ABS(x) = x
Example
ABS(-1.23) 1.23
Absolute value
- ABS