Issues and Risks

VTS already contains a large body of code for allowing arbitrary expressions to be used as inputs.

This code is separate and very different from the expressions implementation as it currently stands. It is also incomplete. The released expressions implementation is basically a stopgap until the two code bases can be brought together. In the meantime, this can lead to some very confusing namespace clashes. For example, the ExpressionEditor is a widget related to the unreleased expressions code that is part of the Tag Type Builder. On the other hand, the ExpressionEdit is a widget used to enter expressions for the ExpressionManager, part of the current expressions implementation.

Care must be taken when assigning to and from variables that may hold expression values.

This expressions implementation assumes that only one variable at a time holds a reference to a running expression.

A running expression must be slain before assigning to a variable that refers to it. Failing to do this will result in an orphaned expression, which is worse than creating a memory leak, because processor cycles are additionally wasted.

A reference to a running expression should not be copied; instead, a new expression should be started with the same source. Failing to do this consistently will result in expressions dying unexpectedly.

The convenience methods \ExpressionManager\SafeAssign() and \ExpressionManager\SafeCopy() are provided to make this easier for developers.

Care must be taken not to rely on expressions running on different servers to return the same thing (example: Now(1))

It is fairly easy to create a situation where VTS behaves unexpectedly because Expressions are returning different values on each PC in a remote application. For example, while testing the changes to the PlotData drawing method, a Logger was created that accepted input from a Function tag, which in turn used an expression that relied on the local clock. This resulted in some strange logs when synching between different PCs, because the local clock differed on each PCs.