When retrieving detailed data from tag based time series data sources (i.e. Historians), Flow makes use of a number of aggregation methods to standardize how this data is summarized and stored in the Flow System. In a previous lab, you created a measure that calculated the average value of the Boiler Temperature for each hour. The aggregation method you used was “Average”, but there are a few others you should know about. Let’s discuss each of these aggregation methods in detail.
Let’s use a standard set of detailed data, and then apply each of the aggregation methods to the same data set. Here is our data set …
Which, graphically, looks like this if we plot the points. The shaded area is the time period we are interested in for our summary information.
Flow uses a “Stair Step” interpolation between each point, like this …
Because the first point in our data set is outside of our summary time period, Flow uses it as a “boundary” value with a timestamp of exactly 06:00:00.
|The Wonderware Historian Data Source type does allow the option to use a different Interpolation between points, however, Flow will default to using “Stair Step”.|
When using the “Sum” aggregation method, Flow will calculate the sum of points 2 to 13. It will exclude the “boundary” value, since point 1 before the “boundary”, would have been used in the previous time period’s calculation.
When using the “Average” aggregation method, Flow calculates a time weighted average. The “boundary” value is included in the calculation.
When using the “Minimum” aggregation method, Flow determines the minimum value of all the points within the time period, including the “boundary” value.
When using the “Maximum” aggregation method, Flow determines the maximum value of all the points within the time period, including the “boundary” value.
When using the “Range” aggregation method, Flow determines the maximum and the minimum values of all the points within the time period, including the “boundary” value, and then returns the difference between the maximum and the minimum.
When using the “First” aggregation method, Flow will return the “boundary” value.
When using the “Last” aggregation method, Flow will return the value of the last point before the end of the time period. If a point falls exactly on the end of the time period (i.e. 07:00:00), it will be excluded from the evaluation.
When using the “Delta” aggregation method, Flow will sum the difference between each consecutive point, including the “boundary” point.
When using the “Count” aggregation method, Flow will return the number of points within the time period, excluding the “boundary” point.
Time in State
When configuring Flow to return a “Time in State” summary, you will need to specify the “State” setting and condition. Flow will return the total duration (in milliseconds) that the “Stair Step” interpolation evaluates to the specified “State” setting and condition. For example, in the above scenario, if the “State” setting is specified as “=” 1.6, Flow will sum the duration between the “boundary” point and point 2, and the duration between point 9 and point 10.
When using the “Variance” aggregation method, Flow will calculate the statistical population variance for all the data points within the time period, including the “boundary” point.
When using the “Standard Deviation” aggregation method, Flow will calculate the statistical population standard deviation for all the data points within the time period, including the “boundary” point.
The “Counter” aggregation method is applicable to totalizers only. For this aggregation type, let’s look at a different set of data:
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.|
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.5 rollover – 3.2 point 8). 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.
Some Data Source types provide the ability to configure a “Custom Expression”, rather than using one of the standard aggregation methods. Custom expressions allow for the querying of more than one tag from the data source.
The results of the query are transposed into a “data” object that returns a set of columns containing the tag values and qualities. The custom expression uses Microsoft.NET’s C# syntax. A single “Result” object must be returned by the custom expression.
The custom expression must be validated before being saved.
Custom expressions can be used for custom calculations (e.g. integrated one tag by another), lookups (e.g. convert the returned values based on a lookup table), etc.