Syntax of a Historic Calculation Tag

NOTE: Tags do not apply to Template expressions, instead you use Template Parameters.

A historic calculation tag has the following syntax:

"<Item>.<Database Aggregate>:<Offset>:<Period>:<Maximum Period>"

"<Item>:<Offset>:<Period>:<Maximum Period>"

Where:

Do not enter the angle brackets <>.

Example:

The flow of gas in a pipe is measured by two points:

  • 'Point 1'—This point stores data for a signal that has a range of 0-20. When the gas flow is less than 20, the data from this point is regarded as more accurate than the data from 'Point 2'.
  • 'Point 2'—This point stores data for a signal that has a range of 0-200. When the gas flow is equal to or greater than 20, this point is regarded as being more accurate than 'Point 1'.

    A historic calculation is used to produce 3 days' worth of historic data based on the values from the two points. The historic calculation is named 'PipeFlow' and calculates the values at 15 minute intervals. It is configured to have a 'target' point named 'Flow'.

    The 'Flow' point is an analog point that stores the result of the 'PipeFlow' historic calculation. It has a range of 0-200.

    The historic calculation and the points are stored in the same group.

    When the flow of gas is lower than 20, the historic calculation is to base its calculations on the values from 'Point 1'. When the flow of gas is 20 or higher, the historic calculation is to base its calculations on the values from 'Point 2'. The results of the calculations are stored by the 'Flow' point. To achieve this, the following expression is defined for the 'PipeFlow' historic calculation:

    IIF (".Point 2:0:15M:30M" <20, ".Point 1:0:15M:30M", ".Point 2:0:15M:30M")

    Where:

  • The IIF function is used to test the value of a point. In this case, if the 'Point 2' value is less than 20, the historic calculation will use the value from 'Point 1'. If the 'Point 2' value is 20 or more, the historic calculation will use the value from 'Point 2'.
  • The first expression:

    ".Point 2:0:15M:30M" <20

    This compares the value of 'Point 2' against the number 20.

  • The second expression:

    ".Point 1:0:15M:30M"

    defines the value that is to be used by the historic calculation when the first expression is TRUE.

  • The third expression:

    ".Point 2:0:15M:30M"

    defines the value that is to be used by the historic calculation when the first expression is FALSE.

  • Each tag (within the entire expression) consists of:

    <Item>:<Offset>:<Period>:<Maximum Period>

    For example, the first tag has:

    The Search Range setting defines a time period within the Max Search Range. If a source value is available within the Search Range period, the source value is deemed to have Good quality data. The historic calculation will use the latest source value that has been time stamped before the time that the expression is to be evaluated.

    If there are no source values within the Search Range period, the historic calculation will look for a source value in the remaining part of the Max Search Range period. If it uses a source value from the remaining part of the Max Search Range period, the value is deemed to have Uncertain quality. If the historic calculation has to look in the Max Search Range for a source value, it will use the latest usable value.


Disclaimer

Geo SCADA Expert 2019