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 expressions. 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 ExpressionsMultilingual 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. The easiest is to use the Idea Studio and linked tag properties. An advanced method is to use the Source Debugger.

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.

Changing the data source of a square's fill property

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

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 - Easy

  1. Open the Tag Browser and navigate to Pump 1.
  2. Add a new child tag of type, I/O and Calculations.
  3. Name it Speed Percentage
  4. Set the data type to Analog with the Calculation option selected.
  5. In the Calculation tab, select the Expression option then open the Expression Editor.
  6. Enter the following expression, exactly as shown:
    100 * [Speed] / ([Speed]\ScaledMax - [Speed]\ScaledMin)
  7. Click OK to save the expression and close the editor.
  8. On the Display tab, change the Engineering Units to:
    % of max
  9. Close the properties dialog.
  10. Draw Speed Percentage as a Numeric Value widget on the Station Status page.
  11. Operate the system to run the pump, changing the motor speed.

By using the scaled min and max values from the tag, you build flexibility into your expression.

(This is a good time to explore the VTScada Scale function.)

Expressions that use tag properties - Advanced

  1. On the Station Status page, there is a label, "Communication Driver Status".
  2. Replace that static text with an expression that adds the driver's current error value.
    0 means "no error" - you might state that explicitly instead of just displaying 0.