Arrays - Mitsubishi Electric MELSEC Q Series Structured Programming Manual

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

Advertisement

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.
One-dimensional array
Label name
Index
boolary1
(1) Definition of arrays
The following table shows the format of definition.
Number of
array
dimensions
Array of elementary data type/structure name (array start value .. array end
One
value)
dimension
(Definition example) Bit (0..2)
Array of elementary data type/structure name (array start value .. array end
Two
value, array start value .. array end value)
dimensions
(Definition example) Bit (0..2, 0..1)
Array of elementary data type/structure name (array start value .. array end
Three
value, array start value .. array end value, array start value .. array end value)
dimensions
(Definition example) Bit (0..2, 0..1, 0..3)
(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.
Label name
[0]
boolary2
[1]
[n]
Table 4.4.7-1 Form used to define array
Two-dimensional array
Index
[0,0]
[0,1]
[0,n]
[1,0]
[1,1]
[m,0]
[m,n]
Format
Example)
Label name
4.4 Method for Specifying Data
Remarks
For elementary data types
Section 4.3.5
For structured data types
Section 4.4.8
boolary1 [0]
boolary2 [0.3]
index
4-35
4.4.7 Arrays
4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l seriesMelsec-f

Table of Contents