AFCase.GetResult Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
This method gets the result for the specified attribute.
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFValue GetResult( AFAttribute attribute, UOM desiredUOM )
Public Function GetResult ( attribute As AFAttribute, desiredUOM As UOM ) As AFValue Dim instance As AFCase Dim attribute As AFAttribute Dim desiredUOM As UOM Dim returnValue As AFValue returnValue = instance.GetResult(attribute, desiredUOM)
public: AFValue^ GetResult( AFAttribute^ attribute, UOM^ desiredUOM )
member GetResult : attribute : AFAttribute * desiredUOM : UOM -> AFValue
Parameters
- attribute
- Type: OSIsoft.AF.AssetAFAttribute
The attribute whose result value is to be returned. - desiredUOM
- Type: OSIsoft.AF.UnitsOfMeasureUOM
The desired unit of measure for the returned value. If not specified or , then the value is returned in the unit of measure specified by the DefaultUOM property.
Return Value
Type: AFValueReturns the AFValue for the attribute's result, or if there is no result. The returned AFValue will have its Attribute property set to the attribute associated with the result value.
Exceptions
| Exception | Condition |
|---|---|
| InvalidCastException | Thrown when the conversion to the desired UOM or configured Type cannot be performed. |
Remarks
This method will return the case's result value for the specified attribute in
the specified UOM. This method differs from
AFAttribute.GetValue Overload
methods in that it will not return a value if it has not already been calculated. It
also differs from using the Results collection, in that it will not
load the entire results collection into memory. This can be more performant if
only a few results of a large collection of results are going to be accessed.