Flexible NC programming
1.1 Variables
Further information (SET)
initialization during definition
● Starting with the 1st array element, as many array elements are assigned with the values
● A value of 0 is assigned to array elements without explicitly declared values in the value
● 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
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)
54
from the value list as there are elements programmed in the value list.
list (gaps in the value list).
be displayed.
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
Programming Manual, 06/2009, 6FC5398-2BP20-0BA0
Job Planning