Arrays
You can specify dimension(s) for internal variables, in order to declare arrays. All indexes are 0 based. For instance, in case of single dimension array, the first element is always identified by ArrayName[0].
To declare an array, enter its dimension in the corresponding column of the variable editor. For a multi-dimension array, enter dimensions separated by comas (ex: 2,10,4).
Use in ST and IL languages
To specify an item of an array in ST and IL language, enter the mane of the array followed by the index(es) entered between "[" and "]" characters. For multi-dimension arrays, enter indexes separated by comas. Indexes may be either constant or complex expressions.
|
TheArray[1,7] := value; |
Use in FBD and LD languages
In graphical languages, the following blocks are available for managing array elements:
Block |
Description |
[I]>> |
Get value of an item in a single dimension array. |
[I,J]>> |
Get value of an item in a two dimension array. |
[I,J,K]>> |
Get value of an item in a three dimension array. |
>>[I] |
Set value of an item in a single dimention array. |
>>[I,J] |
Set value of an item in a two dimension array. |
>>[I,J,K] |
Set value of an item in a three dimension array. |
For get blocks, the first input is the array and the output is the value of the item. Other inputs are indexes in the array.
For put blocks, the first input is the forced value and the second input is the array. Other inputs are indexes in the array.
|
|
Arrays |
IEC 61131-3 Automation platform > Programming - Reference guide > Arrays |
Created with the Personal Edition of HelpNDoc: Converting Word Docs to eBooks Made Easy with HelpNDoc