omron — Using Array Tags

About Tags and the Project Database Using Array Tags IWS tags can consist of a single value or an array of values. Note: The maximum array size is 16384 as long as it does not exceed the maximum number of tags supported by the license (Product Type) selected for the project. Each array position (including the position 0) counts as one tag for licensing restrictions, because each position has an independent value. An array tag is a set of tags with the same name, which is identified by indexes (a matrix of n lines and 1 column). The maximum array size depends on the product specification. You can use the following syntax to access an array tag: ArrayTagName [ ArrayIndex ] For example:

tank[0] , tank[1] , tank[2] , and tank[500] . Note: You must specify a maximum index for each array tag in the size column of any datasheet. You can specify n to indicate the array tag has positions from 0 to n . For example, if the size of TagA is 3, the tag elements could be TagA[0] , TagA[1] , TagA[2] , and TagA[3] . Use the array tag whenever possible because it optimizes memory use and simplifies the configuration task. For example, if you want a display to monitor each tank, you could use array tags to configure a single display containing tags linked to any tank. For example (using the tk tag as an index containing the number of the tank):

pressure[tk] , temperature[tk] , and temperature[tk+1] . An array index can be a tag, a numeric value, or an expression with the arithmetic operator " + ". Note: When you refer to an array with an index using the + arithmetic operation, you must use the following syntax: ArrayTagName [ NumValue1 + NumValue2 ] Where NumValue1 and NumValue2 can be an integer tag or a numerical constant. For example: temperature[tk+2] or temperature[tk+6] . Using array tags in any IWS task can save a signification amount of project development time. For example, if you needed tag points related to the temperature of four tanks. The conventional configuration method is the following: • temperature1 :

high temperature on tank 1 • temperature2 : high temperature on tank 2 • temperature3 : high temperature on tank 3 • temperature4 : high temperature on tank 4 Using array tags simplifies this task, as follows: • temperature[j] : high temperature on tank {j} Note: When you create a four-position array tag, the system creates five positions (from 0 to 4). For example: tag_example[15] //start position=0, end position=15 Therefore, the tag_example[15] array has 16 elements. Page 50