Historic Functions and Arguments

You need to use historic functions to specify which historic values are used by your program. Each historic function requires values for its arguments (as shown below). You have to include each argument when you use a historic function in an ST program or Function Block Diagram.

The arguments include StartTime and EndTime which define a time span, RecordIdx which is the number used to identify one historic value, and Forward which is used to instruct the program to move through a series of historic values. Forward arguments can have values of True or False (True means proceed forward to the next historic record; False means proceed backwards to the previous historic record).

You will need to use the following information when using a historic function:

Function Arguments

Returns

RawCount

StartTime, EndTime

The number of values between the StartTime and EndTime

RawValue

StartTime, EndTime, RecordIdx, Forward

Value between StartTime and EndTime at RecordIdx

RawTimeStamp

StartTime, EndTime, RecordIdx, Forward

Time value between StartTime and EndTime at RecordIdx

RawQuality

StartTime, EndTime, RecordIdx, Forward

Quality value between StartTime and EndTime at RecordIdx

RawQualityDesc

StartTime, EndTime, RecordIdx, Forward

Quality description between StartTime and EndTime at RecordIdx

RawCountRange

StartTime, Interval

The number of values between StartTime and StartTime+Interval at RecordIdx

RawValueRange

StartTime, Interval, RecordIdx, Forward

Value between StartTime and StartTime+Interval at RecordIdx

RawTimestampRange

StartTime, Interval, RecordIdx, Forward

Value between StartTime and StartTime+Interval at RecordIdx

RawQualityRange

StartTime, Interval, RecordIdx, Forward

Value between StartTime and StartTime+Interval at RecordIdx

RawQualityDescRange

StartTime, Interval, RecordIdx, Forward

Value between StartTime and StartTime+Interval at RecordIdx

ProcessedValue

StartTime, EndTime, AggregateId

Historic value between StartTime and EndTime using AggreagteId.

For a list of the historic algorithms that are available, see OPC Historic Aggregates (Algorithms) in the Geo SCADA Expert Guide to Expressions.

Take care with End and End Last Historic Algorithms used in Logic programs that run in Local Time with Daylight Saving Time. Ensure that the start and end times specified for the sample interval do not coincide exactly with the time at which the clock jumps backward. Include a small offset in the sample time, to offset the calculation to avoid the sample end or start time exactly matching the time that the clock jumps backward at the transition from Daylight Saving Time to Standard Time. A small offset of 1s or even 1ms should suffice. For more information about Daylight Saving Time, see The Effects of Daylight Saving Time Adjustments.

Further Information

Raw Historic Values in ST Programs.

Add Raw Historic Values to Function Block Diagrams.


Disclaimer

Geo SCADA Expert 2019