AFAttributeTemplate.GetValue Method
- Last UpdatedNov 18, 2025
- 2 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 Object GetValue( UOM desiredUOM )
Public Function GetValue ( desiredUOM As UOM ) As Object Dim instance As AFAttributeTemplate Dim desiredUOM As UOM Dim returnValue As Object returnValue = instance.GetValue(desiredUOM)
public: Object^ GetValue( UOM^ desiredUOM )
member GetValue : desiredUOM : UOM -> Object
Parameters
- desiredUOM
- Type: OSIsoft.AF.UnitsOfMeasureUOM
The desired unit of measure for the returned value. If not specified or , then the DefaultUOM property is used. If the DefaultUOM is also not configured, then no unit-of-measure conversion is performed.
Return Value
Type: ObjectReturns the value for the attribute template.
Exceptions
| Exception | Condition |
|---|---|
| InvalidCastException | Thrown when the conversion to the desired UOM or configured Type cannot be performed. |
Remarks
The GetValue and SetValue calls of an attribute template are not forwarded to the associated data reference. When an attribute is created from this template, the template's value will be used as the default value. If a data reference is not configured for an attribute created from this template, then the attribute's value will continue to return the template's default value until the attribute's value is specifically set.
The returned value is converted to the UOM specified by the desiredUOM parameter. If this parameter is not specified, then the value is returned in the UOM specified by the DefaultUOM property of this attribute template.