Basics
54
Declaration
To declare ARRAY type variables in the POU header use the following syntax:
ARRAY[A...B,C...D,E...F] OF <data type> where:
A= first element index
B= last element index
first dimension
C= first element index
D= last element index
second dimension (optional)
E= first element index
F= last element index
third dimension (optional)
Arrays can be 1, 2 or 3-dimensional. In each dimension, an array can have several fields. Element indexes are
positive or negative integers. The first element must be smaller than the last element.
NOTE
An array cannot be used as a variable by another array.
When accessing an index of an array, Control FPWIN Pro does not check the index against the bounds
of the array. Make sure the index lies within the range defined in the POU header.
Example: ARRAY [1..5] OF INT
In this example, ai_array[99] is out of range but does not produce an error message.
Data types valid for arrays are:
BOOL
DATE
DATE_AND_TIME
DINT
DWORD
INT
REAL
STRING
TIME