Siemens SINUMERIK 840D sl Programming Manual page 48

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

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
Example: Initializing complete variable arrays
For the actual assignment, refer to the diagram.
Program code
N10 DEF REAL FELD1[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 FELD1[0,0]=SET(0,1,2,-10,-11,-12,-20,-20,-20,-30, , , ,-40,-40,-50,-60,-70)
N50 FELD1[8,1]=SET(8.1,8.2,9.0,9.1,9.2)
48
FOR o=0 TO 3
FELD[n,m,o] = 1
ENDFOR
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
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents