PIPointList.InterpolatedValues Method
- Last UpdatedNov 18, 2025
- 7 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public IEnumerable<AFValues> InterpolatedValues( AFTimeRange timeRange, AFTimeSpan interval, string filterExpression, bool includeFilteredValues, PIPagingConfiguration pagingConfig )
Public Function InterpolatedValues ( timeRange As AFTimeRange, interval As AFTimeSpan, filterExpression As String, includeFilteredValues As Boolean, pagingConfig As PIPagingConfiguration ) As IEnumerable(Of AFValues) Dim instance As PIPointList Dim timeRange As AFTimeRange Dim interval As AFTimeSpan Dim filterExpression As String Dim includeFilteredValues As Boolean Dim pagingConfig As PIPagingConfiguration Dim returnValue As IEnumerable(Of AFValues) returnValue = instance.InterpolatedValues(timeRange, interval, filterExpression, includeFilteredValues, pagingConfig)
public: IEnumerable<AFValues^>^ InterpolatedValues( AFTimeRange timeRange, AFTimeSpan interval, String^ filterExpression, bool includeFilteredValues, PIPagingConfiguration^ pagingConfig )
member InterpolatedValues : timeRange : AFTimeRange * interval : AFTimeSpan * filterExpression : string * includeFilteredValues : bool * pagingConfig : PIPagingConfiguration -> IEnumerable<AFValues>
Parameters
- timeRange
- Type: OSIsoft.AF.TimeAFTimeRange
The bounding time range for the interpolated values request. If the StartTime is earlier than the EndTime, the resulting values will be in time-ascending order, otherwise they will be in time-descending order. - interval
- Type: OSIsoft.AF.TimeAFTimeSpan
The Sample interval. If specified in hours, minutes, seconds, or milliseconds, the time intervals will be evenly spaced UTC time intervals. Longer interval types are interpreted using wall clock rules and are time zone dependent. For example, an interval created with the string "24h" means using an evenly spaced 24 UTC hour interval between each event. On the other hand, an interval created with the string "1d" would return an interval shorter or longer than 24 hours if the interval encompasses a Daylight Savings Time change.
When a positive interval is specified, the interval calculation begins at the earliest bounding time in the timeRange and applies the interval repeatedly in time ascending direction to generate the calculation intervals.
If a negative interval is specified, the interval calculation begins at the latest bounding time in the timeRange and applies the interval repeatedly in time descending direction to generate the calculation intervals. Note that the order of values returned will still be reflected by the timeRange, regardless of the interval sign.
- filterExpression
- Type: SystemString
A filter expression that follows the performance equation syntax. - includeFilteredValues
- Type: SystemBoolean
Specify to indicate that values which fail the filter criteria are present in the returned data at the times where they occurred with a value set to a "Filtered" enumeration value with bad status. Repeated consecutive failures are omitted. - pagingConfig
- Type: OSIsoft.AF.PIPIPagingConfiguration
Contains the paging configuration parameters for the request.
Return Value
Type: IEnumerableAFValuesAn enumerable of AFValues for each PIPoint in the list. The results are not guaranteed to match the order of the PIPointList, and duplicate points in the list will not produce a duplicate result. The results can be mapped back to the corresponding PI Point using the PIPoint property on each result.
The order of the results are predictable; however, if you need the results in the same order as the attribute list, then consider using a dictionary keyed by PI Point to construct a list in the same order.
The points in the list are broken up by their corresponding PI Data Archive. A bulk call is made against each PI Data Archive in parallel. The results are made available as they are returned from the PI Data Archive in the order that the bulk calls were made.
The following example shows a list of points including duplicates from three different PI Data Archives:
| PI Point | PI Data Archive |
|---|---|
| Lobby_Room_Temperature | Contoso |
| Lobby_Room_Temperature | Northwind |
| Lobby_Room_Temperature | Contoso |
| Lobby_Room_Temperature | AdventureWorks |
| Kitchen_Room_Temperature | Contoso |
This table shows the order that the results would be returned:
| PI Point | PI Data Archive |
|---|---|
| Lobby_Room_Temperature | Contoso |
| Kitchen_Room_Temperature | Contoso |
| Lobby_Room_Temperature | Northwind |
| Lobby_Room_Temperature | AdventureWorks |
Since the first point is on the Contoso PI Data Archive, it is the first PI Data Archive to receive a bulk call; therefore, all Contoso point results will be returned first. Duplicate points do not produce a duplicate result, so the duplicate Contoso Lobby_Room_Temperature does not produce a second return value. After the Contoso results have been returned, the Northwind results are returned followed by the AdventureWorks results.
Exceptions
| Exception | Condition |
|---|---|
| OperationCanceledException | When an error occurs that prevents the operation from proceeding. Check the Error property on the pagingConfig object for more specific error information. |
| ArgumentNullException | When pagingConfig is . |
Remarks
| Time Range | Interval | Timestamps returned in AFValues |
|---|---|---|
| Ascending (Y to T) | Positive (5h) | Y, Y+5h, Y+10h, Y+15h, Y+20h |
| Descending (T to Y) | Positive (5h) | Y+20h, Y+15h, Y+10h, Y+5h, Y |
| Ascending (Y to T) | Negative (-5h) | T-20h, T-15h, T-10h, T-5h, T |
| Descending (T to Y) | Negative (-5h) | T, T-5h, T-10h, T-15h, T-20h |
| This method, property, or class is not available in the legacy .NET 3.5 version of the SDK. |
| This method will use a single bulk Remote Procedure Call if the PI Data Archive supports it, otherwise it will issue individual RPCs in parallel. Results are available for enumeration as they returned from the PI Data Archive. |
| When individual RPCs are issued in parallel, each RPC is made using the caller's security context. When making these calls while impersonating, the thread or runtime must be configured to propagate the impersonation across these asynchronous points (see the SecurityContext documentation for details). |
| The returned enumerable collection can be enumerated one time. As the collection is enumerated, the internal data structures are disposed. Any attempt to reset or enumerate a second time will result in an exception. |
| This call might use a background task to complete some of its work. See the Threading Overview for some matters to consider when execution transitions to another thread. |
Examples
// Holds the results keyed on the associated point Dictionary<PIPoint, AFValues> resultsMap = new Dictionary<PIPoint, AFValues>(); // Results should be sent back for 100 tags in each page. PIPagingConfiguration config = new PIPagingConfiguration(PIPageType.TagCount, 100); try { IEnumerable<AFValues> listResults = pointList.InterpolatedValues( timeRange, span, null, false, config); foreach (AFValues pointResults in listResults) { // Map the results back to the point resultsMap[pointResults.PIPoint] = pointResults; } } catch (OperationCanceledException) { // Errors that occur during bulk calls get trapped here // The actual error is stored on the PIPagingConfiguration object Console.WriteLine(config.Error.Message); } catch (Exception otherEx) { // Errors that occur in an iterative fallback method get trapped here Console.WriteLine(otherEx.Message); }
' Holds the results keyed on the associated point Dim resultsMap As New Dictionary(Of PIPoint, AFValues) ' Results should be sent back for 100 tags in each page. Dim config As New PIPagingConfiguration(PIPageType.TagCount, 100) Try Dim listResults As IEnumerable(Of AFValues) = pointList.InterpolatedValues(timeRange, timeSpan, Nothing, False, config) For Each pointResults As AFValues In listResults ' Map the results back to the point resultsMap(pointResults.PIPoint) = pointResults Next Catch canceledEx As OperationCanceledException ' Errors that occur during bulk calls get trapped here ' The actual error is stored on the PIPagingConfiguration object Console.WriteLine(config.Error.Message) Catch otherEx As Exception ' Errors that occur in an iterative fallback method get trapped here Console.WriteLine(otherEx.Message) End Try
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.