Arrays - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

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

Advertisement

4.4

Arrays

An array represents a consecutive aggregation of same data type labels as a single name.
Primitive data types and structures can be defined as arrays.
• One-dimensional array
Label name
Index
[0]
[1]
...
bLabel1
Defining arrays
■ Array elements
When an array is defined, the number of elements, or the length of array, must be determined. For the range of the number of
elements, refer to the following.
Page 44 Range of the number of array elements
■ Dimension number of multidimensional array
Up to three-dimensional array can be defined.
■ Definition format
The following table lists definition format.
The range from the array start value to the array end value is the number of elements.
Number of
Format
array
dimensions
One dimension
Array of primitive data type/structure name (array start value..array end value)
[Definition example] Bit (0..15)
Two dimensions
Array of primitive data type/structure name (array start value..array end value, array start value..array end
value)
[Definition example] Bit (0..1, 0..15)
Three
Array of primitive data type/structure name (array start value..array end value, array start value..array end
dimensions
value, array start value..array end value)
[Definition example] Bit (0..2, 0..1, 0..15)
■ Initial value
One initial value can be set for a single array definition. (Different initial values cannot be set for each element.)
The same initial value is stored in all the array elements.
[n]
• Two-dimensional array
Label name
Index
[0,0]
[0,1]
bLabel2
[1,0]
[1,1]
·
·
·
[m,0]
[0,n]
·
·
[m,n]
Remarks
• For the primitive data
type:
Page 40 Primitive data
type
• For the structure name:
Page 46 Structures
4 LABELS
4.4 Arrays
4
43

Advertisement

Table of Contents
loading

Table of Contents