4 LABELS
4.4 Arrays
27
4
• The data storage location becomes dynamic by specifying a label for the array index. This enables arrays to
be used in a program that executes loop processing.The following is a program example that consecutively
stores "1234" in the "uLabel4" array.
• In the case of the ladder diagram, arrays can be used with element numbers omitted. When the element
number is omitted, it is converted to the starting number of the array element. For example, when the label
name you define is "boolAry" and the data type is "bit (0..2,0..2)", then "boolAry[0,0]" and "boolAry" are
treated in the same way.
• A multidimensional array can be specified as setting data of an instruction, function, or function block using
arrays. In that case, the rightmost element in the multidimensional array is treated as the first dimension.
Maximum number of array elements
The maximum number of array elements differs depending on data types.
Precautions
■When an interrupt program is used
When a label or device is specified for the array index, the operation is performed with a combination of multiple instructions.
For this reason, if an interrupt occurs during operation of the label defined as an array, data inconsistency may occur
producing an unintended operation result.
To prevent data inconsistency, create a program using the DI/EI instructions that disables/enables interrupt programs as
shown below.
For the DI/EI instructions, refer to the following.
Programming manual (Instructions, Standard Functions/Function Blocks)
Data type Setting range
Bit
Word [Unsigned]/Bit String [16-bit]
Double Word [Unsigned]/Bit String [32-bit]
Word [Signed]
Double Word [Signed]
FLOAT [Single Precision]
Time
Timer
Retentive Timer
Counter
Long Counter
Function Block
1 to 32768
String(32) 1 to 32768 character string length
bLabel1
bLabel2
uLabel4[wLabel3]K1234MOV
wLabel3INC
Program using the label defined as an array
DI
EI