Might try here :
https://infosys.beckhoff.com/englis.../1033/tc3_plc_intro/9007201784205195.html&id=
>>>
ARRAY
TwinCAT supports one-, two- and three-dimensional arrays of elementary data types. You can define arrays in the declaration part of a function block and in the global variable lists.
Only VAR_IN_OUT variables of function blocks, functions and methods can be declared with the data type of an array of variable length.
For variable-length arrays, the operators LOWER_BOUND (<array name>,<dim>) and UPPER_BOUND (array name,<dim>) provide the lower and upper bounds.
Syntax for declaring an array with a defined length:
<array_name> : ARRAY [<ll1>..<ul1>,<ll2>..<ul2>] OF <elem. type>
ll1, ll2, ll3 indicate the lower bound of a field dimension, ul1, ul2 and ul3 the upper limit. These limits must be integral values.
Example:
aCardGame : ARRAY [1..13, 1..4] OF INT;
Syntax for declaring an array with variable length:
<array_name> : ARRAY [*|, *|, *] OF <data type>;
Example:
//An diese Additionsfunktion können Arrays mit verschiedener Längen übergeben werden
FUNCTION F_Sum : DINT;
VAR_IN_OUT
aSample: ARRAY [*] OF INT;
END_VAR
VAR
nI, nSum2 : DINT;
END_VAR
nSum2 := 0;
//Die Länge des jeweiligen Arrays wird ermittelt
FOR nI:= LOWER_BOUND(aSample,1) TO UPPER_BOUND(aSample,1) DO
nSum2 := nSum2 + aSample[nI];
END_FOR;
F_Sum := nSum2;
Initialization of arrays
>>>
Poet.