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

AF SDK Reference

AFDataReference.SetValue Method

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFDataReference.SetValue Method
This method sets the value based upon the data reference configuration within the specified context.

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.

Remarks

The data reference configuration specifies how to write the value of the attribute. The UOM property specifies the actual UOM of the external data value referenced by this attribute. The value passed to this method is expected to be in the unit of measure specified by this data reference's UOM property. If supported by the data reference, the value will be written at the time specified by the AFValue.Timestamp property.

Version Information

AFSDK


See Also

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