6-51
6 Programming
NJ-series CPU Unit Software User’s Manual (W501)
6-3 Variables
6
6-3-7 Array Specifications and Range Specifications for Data Types
Two-dimensional Array Specifications
Three-dimensional Array Specifications
Arrays and Structures
You can set an array in which the elements are structures. You can also set a structure in which the
members are arrays.
Arrays with Structure Elements
Structure with Array Members
Instructions with an Array Parameter
Some instructions pass array variables as parameters. To do so, specify only the name of the array
variable as the input parameter.
Example: Passing a Single Array Element to the MOVE Instruction and Passing an Array to the
MOVE instruction
0 1 2 3
0
1
2
3
4
5
Variable Table
abc[ 2 , 3 ]
Variable name Data type
abc A
RRAY [0..5 , 0..3 ] OF INT
X( 0 . 1 )
Y( 0 . 2 )
Z( 0 . 3 )
Variable Table
Variable name Data type
ITEM
ARRAY [ 0..1, 0..2, 0..3 ] OF INT
2
1
0
01
0
1
2
3
Date Type Table
Variable Table
Variables
abc[1].x
abc[1].y
abc[4].x
abc[4].y
Data type Member Member
Str
y
x
INT
DINT
Variable name Data type
abc ARRAY [1..4 ] OF Str