6 Programming
6-50
NJ-series CPU Unit Software User’s Manual (W501)
Array Variable Specifications
Dimensions of Array Variables
You can regard the elements of a one-dimensional array as one-dimensional data lined up in a sin-
gle row. You can set two-dimensional and three-dimensional arrays in the same way. The array ele-
ments are expressed by adding the same number of subscripts to the array variable name as the
number of dimensions. Arrays can have a maximum of three dimensions.
Item Specification
Maximum number
of elements for an
array variable
65,535
Element numbers 0 to 65535
The number for the first element in an array does not have to be 0.
Subscripts Constants: Integer value between 0 and 65535
Variables:
Classification Data type Usage
Basic data type
Integer SINT, INT, DINT, USINT, UINT,
or UDINT
Supported.
LINT or ULINT Not sup-
ported.
Boolean, bit string, real, duration, date, time of
day, date and time, or text string data
Not sup-
ported.
Derivative data
types
Structures, unions, and enumerations Not sup-
ported.
POU instances
Not sup-
ported.
Arithmetic expressions: Arithmetic expressions can be specified only in ST.
Example: y:= x[a+b];
Variable Table
Variable name Data type
abc ARRAY [ 0 .. 4 ] OF INT
Represents the first number of the elements of the array.
Represents the last number of the elements of the array.
Represents the data type of the array variable.
abc
[0]
abc
[1]
abc
[2]
abc
[3]
abc
[4]
Array