AFDataReference.UpdateValues Method (AFValues, AFUpdateOption)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public virtual AFErrors<AFValue> UpdateValues( AFValues values, AFUpdateOption updateOption )
Public Overridable Function UpdateValues ( values As AFValues, updateOption As AFUpdateOption ) As AFErrors(Of AFValue) Dim instance As AFDataReference Dim values As AFValues Dim updateOption As AFUpdateOption Dim returnValue As AFErrors(Of AFValue) returnValue = instance.UpdateValues(values, updateOption)
public: virtual AFErrors<AFValue^>^ UpdateValues( AFValues^ values, AFUpdateOption updateOption )
abstract UpdateValues : values : AFValues * updateOption : AFUpdateOption -> AFErrors<AFValue> override UpdateValues : values : AFValues * updateOption : AFUpdateOption -> 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.
Return Value
Type: AFErrorsAFValueIf there are no errors, then is returned. Otherwise an AFErrorsTKey instance containing error information is returned.
Exceptions
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.
| This method, property, or class is not available in the legacy .NET 3.5 version of the SDK. |
| You must have WriteData security rights to write a data value. |
| This method is not supported for attributes that do not have a data reference. Consider using AFListData.UpdateValues. |