Counter Delta Queries

A delta counter measures the change in tag values that increase steadily over a time interval and then reset to a minimum value (for example, the electricity meter of a household).

Historian offers the following delta queries to determine the delta over a time interval:
Advantages of using delta queries:
  • Simplified visualization and analysis of counter data.
  • Returns the delta over a period rather than the exact value at the end of each counter.
  • Handles counter resets and counter wrap around.
Delta counters are useful when you are monitoring data from multiple sources. The following terms are used in a delta counter:
Counter Reset
A point where data points are reset to the minimum value. For example, the electricity meter of a household is reset to 0 at the beginning of every month or when a meter is replaced with a new one.
Counter Wrap Around
A point where data in an increasing trend suddenly drops to a value less than a specified value. This happens when the reading goes beyond the maximum value that the meter can read. For example, if a meter can read from 0 to 255, any reading greater than 255 is set to 0. This is called a counter wrap around.
Delta Max Value
The maximum value that a tag can have. It also called the rollover point of the counter or totalizer. If the tag values exceed MaxValue, the counter is reset to the minimum value. If you do not provide MaxValue, the delta query cannot check for a positive counter wrap. You can set this value while specifying tags for data collection in Configuration Hub.
Delta Min Value
The minimum value that a tag can have. If the tag values are less than MinValue (and the counter is going in the negative direction), the tag values are reset to MaxValue. If you do not provide MinValue, 0 is considered. You can set this value while specifying tags for data collection in Configuration Hub.
Delta Max Positive RPH
The maximum rate per hour between two consecutive data points in the positive direction. If two consecutive data points exceed this value, they are not considered in a delta query. You can set this value while specifying tags for data collection in Configuration Hub.
Delta Max Negative RPH
The maximum rate per hour between two consecutive data points in the negative direction. If two consecutive data points exceed this value, they are not considered in a delta query. You can set this value while specifying tags for data collection in Configuration Hub.
The Delta Max Positive RPH and Delta Max Negative RPH values are used to determine if a counter wrap has occurred or if the counter has been manually reset. They help ignore data points whose values increase or decrease drastically.
Suppose a tag stores the readings of an electricity meter. And you have provided the following values:
Field Value
Delta Max Value 255
Delta Min Value 5
Delta Max Positive RPH 10
Delta Max Negative RPH 10
Suppose the following data points are received for the tag:

After 35, the value increases to 47. Since the difference is greater than MaxPositiveRPH, the data points 35 and 47 will not considered in a delta query.

Similarly, the difference between 55 and 40 is greater than MaxNegativeRPH; therefore, these two data points will not considered in a delta query.

After 55, the counter has been reset to its minimum value.