Click or drag to resize
OSIsoft, LLC

PIPointListRecordedValuesAtTimes Method

Retrieves recorded values at the specified times.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version:
public IEnumerable<AFValues> RecordedValuesAtTimes(
	IList<AFTime> times,
	AFRetrievalMode mode,
	PIPagingConfiguration pagingConfig


Type: System.Collections.GenericIListAFTime
List of time stamps at which to retrieve recorded values.
Type: OSIsoft.AF.DataAFRetrievalMode
The mode is used to determine the value to return when a value does not exist at the exact time specified. The value is taken from the AFRetrievalMode enumeration.
Type: OSIsoft.AF.PIPIPagingConfiguration
Contains the paging configuration parameters for the request.

Return Value

Type: IEnumerableAFValues

An 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 PointPI Data Archive

This table shows the order that the results would be returned:

PI PointPI Data Archive

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.

ArgumentNullException The times is .
ArgumentException The times list must be monotonic.
OperationCanceledExceptionWhen an error occurs that prevents the operation from proceeding. Check the Error property on the pagingConfig object for more specific error information.
ArgumentNullExceptionWhen pagingConfig is .

Note Notes to Callers
This method, property, or class is only available in the .NET 4 version of the SDK.

Important note Important
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.

Important note Important
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).

Important note Important
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 method requires the PI Data Archive 2016 or later to take full advantage of performance. Otherwise, iterative RecordedValue at each timestamp (of the input times) will be performed in parallel.

Note Notes to Callers
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.

Version Information


Supported in: 2.10.5, 2.10, 2.9.5, 2.9, 2.8.5, 2.8
See Also
Enabling Operational Intelligence