System Model > Variable Tags > Arrays

Arrays

An array is a collection of variables (all of the same data type) that are stored in consecutive memory registers in an I/O device.

Citect SCADA supports two types of arrays:

Numeric arrays

Numeric arrays are useful when you have separate devices (or processes) performing similar functions. You can program the I/O device to store, in consecutive memory registers, variables that relate to each of these processes.

In the following example, five consecutive variables (V500, V501, V502, V503, and V504) store the conveyor speed of five conveyors (1 to 5).

Instead of configuring five separate variable tags (one for each conveyor), you can configure a single tag as an array.

To specify a single variable tag for an array, define the first address and add the size of the array (the number of consecutive addresses) to the register address.

Variable Tag Name

Conveyor_Speed

Address

V500[5]

Here, five register addresses are referred to by the variable tag Conveyor_Speed.

String Arrays

If you are using a Citect SCADA string data type, you need to specify an array of integer data types. One INT register stores two string characters.

To calculate the size of an array (for string data types), use the following formula:

The last element of the array is always used to store the null character '\0'. This character marks the end of the string.

To store the word "Recipe", you need to specify an array with 4 elements, for example:

Variable Tag Name

Recipe_Tag

Address

V500[4]

Two characters are stored in each register, that is:

You can then refer to the entire string by specifying the tag:

<Tag Name>

For example:

Variable Tag

Recipe_Tag

To store the word "Recipes", you would also specify an array with 4 elements. The characters are stored as follows:

Note: If your I/O device supports string data types, you need to specify the address in the format determined by the I/O Device you are using.

See Also

Published June 2018