PIServer.ReplaceValues Method (AFTimeRange, IList(AFValues))
- 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<AFValues> values )
Public Function ReplaceValues ( timeRange As AFTimeRange, values As IList(Of AFValues) ) As AFErrors(Of AFValue) Dim instance As PIServer Dim timeRange As AFTimeRange Dim values As IList(Of AFValues) Dim returnValue As AFErrors(Of AFValue) returnValue = instance.ReplaceValues(timeRange, values)
public: AFErrors<AFValue^>^ ReplaceValues( AFTimeRange timeRange, IList<AFValues^>^ values )
member ReplaceValues : timeRange : AFTimeRange * values : IList<AFValues> -> AFErrors<AFValue>
Parameters
- timeRange
- Type: OSIsoft.AF.TimeAFTimeRange
The bounding time range for replacement of the existing values. - values
- Type: System.Collections.GenericIListAFValues
The list of replacement values with an associated PIPoint for each AFValues. If an empty AFValues then existing data within the specified AFTimeRange will be deleted. The timestamp 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.
Exceptions
| Exception | Condition |
|---|---|
| NotSupportedException | The PIServer does not support this feature. |
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.
| 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). |