The “Counter” aggregation method is applicable to totalizers only. For this aggregation type, let’s look at a different set of data:
Point |
Timestamp |
Raw Value |
1 |
05:55:03 |
1 |
2 |
06:03:23 |
1.7 |
3 |
06:07:30 |
1.9 |
4 |
06:10:22 |
2 |
5 |
06:15:52 |
2.3 |
6 |
06:20:40 |
2.5 |
7 |
06:25:13 |
2.8 |
8 |
06:29:44 |
3.2 |
9 |
06:35:14 |
0 |
10 |
06:41:14 |
0.2 |
11 |
06:46:03 |
0.4 |
12 |
06:52:35 |
1 |
13 |
06:55:26 |
1.4 |
14 |
07:05:40 |
2.3 |
When we plot this “totalizer’s” points, and then apply the “Stair Step” interpolation, we get the following result. Notice the totalizer’s reset point.
Flow will sum the difference between each consecutive point, including the “boundary” value, until it detects a negative change. If the negative change is greater than the “Deadband” setting, Flow interprets this as a totalizer reset, and then continues summing the difference between following consecutive points.
The Flow “Counter” aggregation method will handle multiple totalizer resets in any single time period. Null values returned by the Data Source will be ignored in the “Counter” aggregation algorithm.
With the sample data above, Counter = 3.6
Can you work out the above? The counter started at 1 and rolled over at 3.2, so that's a difference of 2.2. Then it counted up to 1.4 in the time period, so that's a difference of 1.4. So the total counter difference is 2.2 + 1.4 = 3.6
Of course, when Flow computes this, it sums up the difference between every consecutive point, as mentioned above.
Counter Rollover
A totalizer is often configured in the instrument or in its controller to always reset at a specific value. This specific value is known as the “Rollover” value.
Due to the nature of slight delays in data historization, it is possible that the raw data will not include a point at exactly the rollover value, but rather a value slightly before, and slightly lower than the rollover value.
For example, if this totalizer reset at exactly 3.5, Flow would “miss” 0.3 counts (3.5rollover–3.2point8). Fortunately, Flow allows the configuration of a “Rollover” setting. When calculating the “Counter” aggregation for a time period, Flow will use this “Rollover” setting to include the “missed” counts.
With the sample data above, if the rollover was configured to be 3.5, Flow would compute a value of Counter = 3.9