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

AF SDK Reference

AFDataReference.UpdateValuesAsync Method (AFValues, AFUpdateOption, AFBufferOption, CancellationToken)

AFDataReference.UpdateValuesAsync Method (AFValues, AFUpdateOption, AFBufferOption, CancellationToken)

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFDataReference.UpdateValuesAsync Method (AFValues, AFUpdateOption, AFBufferOption, CancellationToken)
This method writes or replaces one or more values on the target system using the configured data reference.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public virtual Task<AFErrors<AFValue>> UpdateValuesAsync(
	AFValues values,
	AFUpdateOption updateOption,
	AFBufferOption bufferOption,
	CancellationToken cancellationToken
)
Public Overridable Function UpdateValuesAsync ( 
	values As AFValues,
	updateOption As AFUpdateOption,
	bufferOption As AFBufferOption,
	cancellationToken As CancellationToken
) As Task(Of AFErrors(Of AFValue))

Dim instance As AFDataReference
Dim values As AFValues
Dim updateOption As AFUpdateOption
Dim bufferOption As AFBufferOption
Dim cancellationToken As CancellationToken
Dim returnValue As Task(Of AFErrors(Of AFValue))

returnValue = instance.UpdateValuesAsync(values, 
	updateOption, bufferOption, cancellationToken)
public:
virtual Task<AFErrors<AFValue^>^>^ UpdateValuesAsync(
	AFValues^ values, 
	AFUpdateOption updateOption, 
	AFBufferOption bufferOption, 
	CancellationToken cancellationToken
)
abstract UpdateValuesAsync : 
        values : AFValues * 
        updateOption : AFUpdateOption * 
        bufferOption : AFBufferOption * 
        cancellationToken : CancellationToken -> Task<AFErrors<AFValue>> 
override UpdateValuesAsync : 
        values : AFValues * 
        updateOption : AFUpdateOption * 
        bufferOption : AFBufferOption * 
        cancellationToken : CancellationToken -> Task<AFErrors<AFValue>> 

Parameters

values
Type: OSIsoft.AF.AssetAFValues
The values to be written or replaced on the target system.
updateOption
Type: OSIsoft.AF.DataAFUpdateOption
An enumeration value that specifies how duplicate values should be handled.
bufferOption
Type: OSIsoft.AF.DataAFBufferOption
An enumeration value that specifies buffering option.
cancellationToken
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.
ArgumentNullException The values is .
ArgumentException The values must contain at least one AFValue.
InvalidOperationException The Attribute does not have a data reference configured.
NotSupportedException The data reference does not support this method.

Remarks

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: 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, 2.8

See Also

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