Arrays - Mitsubishi MELSEC-Q Series Programming Manual

Hide thumbs Also See for MELSEC-Q Series:
Table of Contents

Advertisement

3.4.6

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 Version1 Operating Manual (Structured Project))
The maximum number of arrays differs depending on the data types.
One-dimensional array
Label name
boolary1
(1) Definition of arrays
The following table shows the format of definition.
Number of array
dimensions
One dimension
Two dimensions
Three dimensions
(2) Expression of arrays
To identify each label 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 languages, labels (word (signed), or double word (signed)
data type) can be used for indexes as shown below.
Note that Z0 or Z1 cannot be used in the programs if labels are used for indexes.
Index
Label name
[1]
boolary2
[2]
[n]
Table 3.4.6-1 Form used to define array
Array of elementary data type/structure name [array start value .. array end value]
(Definition example) Bit (0..2)
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)
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)
Two-dimensional array
Index
[0,0]
[0,1]
[0,n]
[1,0]
[1,1]
[m,0]
[m,n]
Format
Example)
boolary1 [0]
Label name
3.4 Method for Specifying Data
3.4.6 Arrays
3
boolary2 [0.3]
Index
3-17

Advertisement

Table of Contents
loading

This manual is also suitable for:

Qcpu

Table of Contents