Expressions

An expression is "any calculation that returns a result". In more practical terms, an expression is something that…

  • can combine or compare multiple tag values for monitoring or reporting.
  • can signal a need for control actions based on any set of system conditions.
  • can get the time, date, signed-in operator, system status, etc.

Why Create an Expression?

As a rule of thumb, expressions are used to "get" things:

  • Calculate values from one or more sources to get a result.
  • Concatenate strings together to get one string.
  • Get the status of something that can be used indirectly to trigger an alarm or event.

Expressions can be instrumental in configuring alarm suppression rules, creating context-sensitive operator instructions, or creating parameterized resources that are scalable and easy to maintain.

Why Not Create an Expression?

The second part of the rule, expressions should not be used to "do" things:

  • Do not set an external value using an expression.
  • Do not acknowledge an alarm by expression.
  • Do not trigger an event directly using an expression.

Expressions get values for tools like Memory tags (which don't count towards your tag count), Multi-Write tags, and Trigger tags to do things with. They are intended to be lightweight and used directly in tags and widgets.

VTScada has been under continuous development for decades and boasts a huge library of easily configurable tools. If you find that, by the logical progression of your application building, your expressions have become quite lengthy and have begun to resemble scripting logic, take a second look at the catalog of available options. It is very likely that there is an existing feature that already has the problem figured out, is scalable and will continue to be supported by VTScada in new versions.

General steps to create an expression:

In any VTScada tag configuration field that has the options, Constant, Expression, Tag...

Expressions are frequently used for tag configuration

  1. Click the Expression option to select it.
  2. Click the expression editor button.
  3. Enter an expression into the editor window.

    The expression editor window can be re-sized as needed.

  4. Click OK to save your work and return to the tag configuration.

The maximum length of an expression is 65535 characters.
If your expression approaches this limit, you should consider whether there might be a shorter way to write it.