Siemens SINUMERIK 840D sl Programming Manual page 50

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

Advertisement

Flexible NC programming
1.1 Variables
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
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)
Further information (
initialization during definition
● All or the optionally specified number of array elements are initialized with the specified
● Variables of the FRAME data type cannot be initialized.
Example:
Program code
DEF REAL varName[10]=REP(3.5,4)
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
Examples:
Program code
DEF REAL varName[10]
varName[5]=REP(4.5,3)
50
selectively to subarrays.
)
REP
value (constant).
selectively to subarrays.
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
Comments
; Initialize array definition and array
elements [0] to [3] with value 3.5.
Comments
; Array definition
; Array elements [5] to [7] = 4.5
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents