Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFListData.ReplaceValues Method (AFTimeRange, IList(AFValues), AFBufferOption)

AFListData.ReplaceValues Method (AFTimeRange, IList(AFValues), AFBufferOption)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFListData.ReplaceValues Method (AFTimeRange, IList(AFValues), AFBufferOption)
This method removes existing data for each AFAttribute within the specified AFTimeRange and inserts the specified values.

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: AFErrorsAFValue
Returns 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.

Note Notes to Callers
This method, property, or class is not available in the legacy .NET 3.5 version of the SDK.

Security note Security Note
You must have WriteData security rights to write a data value.

Important note Important
This method is not supported for attributes that do not have a data reference.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5

See Also

In This Topic
TitleResults for “How to create a CRG?”Also Available in