AFDataReference.GetValue Method (Object, Object, AFAttributeList, AFValues)
- Last UpdatedNov 18, 2025
- 4 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 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: AFValueReturns the value for the attribute.