Using CitectSCADA > Tagging Process Variables > Tag Extensions

Tag Extensions

A variable tag is a representation of data elements. Each element provides access to a view of the data value for the tag.

Each variable tag can be used on its own or by referencing a particular element to access the following information:

Element Description
.field The field element, which represents the latest field data received from the device (see Reading Tag Values).
.valid

The valid element, which represents the last field data which had ‘Good’ quality (see Reading Tag Values).

.override The override element, which represents the overridden tag value (see Controlling and Overriding Tag Values).
.overridemode The override mode, which is used to set the override behavior of the tag (see Override Mode).
.controlmode The control mode, which is used to set the control inhibit mode of the tag (see Control Inhibit Mode).
.status The tag status element, which is used to represent the current status of the tag (see Tag Status).

The tag and each element have items that can be referenced to access the following information:

Item Description
v The value, which will access the data value of the tag or element.
vt The value timestamp, which will access the timestamp of when the value last changed.
q The quality, which will access the quality of the value , either GOOD, UNCERTAIN or BAD. You can access further detail from the quality using the Cicode Quality functions.
qt The quality timestamp, which will access the timestamp of when the quality last changed.
t The timestamp, which will access the timestamp of when the tag or element was last updated.

The tag reference syntax is:

[Cluster.]Tag[.Element][.Item][ [n]], where

Cluster The optional cluster name.
Tag The tag name or SuperGenie association.
Element The optional element name. If the element name is not specified, the requested element will be determined at runtime.
Item The optional item name. If the item name is not specified, the whole element is referenced.
n The optional array index if the tag is defined as an array.

The array index is at the end of the reference (MyArray.v[n], MyArray.Field[n], MyArray.Field.v[n]). There is only a single quality and timestamp for each array, each member will return the same quality and timestamp.

Note: Consider the impact on network traffic when configuring tag extensions, as the distribution of quality and value timestamps increases the amount of data being sent between servers.

You can access Tag data in the following ways:

1. Reference the tag data by using only the tag name, for example ‘MyTag’ (unqualified tag reference). This will provide default access to the Field element information, unless the tag is in one of the override modes.

2. Reference the tag data by using the tag name and the item name, for example ‘MyTag.q (unqualified tag reference). This will provide access to the item information for the tag, either default from Field or Override element.

3. Reference the tag data by using the tag name and the element name, for example ‘MyTag.Field’ (qualified tag reference). This reference will provide access to the specific tag element information.

4. Reference the tag data by using the tag name, element name and the item name, for example ‘MyTag.Field.vt’. This reference will provide access to the specific tag element item (qualified tag reference).

You can also access alarm data similar to tag data. See Using Alarm Properties as Tags.

Controlling Tag Extension behavior

By default, the tag data referenced without an element will provide access to the data value when the value is of quality is good and an error (#BAD, #COM, etc) when the quality is bad. The configuration parameter [Page] IgnoreValueQuality can be used to change this behavior, including automatically changing the background color of text and number graphics objects on a page with changes in quality of the tag.

The Tag Extensions behavior is controlled by several citect.ini file settings which are described in the Parameter Help file. For each of these settings there is a corresponding setting in the parameters database (param.dbf). A citect.ini file setting specifies behavior for a particular machine and a parameter database setting is applied system-wide. The citect.ini file setting can be entered using the Computer Setup Editor, the parameter database settings are configured in the CitectSCADA Project Editor from the System, Parameter menu.

Note: By default, the TagSubscribe Cicode function is set to retrieve "lightweight" tag values that exclude quality and value timestamps. If you need a subscription to retrieve timestamp data, you need to set the "bLightweight" argument to 0 (false).

See Also