AFValue.ConvertForAttribute Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
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: AFValueReturns 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.