AFDataReference.SetValue Method
- 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 void SetValue( Object context, AFValue newValue )
Public Overridable Sub SetValue ( context As Object, newValue As AFValue ) Dim instance As AFDataReference Dim context As Object Dim newValue As AFValue instance.SetValue(context, newValue)
public: virtual void SetValue( Object^ context, AFValue^ newValue )
abstract SetValue : context : Object * newValue : AFValue -> unit override SetValue : context : Object * newValue : AFValue -> unit
Parameters
- context
- Type: SystemObject
The AF SDK context to be used when setting the attribute's value. If the context is not , then the value will be updated relative to the specified AF SDK object. Currently, the following AF SDK objects may be used as a context: AFCase, AFAnalysis, and AFModel. It is up to the data reference to determine how the context should be used when updating the attribute's value.
The AF SDK will adjust the context to send only contexts that are specified in the SupportedContexts property. Specifically, if Case context is passed but not supported, then context will be changed to Model Analysis context. If Model Analysis context is passed but not supported, then context will be changed to Model context. Finally, if Model context is passed but not supported, then context will be changed to no context.
- newValue
- Type: OSIsoft.AF.AssetAFValue
The new value for the attribute.