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

AF SDK Reference

AFValue.ConvertForAttribute Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFValue.ConvertForAttribute Method
Converts the current value using the type and units of measure configured for the specified attribute.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public AFValue ConvertForAttribute(
	AFAttribute attribute
)
Public Function ConvertForAttribute ( 
	attribute As AFAttribute
) As AFValue

Dim instance As AFValue
Dim attribute As AFAttribute
Dim returnValue As AFValue

returnValue = instance.ConvertForAttribute(attribute)
public:
AFValue^ ConvertForAttribute(
	AFAttribute^ attribute
)
member ConvertForAttribute : 
        attribute : AFAttribute -> AFValue 

Parameters

attribute
Type: OSIsoft.AF.AssetAFAttribute
The attribute whose configuration will be used to convert the value.

Return Value

Type: AFValue
Returns an AFValue with type and units of measure converted to conform to the specified attribute's configuration.

Remarks

This method will convert the current AFValue using the Type, TypeQualifier, and DefaultUOM configured for the specified attribute. If the value's IsGood property is , no conversion is attempted. If the conversion is invalid an exception will be thrown.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9

See Also

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