Flexible NC programming
1.3 Array definitions (DEF, SET, REP)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
1-7
Example: Program-local variables
DEF INT COUNTER
LOOP: G0 X… ;Loop
COUNT=COUNT+1
IF COUNT<50 GOTOB LOOP
M30
Example: Querying existing geometry axes
DEF AXIS ABSCISSA; ;1. geometry axis
IF ISAXIS(1) == FALSE GOTOF CONTINUE
ABSCISSA = $P_AXN1
CONTINUE:
Example: Indirect spindle programming
DEF AXIS SPINDLE
SPINDLE=(S1)
OVRA[SPINDLE]=80 ;Spindle override = 80%
SPINDLE=(S3)
…
1.3 1.3 Array definitions (DEF, SET, REP)
Function
An array is a memory area defined using the variable type with name and size. Arrays with
up to two dimensions can be defined.
Note
Maximum array size
When defining arrays, the maximum array size of the 1st and 2nd dimension is 32767 for the
array index [n, m].
Initialization of arrays
Initialization values can be assigned to the array elements:
• during the program execution
or
• already with the array definition.
In 2-dimensional arrays, the right array index is incremented first.