Array tags
- Last UpdatedOct 29, 2026
- 3 minute read
An array tag is a set of tags that all have the same name, and that uses an array index (a matrix of n lines and one column) to differentiate between each tag.
The array index can be a fixed value, a tag, or an expression. Maximum array sizes are determined by product specifications.
You can use array tags to:
-
Simplify configurations
-
Enable multiplexing in screens, recipes, and communication interfaces
-
Save development time during tag declaration
You specify array tags in one of two formats:
-
For a simple array tag, type:
ArrayTagName[ArrayIndex]
-
For a complex array tag (where the array index is an expression consisting of a tag and an arithmetic operation), type:
ArrayTagName[ArrayIndex+c]
Where:
-
ArrayTagName is the tag name;
-
[ArrayIndex] is the unique index (fixed value or another tag);
-
+ is an arithmetic operation; and
-
c is a numerical constant.
-
Array index notes:
-
You specify a maximum index for each array tag by typing a value (n) in the Array Size column of an Project Tags datasheet or in the Array Size field on a New Tag dialog. (See Project Tags folder).
When you create an n-position array tag, n+1 positions are created (from 0 to n). For example, if you specify ArrayTag[15], the array will have 16 elements, where 0 is the start position and 15 is the end position.
-
Do not use spaces in an array tag or array tag index. The tag is read starting with the first character and continuing until the first space or null character. Consequently, the system does not recognize any characters following the space as part of the array tag.
For example, if you type a[second + 1], the tag is read as a[second, which is invalid because is no closing bracket. However, a[second+1] is a valid array tag.
You can specify an array tag wherever you would use a variable name. Also, because array tags greatly simplify configuration tasks and can save development time, we suggest using them whenever possible.
For example, suppose you want to monitor the temperature of four tanks. The conventional configuration method is:
-
temperature1 — high temperature on tank 1
-
temperature2 — high temperature on tank 2
-
temperature3 — high temperature on tank 3
-
temperature4 — high temperature on tank 4
You can use array tags to simplify this task as follows (where [n] represents the tank number):
-
temperature[n] — high temperature on tank n
The following table contains some additional examples of an array tag:
Array Tag Examples
|
Array Tag Example |
Description |
|---|---|
|
Tank[1], Tank[2], Tank[500] |
Simple arrays, where the array indexes (1, 2, and 500) are numerical constants. For example, tank numbers. |
|
Tank[tk] |
A simple array, where the array index (tk) is a tag. For example, a tag representing the tank number. |
|
Tank[tk+1] |
A complex array, where the array index (tk+1) is an expression. For example, the value of tk (tank number) plus 1. |
Exceeding the tag array index
When using another tag to reference the index of an array, if the value of the tag is outside the size of the array, then the following results are given:
-
If IndexTag is greater than the size of the array, then MyArray[IndexTag] will point to the end position of the array; and
-
If IndexTag is less than 0, then MyArray[IndexTag] will point to the start position of the array, for example MyArray[0].