Other Tag Properties

Tags have other properties that can be read in addition to their values. For example, device drivers maintain seven logged variables that are available to your expressions1. Access any property of a tag, including its value, by adding a backslash and the property name.

For example:

[Tag Name]\Description

(Returns a phrase identifier key, not the text of the description. Multilingual Expressions)

[Device Driver Name]\Quality

[I/O Tag Name]\HighAlarmUnacked

[I/O Tag Name]\ScaledMax

Remember that expressions can read values and can calculate using values, but they do not write values. To set one of these properties automatically, use a Tag Parameter Expression in the tag's configuration dialog.

You might wonder how to find the property names. There are two methods. The easiest is to use the Idea Studio and linked tag properties. An advanced method is to use the Source Debugger, which provides added information about what the property holds (text, number, array, etc.)

Care is required both when selecting a property and then when using the property.

1) When selecting properties, note that names do not guarantee content. For example, some may have names that look like they hold the information you want, but the property is actually an enumerator rather than storage of whatever property.

2) Some properties hold arrays or object references rather than simple values. Also, different types of tags will use properties as appropriate for that tag, requiring you to look further rather than assume that a property in one tag will be the same as a property of the same name in a different type of tag.

An example of that last point is the property AlarmActive, which in a Rate of Change tag is an array with index 0 corresponding to Low and 1 corresponding to High. But in an I/O tag, the meaning of the AlarmActive array index varies depending on the alarms configured. For this specific example of alarm status, it may be better to use the functions GetAlarmName and IsActive, etc. as appropriate.

Use the Idea Studio to find tag properties:

  1. Open the Idea Studio.
  2. From the file menu, select New >> Tag Widget.
  3. In the Select Tag Types dialog, choose the tag for which you want to discover property names.
    (You are advised to use this technique with only one tag type at a time.)
  4. Accept the default name for the widget.
  5. Drag a square (or any shape) to the widget.
  6. Open the square's properties dialog.
  7. Set the data source of the fill color to Linked Tag Property.

The data source of the fill color can be selected from a color wheel, a tag value, a parameter, a linked property or an expression.

Changing the data source of a square's fill property

  1. Expand the Linked Tag Properties drop-down to browse the parameters list.

The linked tag properties drop-down menu will display all available options

Selecting parameters of a linked tag property

Use the Source Debugger to find tag properties:

The Source Debugger is a very powerful tool for examining applications

To find the names of properties within a tag, follow the numbers in the preceding figure. It will help if the Sort Tree tool is selected in the toolbar as indicated.

  1. Click to select the running application.
  2. This is the "static tree list". Find and select the tag type that you want to examine.
  3. This is the "module content window" with the "local" mode selected. Scroll to view the property names.

Names that begin with a symbol such as # or @ are for use by VTScada. They are unlikely to be useful in your expressions.

The Source Debugger and other diagnostic tools have code-level access to running applications. This is part of the reason the Security Best Practices topic in the VTScada documentation advises you to keep the VAM hidden from unauthorized users while your application runs.

Expressions that use tag properties

  1. On the Station 1 page, create text that uses an expression to combine the words, "Driver status: " with the driver's current quality value.