Retrieval modes supported by ProcessValues endpoints
- Last UpdatedAug 23, 2024
- 6 minute read
The details of retrieval modes listed in this topic are taken from the AVEVA Historian Client User Guide. For more information about retrieval modes, refer to AVEVA Historian Client User Guide.
Average retrieval
For the time-weighted average (in short: "average") retrieval mode, a time-weighted average algorithm is used to calculate the value to be returned for each retrieval cycle.
For a statistical average, the actual data values are used to calculate the average. The average is the sum of the data values divided by the number of data values. For the following data values, the statistical average is computed as :
(P1 + P2 + P3 + P4) / 4) = Average

For a time-weighted average, values are multiplied by the time difference between the points to determine the time-weighted value. Therefore, the longer a tag had a particular value, the more weight that value holds in the overall average. The overall average is determined by adding all of the time-weighted values and then dividing that number by the total amount of time.
Which values are weighted depends on the interpolation setting of the tag. For a tag that uses linear interpolation, the midpoints between values are weighted. For a tag that uses stair-step interpolation, the earlier of two values is weighted.
For the following data values of a tag that uses linear interpolation, the time-weighted average is computed as:
(((P1 + P2) / 2) x (T2 - T1)) + (((P2 + P3) / 2) x (T3 - T2)) + (((P3 + P4) / 2) x (T4 - T3)) / (T4 - T1) = Average

If the same tag uses stair-step interpolation, the time-weighted average is:
((P1 x (T2 - T1)) + (P2 x (T3 - T2)) + (P3 x (T4 - T3))) / (T4 - T1) = Average
The SQL Server AVG aggregate is a simple statistical average. Using the average retrieval mode with a cycle count of 1 returns data much faster than the AVG aggregate, and usually more accurately due to the time weighting. The event subsystem also returns a simple statistical average.
Average retrieval returns one row for each tag in the query for each cycle. The number of cycles is based on the specified resolution or cycle count.
The time-weighted average algorithm is only applied to analog and analog summary tags. If you use average retrieval with other tags, the results are the same as when using regular cyclic retrieval.
For more information on Average Retrieval, refer to the AVEVA Historian Client User Guide.
Counter retrieval
Counter retrieval allows you to accurately retrieve the delta change of a tag’s value over a period of time even for tags that are reset upon reaching a "rollover value." The rollover value is defined in the Wonderware Historian for each tag.
This retrieval mode is useful for determining how much of an item was produced during a particular time period. For example, you might have an integer counter that keeps track of how many cartons were produced.
The next value after the highest value that can be physically shown by the counter is called the rollover value. In this example, the rollover value is 10,000. When the counter reaches the 9,999th value, the counter rolls back to 0. Therefore, a counter value of 9,900 at one time and a value of 100 at a later time means that you have produced 200 units during that period, even though the counter value has dropped by 9,800 (9,900 minus 100). Counter retrieval allows you to handle this situation and receive the correct value. For each cycle, the counter retrieval mode shows the increase in that counter during the cycle, including rollovers.
Counter retrieval also works with floating point counters, which is useful for flow meter data. Similar to the carton counter, some flow meters "roll over" after a certain amount of flow accumulates. For both examples, the need is to convert the accumulating measure to a "delta change" value over a given period.
Counter retrieval is a true cyclic mode. It returns one row for each tag in the query for each cycle. The number of cycles is based on the specified resolution or cycle count.
The counter algorithm is only applied to analog tags and to discrete tags. For integer analog tags, the result will be an integer returned as a float data type For a real analog tag, the rollover value and the result may be real values and can include fractional values. If a query contains tags of other types, then no rows are returned for those tags. For discrete tags, the rollover value is assumed to be 2.
The rules used to determine the OPCQuality returned with a counter value are the same as for a time weighted average query. When a rollover has occurred in the calculation cycle, a special quality detail of 212 is returned in all non-NULL cases .
For more information on Counter Retrieval, refer to the AVEVA Historian Client User Guide.
Cyclic retrieval
Cyclic retrieval is the retrieval of stored data for the given time period based on a specified cyclic retrieval resolution, regardless of whether or not the value of the tag(s) has changed. It works with all types of tags. Cyclic retrieval produces a virtual rowset, which may or may not correspond to the actual data rows stored on the Wonderware Historian.
In cyclic retrieval, one row is returned for each "cycle boundary." You specify the number of cycles either directly or by means of a time resolution, that is, the spacing of cycle boundaries in time. If you specify a number of cycles, the Wonderware Historian returns that number of rows, evenly spaced in time over the requested period. The cyclic resolution is calculated by dividing the requested time period by the number of cycle boundaries. If you specify a resolution, the number of cycles is calculated by dividing the time period by the resolution.
If no data value is actually stored at a cycle boundary, the last value before the boundary is returned.
Cyclic retrieval is fast and therefore consumes little server resources. However, it may not correctly reflect the stored data because important process values (such as gaps and spikes) might fall between cycle boundaries.
For more information on Cyclic Retrieval, refer to the AVEVA Historian Client User Guide.
Delta retrieval
Delta retrieval, or retrieval based on exception, is the retrieval of only the changed values for a tag(s) for the given time interval. That is, duplicate values are not returned. It works with all types of tags.
Delta retrieval always produces a rowset comprised of only rows that are actually stored on the Historian; that is, a delta query returns all of the physical rows in history for the specified tags, over the specified period, minus any duplicate values. If there is no actual data point at the start time, the last data point before the start time is returned.
For more information on Delta Retrieval, refer to the AVEVA Historian Client User Guide.
Full retrieval
In full retrieval mode, all stored data points are returned, regardless of whether a value or quality has changed since the last value. This mode allows the same value and quality pair (or NULL value) to be returned consecutively with their actual timestamps. It works with all types of tags.
By using full retrieval in conjunction with storage without filtering (that is, no delta or cyclic storage mode is applied at the historian), you can retrieve all values that originated from the plant floor data source or from another application.
For more information on Full Retrieval, refer to the AVEVA Historian Client User Guide.
Integral retrieval
Integral retrieval calculates the values at retrieval cycle boundaries by integrating the graph described by the points stored for the tag. Therefore, it works much like average retrieval, but it additionally applies a scaling factor. This retrieval mode is useful for calculating volume for a particular tag. For example, if one of your tags represents product flow in gallons per second, integral retrieval allows you to retrieve the total product flow in gallons during a certain time period. It additionally applies the scaling factor called IntegralDivisor. For more information about IntegralDivisor, see View the engineering unit catalog and the properties of catalog units in the AVEVA Insight Online Help.
Integral retrieval is a true cyclic mode. It returns one row for each tag in the query for each cycle. The number of cycles is based on the specified resolution or cycle count.
Integral retrieval only works with analog tags. For all other tags, normal cyclic results are returned.
For more information on Integral Retrieval, refer to the AVEVA Historian Client User Guide.