Programming instructions
NC Programming 17VRS Variable Assignments and Arithmetic Functions
10-1
DOK-MTC200-NC**PRO*V17-ANW1-EN-P
10 Variable Assignments and Arithmetic Functions
10.1 Variables
NC variables are used in an NC program to represent a numerical value.
A value can be assigned to a NC variable by the NC program, PLC pro-
gram or from the user interface, and the value of the NC variable can
likewise be read by these programs or by the user interface.
NC variables are identified
•
by the address @,
•
by optionally stating the process number followed by a colon, and
•
by a 1–3-digit number.
256
NC variables
(0 to 255) are available for each of the 7 processes in
the CNC. In theory, a total of 1792 NC variables are available in the CNC,
that can be used independent on how many processes are defined.
@<process number[0..6]>:<variable number[0..255]>
@1:100
If the process number is not declared, the NC variable relates to the proc-
ess in which the NC variable was programmed.
@<process number[0..6]>:<variable number[0..255]>=<arithmetic expression>
@1:100=5*100
Internally, the data appears in a "double real" format. The value range for
the entry is -1.0E
±
300
to +1.0E
±
300
. No more than 15 places can be en-
tered or displayed.
.123456789123456
123456789123456
15E+20
90E-10
If the content of a NC variable is to be negated, the NC variable must be
placed within parentheses.
X=-(@100)
@120=-(@119)
-(@57)=@58
@130=X
CAUTION
Irrespective of the display mode (workpiece or machine
coordinate system), machine coordinates are always
output when axis values are read.
Syntax
Syntax for assigning a value to
an NC variable
Syntax for presenting the data
Syntax for negating the
contents of an NC variable