AFDataReference.GetValue Method (AFAttributeList, Object, Object)
- 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 static AFValues GetValue( AFAttributeList attributes, Object context, Object timeContext )
Public Shared Function GetValue ( attributes As AFAttributeList, context As Object, timeContext As Object ) As AFValues Dim attributes As AFAttributeList Dim context As Object Dim timeContext As Object Dim returnValue As AFValues returnValue = AFDataReference.GetValue(attributes, context, timeContext)
public: static AFValues^ GetValue( AFAttributeList^ attributes, Object^ context, Object^ timeContext )
static member GetValue : attributes : AFAttributeList * context : Object * timeContext : Object -> AFValues
Parameters
- attributes
- Type: OSIsoft.AF.AssetAFAttributeList
The list of attributes to obtain the value of. The returned collection of AFValues will be specified in the same order as the list of attributes provided. - context
- Type: SystemObject
The AF SDK context to be used when getting the attributes' 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 AddInput(AFAttribute, AFValue) or 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.
Return Value
Type: AFValuesReturns the value for the attribute.