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

AF SDK Reference

AFDataReference.GetValue Method (Object, Object, AFAttributeList, AFValues)

AFDataReference.GetValue Method (Object, Object, AFAttributeList, AFValues)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFDataReference.GetValue Method (Object, Object, AFAttributeList, AFValues)
This method gets 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 AFValue GetValue(
	Object context,
	Object timeContext,
	AFAttributeList inputAttributes,
	AFValues inputValues
)
Public Overridable Function GetValue ( 
	context As Object,
	timeContext As Object,
	inputAttributes As AFAttributeList,
	inputValues As AFValues
) As AFValue

Dim instance As AFDataReference
Dim context As Object
Dim timeContext As Object
Dim inputAttributes As AFAttributeList
Dim inputValues As AFValues
Dim returnValue As AFValue

returnValue = instance.GetValue(context, 
	timeContext, inputAttributes, inputValues)
public:
virtual AFValue^ GetValue(
	Object^ context, 
	Object^ timeContext, 
	AFAttributeList^ inputAttributes, 
	AFValues^ inputValues
)
abstract GetValue : 
        context : Object * 
        timeContext : Object * 
        inputAttributes : AFAttributeList * 
        inputValues : AFValues -> AFValue 
override GetValue : 
        context : Object * 
        timeContext : Object * 
        inputAttributes : AFAttributeList * 
        inputValues : AFValues -> AFValue 

Parameters

context
Type: SystemObject

The AF SDK context to be used when getting the attribute's value. If the context is not , then the value will be returned relative to the specified AF SDK object. 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 retrieving the attribute's value.

Once a value has been added to a case's result set, either through the AFCase.AddInput(AFAttribute, AFValue) or AFCase.AddInput(AFAttribute, object, UOM) methods or by setting its value with a context of an AFCase, then subsequent calls to the GetValue Overload methods with the same case context will not invoke the data reference but return the stored result 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.

timeContext
Type: SystemObject

The time context. If the context is , then the most recent value is returned. If the context is an AFTime object, then the value at the specified time is returned. If the context is an AFTimeRange object, then the value for the specified time range is returned. For convenience, AF SDK will convert a time context of AFCase into a time range, time at case's end time, or as appropriate.

The AF SDK will adjust the time context to send only contexts that are specified in the SupportedContexts property. If Time Range context is passed but not supported, then context will be changed to Time context at the end time of the range. If Time context is passed but not supported, then context will be changed to no context.

inputAttributes
Type: OSIsoft.AF.AssetAFAttributeList
The input attributes as previously specified by the data reference in the GetInputs(Object) call. The index of the values will match the index of the corresponding attribute previously returned. These values must be converted to the appropriate UOM required by this data reference.
inputValues
Type: OSIsoft.AF.AssetAFValues
The input values are supplied to the data reference based on the attributes returned in the GetInputs(Object) call. The index of the values will match the index of the corresponding attribute previously returned. These values must be converted to the appropriate UOM required by this data reference.

Return Value

Type: AFValue
Returns the value for the attribute.

Remarks

The data reference configuration specifies how to read the value of the attribute. The UOM property specifies the actual UOM of the external data value referenced by this attribute. This method should not be invoked directly by the user. Instead, the user should call one of the AFAttribute.GetValue Overload methods which will in-turn, invoke this method.

Version Information

AFSDK


See Also

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