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

AF SDK Reference

PIServer.UpdateValuesAsync Method (IList(AFValue), AFUpdateOption, CancellationToken)

PIServer.UpdateValuesAsync Method (IList(AFValue), AFUpdateOption, CancellationToken)

  • Last UpdatedNov 18, 2025
  • 3 minute read
PIServer.UpdateValuesAsync Method (IList(AFValue), AFUpdateOption, CancellationToken)
Update the PIPoint value for each AFValue in the specified list.

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

Syntax

public Task<AFErrors<AFValue>> UpdateValuesAsync(
	IList<AFValue> values,
	AFUpdateOption option,
	CancellationToken cancellationToken = default
)
Public Function UpdateValuesAsync ( 
	values As IList(Of AFValue),
	option As AFUpdateOption,
	Optional cancellationToken As CancellationToken = Nothing
) As Task(Of AFErrors(Of AFValue))

Dim instance As PIServer
Dim values As IList(Of AFValue)
Dim option As AFUpdateOption
Dim cancellationToken As CancellationToken
Dim returnValue As Task(Of AFErrors(Of AFValue))

returnValue = instance.UpdateValuesAsync(values, 
	option, cancellationToken)
public:
Task<AFErrors<AFValue^>^>^ UpdateValuesAsync(
	IList<AFValue^>^ values, 
	AFUpdateOption option, 
	CancellationToken cancellationToken = CancellationToken()
)
member UpdateValuesAsync : 
        values : IList<AFValue> * 
        option : AFUpdateOption * 
        ?cancellationToken : CancellationToken 
(* Defaults:
        let _cancellationToken = defaultArg cancellationToken new CancellationToken()
*)
-> Task<AFErrors<AFValue>> 

Parameters

values
Type: System.Collections.GenericIListAFValue
The list of values with an associated PIPoint to be inserted, replaced, or removed to the PI Data Archive.
option
Type: OSIsoft.AF.DataAFUpdateOption
An enumeration value that specifies how to treat duplicate values in the archive. It can also be used to specify that existing values should be removed.
cancellationToken (Optional)
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.

Remarks

This method will take the list of values with an associated PIPoint and update multiple values for multiple points. Multiple values for the same PIPoint can be in the list. The value's PIPoint must be set or its Attribute must be set to an AFAttribute associated with a PIPoint.

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.

Important note Important
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).

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