ARRAY

Top 

 

In an array (field) you save many similar values. Each value gets a number (index). If you declare an array you will have to specify which area these numbers shall have and which kind of values it concerns. If you need a special value of the array you will load it with the name of the array and its number:

 

L   #Arr[5]     // #Arr is declared as Stat-ARRAY of INT

 

But if you want to transfer all data of one field together to a function, for example so that this one sorts the data you will use just the name of the field.

 

      CALL FC 27

      Field: #Arr

(Field is declared in FC 27 as In-Out-ARRAY of INT)

 

In TrySim there are arrays only of simple values. You cannot use arrays of structures and multidimensional arrays e.g. like they are possible in STEP ®7 in TrySim yet.

Permitted types are:

 

BOOL, BYTE, CHAR, INT, WORD, DATE, S5TIME, DWORD, DINT, REAL, TIME_OF_DAY, TIME

 

Arrays of UDTs are limited possible as well.

 

See also:

Data Types

 

STEP®7 is a registered trademark of the Siemens AG.