Expression Agent

The Expression Agent type is an extremely powerful mechanism for implementing user-defined calculations.  These calculations can be used for a number of purposes.

Some of the more obvious uses are:

  • For constructing control strategies by combining and connecting expressions into arbitrarily complex networks, and for scanning out one or more of the resulting values;
  • For enabling or disabling of alarming;
  • For enabling logging on a section of the plant when a process value exceeds a certain threshold;
  • For creating sophisticated animation effects by linking the output of an expression to a display object animation behaviour; and
  • For creating relatively simple plant simulations by connecting a network of expressions together.

Each expression Agent can contain up to 20 input variables, each of which can be sourced from any other Agent attribute or directly from a front-end device.  For complex calculations, expression Agents can be interconnected with the result of one expression becoming an input to the next.

The expression slot contains the actual mathematical ex3pression to be evaluated.  To make the expression readable, any number of new lines or spaces are permitted.  The expression syntax supported is that of a full ANSI-C expression (i.e., not a partial subset), including sub-expressions nested to an arbitrary depth, conditional operators, bit wise operators, logical operators, relational operators, unary operators, etc., as well as a comprehensive suite of mathematical functions.

The use of variable input names V1, V2, etc., are used in the expression so that it is generic.  For example, by associating different Agent.slot combinations with the input variable definitions, an expression Agent can be reused in many different contexts without changing the actual expression. An expression can be configured to evaluate either continuously or on receipt of a trigger pulse (the default).  By connecting an expression’s trigger input to another Agent slot that changes periodically it is possible to cause periodic evaluation of the expression.

Alternatively, the trigger can be connected to some other input, possibly common to a number of other expressions, which may be used to constrain the group of expressions to evaluate, for example, only when data is valid.