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

AF SDK Reference

AFData.UpdateValues Method (AFValues, AFUpdateOption)

AFData.UpdateValues Method (AFValues, AFUpdateOption)

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

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

Syntax

public AFErrors<AFValue> UpdateValues(
	AFValues values,
	AFUpdateOption option
)
Public Function UpdateValues ( 
	values As AFValues,
	option As AFUpdateOption
) As AFErrors(Of AFValue)

Dim instance As AFData
Dim values As AFValues
Dim option As AFUpdateOption
Dim returnValue As AFErrors(Of AFValue)

returnValue = instance.UpdateValues(values, 
	option)
public:
AFErrors<AFValue^>^ UpdateValues(
	AFValues^ values, 
	AFUpdateOption option
)
member UpdateValues : 
        values : AFValues * 
        option : AFUpdateOption -> AFErrors<AFValue> 

Parameters

values
Type: OSIsoft.AF.AssetAFValues
The values to be written or replaced on the target system.
option
Type: OSIsoft.AF.DataAFUpdateOption
An enumeration value that specifies how to treat duplicate values. It can also be used to specify that an existing value should be removed.

Return Value

Type: AFErrorsAFValue
If there are no errors, then is returned. Otherwise an AFErrorsTKey instance containing error information is returned.

Exceptions

ExceptionCondition
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

This method requires that the attributes being written, if configured with a data reference, must support the UpdateValues method. This is indicated by having the UpdateValues flag set in the SupportedDataMethods property. The PI Point Data Reference supports UpdateValues for simply configured PI Points.

For the case of attributes which are configuration items, this method (unlike AFAttribute.SetValue) does not require the corresponding AFElement to be checked out or checked in.

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.

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. Consider using AFListData.UpdateValues.

Version Information

AFSDK


See Also

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