InduSoft Web Studio - InduSoft Corporation
InduSoft Web Studio - InduSoft Corporation
InduSoft Web Studio - InduSoft Corporation
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />
Tutorial training – Revision B – Sep/10/2000<br />
© Copyright <strong>InduSoft</strong> Ltd. 2000<br />
Classes, Arrays and pointer tags<br />
Array tags<br />
<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong> tags can hold a single value or an array of values. An array tag is a set of<br />
tags with the same name; it is identified by indexes (a matrix of n lines and 1 column). The<br />
maximum array size is 512 (positions from 0 to 512).<br />
Examples: tank[1], tank[2], tank[3], tank[500]<br />
Use array tags whenever possible, because they simplify your configuration task. Suppose that<br />
you want to have a display to monitor each tank. Using array tags makes it possible to configure a<br />
single display that contains tags linked to any tank:<br />
pressure[tk], temperature[tk], temperature[tk +1]<br />
The tag tk is the index that contains the number of the desired tank. An array index may be a tag,<br />
a numeric value, or an expression with a value plus a tag.<br />
To refer to an array that has an index with the arithmetic operation +, you must use the following<br />
syntax: [+N], where N is a numerical constant.<br />
Examples: temperature[tk+2], temperature[tk+6]<br />
Using array tags can save a lot of application development time. Suppose that you need tag points<br />
related to the temperature of four tanks. The conventional configuration method is:<br />
temperature1 high temperature on tank 1<br />
temperature2 high temperature on tank 2<br />
temperature3 high temperature on tank 3<br />
temperature4 high temperature on tank 4<br />
Using array tags simplifies this task:<br />
temperature[j] high temperature on tank {j}<br />
When you create a four-position array tag, the system creates five positions (from 0 to 4).<br />
Therefore, the TagExample[15] array has 16 elements.<br />
Note: When you try to reach an invalid index, such as 20 on a 15-element array, the 0 th element<br />
is used (losing any data it held), therefore you are advised not to use it for normal operations.<br />
Classes<br />
In addition to the standard tag types, you can also define new types of tags called classes. Classes<br />
are structures that allow a high degree of encapsulation in the application database. When a classtype<br />
tag is created, it does not contain a single value, but a whole set of values. You can create<br />
class-type tags by grouping up to 32 simple tags, called elements. When you create a class tag, its<br />
tag does not have a single value, rather it has a group of values associated with the class, for<br />
example:<br />
Page 24