Initialization Of Array Variables With Set, Rep - Siemens SINUMERIK 840D sl Programming Manual

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

Advertisement

10.4.24

Initialization of array variables with SET, REP

Function
Array variables can be initialized or described with particular values in synchronized actions.
Programming
DO ARRAY[n,m]=SET(value1, value2, ...)
or
DO ARRAY[n,m] = REP(value)
Initialization starts at the programmed array indexes. For 2D arrays, the second index is
incremented first. This is not done with axis indices.
Value assignments of array variables
Only variables that can be described in synchronized actions are possible. Machine data
cannot therefore be initialized. Axis variables cannot be specified using the NO_AXIS value.
SET(value list)
REP (value)
Value list
Value
SET(value list)
The array is described from the programmed array indices onwards using the SET
parameters. As many array elements are assigned as values are programmed. If more
values than exist in the remaining array elements are programmed, a system alarm is
triggered.
REP(value)
The array is described from the programmed array indices to the end of the array and
repeated using the REPparameters.
Example
WHEN TRUE DO SYG_IS[0]=REP(0)
WHEN TRUE DO SYG_IS[1]=SET(3,4,5)
Result:
SYG_IS[0]=0
SYG_IS[1]=3
SYG_IS[2]=4
SYG_IS[3]=5
SYG_IS[4]=0
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Motion synchronous actions
10.4 Actions in synchronized actions
Initialization with value lists
Initialization with the same values
With the number of specified values
With the same value up to the end of
the array
10-59

Advertisement

Table of Contents
loading

Table of Contents