Skip to main content
How Can We Help?

Search for answers or browse our knowledge base.

Calculated Tags

You are here:
< Back

Description

Calculated tags (previewed in V3.1) allow for a tag to be calculated based on an expression (formula) versus being directly retrieved from a remote device. This has all kinds of uses for values that are derived from other device tags, or even other calculated tags. All other functions that tags do are still available to calculated tags (trending, alarming, notifications, etc).

 

Expressions

Expressions are added to the Expressions field in the tblFacilityTags table (V3.2 will contain UI support for this feature). Valid expressions can be most mathematical operations, and operator precedence is maintained, including use of parentheses. It is important to separate all variables with a space to allow proper parsing of the expression. An example of an expression would be ‘PST:10 + (.000034 * PST:10 * TubingLength) – 17’. See below for meaning of variables. Calculated tags are evaluated after the data is retrieved for the regular facility tags, and is ordered based on the address. A convention is to use negative values for the address because they are not used to scan the device and are thus available for this use. The lower numbered addresses are evaluated first, so if a -1 and a -2 existed, the -2 would be evaluated first. This would impact the calculation if one calculated tag got its value from another calculated tag. If there is an error with an expression or a variable (like bad syntax), the variable will return a value of 0. If zero is returned, and a non-zero value is expected, then check syntax for possible errors.

 

Variables

Variables are used to represent values that are based on other attributes. Here are the ones that exist today. As this feature is expanded, more will be added. If customers have ideas for additional useful variables, they can contact Theta’s support team.

 

PST:XXXXX = Substitutes the value for that node’s ParamStandardType, where XXXXX contains the id of the PST.

 

PST.SumChild:XXXXX = Substitutes the value of the sum of all child nodes’ PST’s, where XXXXX contains the id of the PST. Children are identified by field ParentNodeID in tblNodemaster, where that field is equal to the name of the parent node (which is the one that contains the formula).

 

TubingLength = Substitutes the value for that node’s total tubing string length