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

AF SDK Reference

AFAttributeTemplate.GetValue Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFAttributeTemplate.GetValue Method
Gets the default value for an attribute template in the specified unit of measure. This value will be used as the default value for the attributes created from this template.

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: Object
Returns the value for the attribute template.

Exceptions

ExceptionCondition
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.

Version Information

AFSDK


See Also

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