EasyManua.ls Logo

Mitsubishi Electric R64MTCPU - Arrays

Mitsubishi Electric R64MTCPU
354 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
4 OPERATION CONTROL PROGRAMS
4.4 Labels
127
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.
The maxim number of array elements varies depending on the data type.
Defining arrays
Array elements
When an array is defined, the number of elements, or the length of array, must be determined.
Definition format
The following table lists definition format examples up to three dimensions.
The range from the array start value to the array end value is the number of elements.
How to use arrays
To use an array, add an index enclosed by "[ ]" after each label name to identify individual labels.
An array with two or more dimensions should be represented with indexes delimited by a comma (,) in "[ ]".
The following table lists the types of indexes that can be specified for arrays.
Number of array
dimensions
Format Remarks
One dimension Array of primitive data type/structure name (array start value..array end value) Refer to primitive data type
for details on primitive data
type (Page 126
Primitive data type)
Refer to structures for
details on structures
(Page 128 Structures)
[Definition example] Bit (0..2)
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..2, 0..1)
Three dimensions Array of primitive data type/structure name (array start value..array end value, array start value..array
endvalue, array start value..array end value)
[Definition example] Bit (0..2, 0..1, 0..3)
Type Specification example Remarks
Constant bLabel1[0] An integer can be specified.
Device bLabel1[D0] A word device, double-word device, decimal constant, or hexadecimal constant can be specified. (Data
register(D), Link register(W), and Motion register(#) devices can be used.)
Index
[0]bLabel1
Label name
[1]
·
[n]
Index
Label name
bLabel2 [0,0]
[1,0]
·
[m,0]
[0,1]
[1,1]
·
·
[0,n]
·
·
·· ·
·
[m,n]
Two-dimensional arrayOne-dimensional array
bLabel1 [0] bLabel2 [0,3]
Label name Index

Table of Contents

Other manuals for Mitsubishi Electric R64MTCPU

Related product manuals