Motion synchronous actions
10.4 Actions in synchronized actions
Job planning
610 Programming Manual, 07/2010, 6FC5398-2BP40-0BA0
10.4.24 Initialization of array variables (SET, REP)
Function
Array variables can be initialized or described with particular values in synchronized actions.
Note
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.
Syntax
DO ARRAY[n,m]=SET(<value1>,<value2>,...)
DO ARRAY[n,m]=REP(<value>)
Significance
ARRAY[n,m]
Programmed array indices set
Initialization starts at the programmed array indexes.
For 2D arrays, the second index is incremented first.
This is not done with axis indices.
SET(<value1>,<value2>,...)
Initialization with value lists
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, an alarm is triggered.
REP(<value>)
Initialization with the same values
The array is described from the programmed array
indices to the end of the array and repeated using the
parameter
<value>) of REP.
Example
Program code Comments
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