PIPoint.ReplaceValues Method (AFTimeRange, IList(AFValue))
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
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: 3.1.1.1182
Syntax
public AFErrors<AFValue> ReplaceValues( AFTimeRange timeRange, IList<AFValue> values )
Public Function ReplaceValues ( timeRange As AFTimeRange, values As IList(Of AFValue) ) As AFErrors(Of AFValue) Dim instance As PIPoint Dim timeRange As AFTimeRange Dim values As IList(Of AFValue) Dim returnValue As AFErrors(Of AFValue) returnValue = instance.ReplaceValues(timeRange, values)
public: AFErrors<AFValue^>^ ReplaceValues( AFTimeRange timeRange, IList<AFValue^>^ values )
member ReplaceValues : timeRange : AFTimeRange * values : IList<AFValue> -> AFErrors<AFValue>
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.
Return Value
Type: AFErrorsAFValueIf there are no errors, then is returned. Otherwise an AFErrorsTKey instance containing error information is returned.
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.
If not specified in AFSDK.config, the AFBufferOption is defaulted to BufferIfPossible. The default buffering option for the current AF SDK client instance can be modified via the static property AFData.BufferOption.
| Exception reporting is not handled automatically by the AF SDK. Historically, exception reporting has been handled by the application writing data (i.e. Uniint-based interfaces). |