Flexible NC programming
1.2 Variable definition (DEF user-defined variables LUD, GUD, PUD)
Job planning
1-4 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Note
If a variable is not assigned a value on definition, the system sets zero as the default.
Variables must be defined at the beginning of the program before they are used. The
definition must be made in a separate block; only one variable type can be defined per block.
Parameters
INT Variable type integer, i.e. whole number
REAL Variable type real, i.e. factional number with decimal
point
BOOL Variable type Boolean, i.e. 1 or 0 (TRUE or FALSE)
CHAR Variable type char, i.e. ASCII-coded character
(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. geometric data
Example
Variable type Meaning
INT
DEF INT NUMBER This creates a variable of type integer with the
name NUMBER.
System initializes with zero.
DEF INT NUMBER=7 This creates a variable of type integer with the
name NUMBER. The system initializes the
variable with 7.
REAL
DEF REAL DEPTH This creates a variable of type real with the name
DEPTH.
System initializes with zero (0.0).
DEF REAL DEPTH=6.25 This creates a variable of type real with the name
DEPTH. The variable is initialized with 6.25.
DEF REAL DEPTH=3.1,LENGTH=2,NUMBER More than one variable can be defined in a line.