Flexible NC programming
1.3 Array definitions (DEF, SET, REP)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
1-11
Example: Initialization of complete variable arrays
The current assignment is shown in the drawing.
N10 DEF REAL ARRAY1[10,3] = SET(0, 0, 0, 10, 11, 12, 20, 20, 20, 30, 30, 30, 40, 40,
40,)
N20 ARRAY1[0,0] = REP(100)
N30 ARRAY1[5,0] = REP(-100)
N40 ARRAY1[0,0] = SET(0, 1, 2, -10, -11, -12, -20, -20, -20, -30, , , ,
-40, -40, -50, -60, -70)
N50 ARRAY1[8,1] = SET(8.1, 8.2, 9.0, 9.1, 9.2)
1
11
11
$UUD\LQGH[
7KHDUUD\HOHPHQWV>@WR
>@KDYHEHHQLQLWLDOL]HG
ZLWKWKHGHIDXOWYDOXH
7KHDUUD\HOHPHQWV>@WR
>@KDYHQRWEHHQ
FKDQJHG
7KHDUUD\HOHPHQWV>@WR
>@KDYHEHHQLQLWLDOL]HG
ZLWKWKHGHIDXOWYDOXH
,QLWLDOL]DWLRQZLWK
YDULRXVYDOXHV
,QLWLDOL]DWLRQIRU
GHILQLWLRQ
,QLWLDOL]DWLRQZLWK
LGHQWLFDOYDOXH
Initialization with value lists for the array definition, SET
• As many array elements are assigned as initialization values are programmed.
• Array elements without values (gaps in the value list) are automatically initialized to 0.
• For variables of type AXIS, gaps in the value list are not permitted.
• Programming more values than exist in the remaining array elements triggers an alarm.
Example:
DEF REAL ARRAY[2,3]=(10, 20, 30, 40)