OPC Historic Aggregates (Algorithms)
OPC historic aggregates are calculations that can be applied to sets of historic data. For example, you can use the 'Max' OPC historic aggregates to calculate the maximum value in a set of historic data.
NOTE: To avoid confusion with database aggregates, we refer to the calculations that can be performed on historic data as historic algorithms. But in the OPC standard, these calculations are called OPC Historic Aggregates.
The following table lists the Algorithm options:
Algorithm Option | Algorithm | Description |
---|---|---|
1 Hour Moving Average |
1hAverage |
The average value over an hour period that starts at the beginning of the sample. |
24 Hour Moving Average |
24hAverage |
The average value over a 24 hour period that starts at the beginning of the sample. |
8 Hour Moving Average |
8hAverage |
The average value over an 8 hour period that starts at the beginning of the sample. |
Average including last interpolated value |
Average Interpolated |
The average of the values in the sample. The average includes the interpolated value at the start of the interval. |
Average including last value |
Average Last |
The average of the values in the sample. The average includes the last value reported before the start of the interval. |
Average of values |
Average |
The average value of the values in sample (the sum of the values divided by the number of values). |
Count of values |
Count |
The number of raw values in the sample. |
Difference of first and last value |
Delta |
The last value minus the first value in the block of data. Produces a zero value if both values are the same; a negative value if the last value is smaller than the first; and a positive value if the last value is larger than the first. |
Difference of maximum and minimum value |
Range |
The difference between the maximum value and the minimum value in the sample. If only one value exists in the sample, a zero value is returned. |
Duration in which data is bad |
DurBad |
The duration (in seconds) of bad data in the sample. (Values for which the quality is Uncertain are not included.) |
Duration in which data is good |
DurGood |
The duration (in seconds) of good data in the sample. |
Interpolated value |
Interpolated |
This is a calculation to estimate a value that is not included in the sample. ClearSCADA uses straight line (linear) interpolation to calculate an interpolated value at the start of the specified interval. ClearSCADA estimates the interpolated value using the last known value before the start of the interval, and the first known value after the start of the interval. |
Last value for the data in the interval |
End |
The last good quality value in the sample (sample). |
Maximum including last interpolated value |
Max Interpolated |
The largest value in the sample (including the interpolated value at the start of the interval). |
Maximum including last value |
Max Last |
The largest value in the sample (including the last known value before the start of the interval). |
Maximum value |
Max |
The largest value within the sample. |
Maximum value and time stamp |
MaxTime |
The largest value within the sample. The value is time stamped with the time at which it occurred. (The time is not displayed on Mimics or Data Grids, etc.) |
Minimum including last interpolated value |
Min Interpolated |
The smallest value within the sample, including the interpolated value at the start of the interval. |
Minimum including last value |
Min Last |
The smallest value within the sample, including the last known value before the start of the interval. |
Minimum value |
Min |
The smallest value within the sample. |
Minimum value and time stamp |
MinTime |
The smallest value within the sample. The value is time stamped with the time at which it occurred. (The time is not displayed on Mimics or Data Grids, etc.) |
Moving range |
MovingRange |
The sum of the absolute differences between each pair of values in the sample. |
Percent in which data is bad |
PerBad |
The percentage of the data interval during which the quality of data is Bad. |
Percent in which data is good |
PerGood |
The percentage of the data interval during which the quality of data is Good. (1 = 100%) |
Standard deviation of values |
StdDev |
The 'spread' of the values about their mean value. |
Stepped analog |
Stepped |
Returns the last value before the start of the specified interval. This aggregate is included for backwards compatibility with old-style Trends. |
Sum of values |
Sum |
The sum of the historic values in the sample. |
Time-weighted average |
TimeAverage |
An average value for the sample, taking into consideration the amount of time the data source remained in each value. |
Totalized value (Time Integral) |
Total |
The totalized value of the data in the sample. |
Value at end of the interval |
End |
The last value in the sample. |
Value at start of the interval |
Start |
The first value in the sample. |
Variance of values |
Variance |
The square of the standard deviation of the values. |
For more information on how the algorithms are calculated, which values are included in a sample, and how time stamps are applied to processed historic values, see Built-In Historic Algorithms for Processed Historic Data in the ClearSCADA Guide to Trends.
Example: Referencing an OPC Historic Tag in an Expression:
The tag for calculating the average value of an analog point, AIP4 within the group 'SCADAPack Modbus Direct' (itself within the group 'SCADAPack Modbus Group'), over a 2-hour period, starting three hours ago is:
"SCADAPack Modbus Group.SCADAPack Modbus Direct.AIP4;Average;H-3H;2H"
You can enter this tag manually, by typing it into the Expression window, or you can use the Select Historic Tag window to locate the data source and specify the required parameters for the tag.