Flexible NC programming
1.1 Variables
Array index
The implicit sequence of the array elements, e.g. in the case of value assignment using SET
or REP, is right to left due to iteration of the array index.
Example: Initialization of a 3-dimensional array with 24 array elements:
DEF INT FELD[2,3,4] = REP(1,24)
FELD[0,0,0] = 1
FELD[0,0,1] = 1
FELD[0,0,2] = 1
FELD[0,0,3] = 1
...
FELD[0,1,0] = 1
FELD[0,1,1] = 1
...
FELD[0,2,3] = 1
FELD[1,0,0] = 1
FELD[1,0,1] = 1
...
FELD[1,2,3] = 1
corresponding to:
FOR n=0 TO 1
FOR m=0 TO 2
ENDFOR
ENDFOR
50
1st array element
2nd array element
3rd array element
4th array element
5th array element
6th array element
12th array element
13th array element
14th array element
24th array element
FOR o=0 TO 3
FELD[n,m,o] = 1
ENDFOR
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Job planning