Siemens SINUMERIK 840D sl Programming Manual page 422

Nc programming
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Work preparation
3.1 Flexible NC programming
Additional information (SET)
initialization for the 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.
● An alarm is displayed if the value list contains more values than there are array elements
defined.
Value assignment in program execution
In the case of value assignment in program execution, the rules described above for the
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)
ARRAY[0,0]=SET(1,2, , ,5)
ARRAY[2,3]=SET(VARIABLE,4*5.6)
Further information (REP)
initialization for the definition
● All or the optionally specified number of array elements are initialized with the specified
value (constant).
● Variables of the FRAME data type cannot be initialized.
Example:
Program code
DEF REAL varName[10]=REP(3.5,4)
422
Comment
; Array definition
; Value assignment to the first 5 array ele-
ments [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
Comment
; Initialize array definition and array ele-
ments [0] to [3] with value 3.5.
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de sl

Table of Contents