Specifications

4.4 Method for Specifying Data
4.4.7 Arrays
4-35
4
PROGRAM
CONFIGURATION
4.4.7 Arrays
An array represents a consecutive aggregation of same data type labels.
Arrays can be defined by the elementary data types or structures.
( GX Works2 Version 1 Operating Manual (Structured Project))
The maximum number of arrays differs depending on the data types.
(1) Definition of arrays
The following table shows the format of definition.
Table 4.4.7-1 Form used to define array
(2) Expression of arrays
To identify individual labels of an array, append an index
enclosed by '[ ]' after the label name.
Values that can be specified for indexes are within the range
from -32768 to 32767.
For an array with two or more dimensions, delimit indexes in
'[ ]' by ','.
For the ST and structured ladder/FBD languages, labels (word (signed) or double word
(signed) data type) can be used for indexes as shown on the next page.
Note that Z0 or Z1 cannot be used in the programs if labels are used for indexes.
Number of
array
dimensions
Format Remarks
One
dimension
Array of elementary data type/structure name (array start value .. array end
value)
For elementary data types
Section 4.3.5
For structured data types
Section 4.4.8
(Definition example) Bit (0..2)
Two
dimensions
Array of elementary data type/structure name (array start value .. array end
value, array start value .. array end value)
(Definition example) Bit (0..2, 0..1)
Three
dimensions
Array of elementary data type/structure name (array start value .. array end
value, array start value .. array end value, array start value .. array end value)
(Definition example) Bit (0..2, 0..1, 0..3)
Label name
boolary1[0]
[1]
[n]
boolary2[0,1] [0,n]
[1,0] [1,1]
[m,0][m,n]
One-dimensional array Two-dimensional array
Index Label name
[0,0]
Index
boolary1 [0] boolary2 [0.3]
Label name index
Example)