AFListData.ReplaceValues Method (AFTimeRange, IList(AFValues), AFBufferOption)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFErrors<AFValue> ReplaceValues( AFTimeRange timeRange, IList<AFValues> values, AFBufferOption bufferOption )
Public Shared Function ReplaceValues ( timeRange As AFTimeRange, values As IList(Of AFValues), bufferOption As AFBufferOption ) As AFErrors(Of AFValue) Dim timeRange As AFTimeRange Dim values As IList(Of AFValues) Dim bufferOption As AFBufferOption Dim returnValue As AFErrors(Of AFValue) returnValue = AFListData.ReplaceValues(timeRange, values, bufferOption)
public: static AFErrors<AFValue^>^ ReplaceValues( AFTimeRange timeRange, IList<AFValues^>^ values, AFBufferOption bufferOption )
static member ReplaceValues : timeRange : AFTimeRange * values : IList<AFValues> * bufferOption : AFBufferOption -> 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 AFAttribute 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. - bufferOption
- Type: OSIsoft.AF.DataAFBufferOption
An enumeration value that specifies buffering option.
Return Value
Type: AFErrorsAFValueReturns a list of the errors associated with the AFValue that caused the error. If there are no errors, then is returned.
Remarks
This method will take the list of AFValues, each with an associated AFAttribute, and replace multiple values for multiple attributes within the specified AFTimeRange. The operation cannot be performed if the AFValues.Attribute is not defined.
This method requires that the attributes being written, if configured with a data reference, must support the ReplaceValues method. This is indicated by having the ReplaceRange flag set in the SupportedDataMethods property. The PI Point Data Reference supports ReplaceValues for simply configured PI Points.
If AFBufferOption is set to Buffer, this method requires that the attribute has a configured data reference which supports buffering. This is indicated by having the Buffering flag set in the SupportedDataMethods property. The PI Point Data Reference supports buffering.
| This method, property, or class is not available in the legacy .NET 3.5 version of the SDK. |
| You must have WriteData security rights to write a data value. |
| This method is not supported for attributes that do not have a data reference. |