Best fit retrieval - how it works
- Last UpdatedFeb 28, 2025
- 2 minute read
The following illustration shows how the best-fit algorithm selects points for an analog tag.

Data is retrieved in best-fit mode with a start time of TC0 and an end time of TC2. The resolution has been set in such a way that the historian returns data for two complete cycles starting at TC0 and TC1 and an incomplete cycle starting at TC2. P1 to P12 represent actual data points stored on the historian. Of these points, eleven represent normal analog values, and one, P7, represents a NULL value due to an I/O Server disconnect, which causes a gap in the data between P7 and P8.
Because P2 is located exactly at the start time, no initial value needs to be interpolated at the start time. Therefore, point P1 is not considered at all. All other points are considered, but only the points indicated by green markers on the graph are returned.
From the first cycle, four points are returned:
-
P2 as the initial value of the query, as well as the first value in the cycle
-
P4 as the minimum value in the cycle
-
P6 as both the maximum value and the last value in the cycle
-
P7 as the first (and only) occurring exception in the cycle
From the second cycle, three points are returned:
-
P8 as the first value in the cycle
-
P9 as the maximum value in the cycle
-
P11 as both the minimum value and the last value in the cycle
-
As no exception occurs in the second cycle, none is returned.
Because the tag does not have a point exactly at the query end time, where an incomplete third cycle starts, the end value PC2 is interpolated between P11 and P12, assuming that linear interpolation is used.