Specifications

4-36
4.4 Method for Specifying Data
4.4.7 Arrays
[Structured ladder/FBD]
[ST]
FOR Index1:=0
TO 4
BY 1 DO
INC(TRUE,Var_D0[Index1]);
END_FOR;
1. When a label or a device is specified for an array index, the operation is
performed with a combination of multiple sequence instructions. Therefore, if
an interruption occurs during the operation of the array label, an unintended
operation result may be produced.
When using interrupt programs, use interrupt disable/enable instructions (DI/EI
instructions) as necessary.
2. If the index
*1
which is outside of the defined range is specified for an array
index, any of the following operations occur.
•An operation error occurs.
•A current value of other label is referred or written.
*1: For example, a value other than the value within 0 to 2 is used for the index of an array which
is declared with the bit array (0..2).
(3) Maximum number of array elements
The maximum number of array elements differs depending on data types as shown below.
Table 4.4.7-2 Maximum number of array
Data type Maximum number
Bit, word (signed), word (unsigned)/16-bit string, timer, counter, and retentive timer 32768
Double word (signed), double word (unsigned)/32-bit string, single-precision real, and time 16384
Double-precision real 8192
String 32768 divided by string length