Calculation symbols
Previous Topic  Next Topic 

Calculation Symbols are special objects with which you can define calculations. They can be used for calculations that refer to symbols by Tagname.

The Calculation form is shown when you double click a Calculation Symbols. Once saved, where the text matches a Tagname in the model then that will change if the Tagname changes.

A calculation can be treated as an Expression or a Function.

An Expression returns a single value for each line, for example 1 + 1 would return 2. (note - a transition should only have one line)

Functions can set symbols in the model - the results are shown in the variable table

You can make any symbol a calculation symbol by settings it's ObjectTag to '_Calculation'

With SFC steps and transitions you can do this with the right click menu.

If there is more than one symbol that matches a word in the text then the priority for finding them is, First look on the page that contains the symbol, then look in the entire model, in the order of the diagrams.

Tagnames cannot contain more than two spaces and must be at least 2 characters

Tag Dot ChildTag is also supported.

The Check button colours the text to indicate operators and Tagnames that exist. If a Tagname is on the same page as the Calculation it is underlined. It also build the list of variables, taking the value from the symbol.

The Test button runs the logic, either as an Expression or a Function. With Expression the evaluation runs each line independently and Displays the Result, otherwise the entire calculation is run.

You can enter values for testing with. These are then saved with the symbol and become the value of the symbol when running a diagram, and are restored in the value column in the variables table when you next open the calculation. Where there is Tag Dot ChildTag such as XV01.Open the compound tag get the value from the child symbol.

An example might be where you want a calculated transition.

En expression of   (Val1 > SP1 AND Val2 > SP2)  OR Override could be used

If Val1, SP1, Val2 and Override are objects on the page the simulation should work. It should even work if  they are on other pages and you are running multi page.

Note - Calculation Symbols are not designed for working with the symbols inputs and outputs, do this in Symbol Scripts.