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

AF SDK Reference

AFData.UpdateValue Method (AFValue, AFUpdateOption, AFBufferOption)

AFData.UpdateValue Method (AFValue, AFUpdateOption, AFBufferOption)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFData.UpdateValue Method (AFValue, AFUpdateOption, AFBufferOption)
This method writes, replaces, or removes a value 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 void UpdateValue(
	AFValue value,
	AFUpdateOption option,
	AFBufferOption bufferOption
)
Public Sub UpdateValue ( 
	value As AFValue,
	option As AFUpdateOption,
	bufferOption As AFBufferOption
)

Dim instance As AFData
Dim value As AFValue
Dim option As AFUpdateOption
Dim bufferOption As AFBufferOption

instance.UpdateValue(value, option, bufferOption)
public:
void UpdateValue(
	AFValue^ value, 
	AFUpdateOption option, 
	AFBufferOption bufferOption
)
member UpdateValue : 
        value : AFValue * 
        option : AFUpdateOption * 
        bufferOption : AFBufferOption -> unit 

Parameters

value
Type: OSIsoft.AF.AssetAFValue
The value to be written or replaced on the target system. Proper UOM coercion of Value will be performed in terms of the attribute's DefaultUOM property. If the data reference is a PI Point then proper type coercion of Value will be performed in terms of the PointType property.
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.
bufferOption
Type: OSIsoft.AF.DataAFBufferOption
An enumeration value that specifies buffering option.

Exceptions

ExceptionCondition
ArgumentNullException The value is .
NotSupportedException The data reference does not support this method.

Remarks

If the attribute does not have a data reference configured and if it is not a dynamic attribute, then the attribute's value will be updated in the PI AF Server immediately. Updating a value to a PI AF Server Collective requires the primary AF Server to be running and will be replicated to the secondary AF Server through SQL Server replication.

If multiple attributes of this type are written to, consider using the AFListData.UpdateValues method for better performance.

If the attribute has a configured data reference, then the data reference must support the UpdateValue method. This is indicated by having the UpdateValue flag set in the SupportedDataMethods property. The PI Point Data Reference supports UpdateValue 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 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
For the case of attributes that do not have a data reference and which are configuration items, if the corresponding AFElement is already checked out by another user (i.e. through AFAttribute.SetValue) when this method is called, then the value(s) to update may be lost when the other user checks in the AFElement.

Caution note Caution
Exceptions thrown by the configured data reference will be propagated.

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, 2.7.5, 2.7, 2.6

See Also

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