1
04.00 Flexible NC Programming
1.2 Variable definition
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
1-27
If a value is not assigned to a variable when it is
defined, the system initializes it with zero.
Variables must be defined at the beginning of the
program before use. The definition must be made in
a separate block; only one variable type can be
defined per block.
Explanation
INT
Variable type Integer, i.e. whole number
REAL
Variable type Real, i.e. fraction with decimal point
BOOL
Variable type Bool, i.e. 1 or 0 (TRUE or FALSE)
CHAR
Variable type Char, i.e. ASCII character specified by the code 0 to 255
STRING
Variable type String, i.e. character string
AXIS
Variable type Axis, i.e. axis addresses and spindles
FRAME
Variable type Frame, i.e. geometrical parameters
name
Variable name
Programming examples
Variable type INT
DEF INT NUMBER
A variable of type INTEGER is created with
the name NUMBER.
The system initializes the variable with zero.
DEF INT NUMBER=7
A variable of type INTEGER is created
with the name NUMBER. The variable is
initialized with the value 7.
Variable type REAL
DEF REAL DEPTH
A variable of type REAL is created with the
name DEPTH.
The system initializes the variable with
zero (0.0).
DEF REAL DEPTH=6.25
A variable of type REAL is created with the
name DEPTH. The initial value is 6.25.
DEF REAL DEPTH=3.1,LENGTH=2,QUANTITY
It is also possible to define several variables
in a single line.