Click or drag to resize
OSIsoft, LLC

PIPointReplaceValuesAsync Method (AFTimeRange, IListAFValue, AFBufferOption, CancellationToken)

This method removes existing data within the specified AFTimeRange and inserts the specified values.

Namespace:  OSIsoft.AF.PI
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 2.10.6.195
Syntax
public Task<AFErrors<AFValue>> ReplaceValuesAsync(
	AFTimeRange timeRange,
	IList<AFValue> values,
	AFBufferOption bufferOption,
	CancellationToken cancellationToken = null
)

Parameters

timeRange
Type: OSIsoft.AF.TimeAFTimeRange
The bounding time range for removal and replacement of data.
values
Type: System.Collections.GenericIListAFValue
The list of replacement values with an associated PIPoint for each value. If an empty list then existing data within the specified AFTimeRange will be deleted. The time stamp of AFValue in values must be within the specified AFTimeRange.
bufferOption
Type: OSIsoft.AF.DataAFBufferOption
An enumeration value that specifies buffering option.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
A cancellation token used to abort processing before completion. Passing the default CancellationToken.None will run to completion or until the PIConnectionInfo.OperationTimeOut period elapses.

Return Value

Type: TaskAFErrorsAFValue
Returns a task whose result is if there are no errors. Otherwise the result is an AFErrorsTKey instance containing error information.
Exceptions
ExceptionCondition
AggregateException Asynchronous methods throw AggregateException on failure which will contain one or more exceptions containing the failure.
Remarks

This method requires PI Data Archive 2016 or later that supports DeleteRange feature. This is indicated by Supports(PIServerFeature) check returning for the case of DeleteRange.

For successful data write through Buffer, this method requires that PI Buffer Subsystem (PIBufSS) needs to be correctly pre-configured with Buffering Manager. Currently, buffering data through PIBufSS has a limitation where error feedback from PI Data Archive cannot be returned to the caller.

Data write through Buffer will be fanned to Collective members.

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

AFSDK

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