Definition And Initialization Of Array Variables (Def, Set, Rep): Further Information - Siemens Sinumerik 840D sl Programming Manual

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

Advertisement

Flexible NC programming
1.1 Variables
1.1.13

Definition and initialization of array variables (DEF, SET, REP): Further Information

Further information (SET)
initialization during definition
Starting with the 1st array element, as many array elements are assigned with the values
from the value list as there are elements programmed in the value list.
A value of 0 is assigned to array elements without explicitly declared values in the value
list (gaps in the value list).
For variables of the AXIS data type, gaps in the value list are not permitted.
If the value list contains more values than there are array elements defined, an alarm will
be displayed.
Value assignment in program execution
In the case of value assignment in program execution, the rules described above for definition
apply. The following options are also supported:
Expressions are also permitted as elements in the value list.
Value assignment starts with the programmed array index. Values can be assigned
selectively to subarrays.
Example:
Program code
DEF INT ARRAY[5,5]
ARRAY[0,0]=SET(1,2,3,4,5)
FELD[0,0]=SET(1,2, , ,5)
ARRAY[2,3]=SET(VARIABLE,4*5.6)
52
Comments
; Array definition
; Value assignment to the first 5 array
elements [0,0] - [0,4]
; Value assignment with gap to the first 5
array elements [0,0] - [0,4], array
elements[0,2] and [0,3] = 0
; Value assignment with variable and
expression starting at array index [2,3]:
[2,3] = VARIABLE
[2,4] = 4 * 5.6 = 22.4
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Job planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de slSinumerik 828d

Table of Contents