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

AF SDK Reference

AFValue.FromPIValue Method (Object, Type, Object, AFEnumerationSet, UOM)

AFValue.FromPIValue Method (Object, Type, Object, AFEnumerationSet, UOM)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFValue.FromPIValue Method (Object, Type, Object, AFEnumerationSet, UOM)

Note: This API is now obsolete.

This method sets the value of this AFValue object from a PISDK.PIValue object, converting to the appropriate type as necessary.

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

Syntax

[ObsoleteAttribute("This property uses a PI SDK COM object which may not be available on all platforms.")]
public void FromPIValue(
	Object piValue,
	Type type,
	Object typeQualifier,
	AFEnumerationSet systemEnumerationSet,
	UOM uom
)
<ObsoleteAttribute("This property uses a PI SDK COM object which may not be available on all platforms.")>
Public Sub FromPIValue ( 
	piValue As Object,
	type As Type,
	typeQualifier As Object,
	systemEnumerationSet As AFEnumerationSet,
	uom As UOM
)

Dim instance As AFValue
Dim piValue As Object
Dim type As Type
Dim typeQualifier As Object
Dim systemEnumerationSet As AFEnumerationSet
Dim uom As UOM

instance.FromPIValue(piValue, type, typeQualifier, 
	systemEnumerationSet, uom)
public:
[ObsoleteAttribute(L"This property uses a PI SDK COM object which may not be available on all platforms.")]
void FromPIValue(
	Object^ piValue, 
	Type^ type, 
	Object^ typeQualifier, 
	AFEnumerationSet^ systemEnumerationSet, 
	UOM^ uom
)
[<ObsoleteAttribute("This property uses a PI SDK COM object which may not be available on all platforms.")>]
member FromPIValue : 
        piValue : Object * 
        type : Type * 
        typeQualifier : Object * 
        systemEnumerationSet : AFEnumerationSet * 
        uom : UOM -> unit 

Parameters

piValue
Type: SystemObject
The PISDK.PIValue object to be used when setting the fields of this AFValue object.
type
Type: SystemType
The type of value requested. Can be used to convert values to appropriate type, including changing digital states to strings, integer values, or enumeration values. Only Good values will be converted.
typeQualifier
Type: SystemObject
The specific type of value requested. Can be used to specify an enumeration set to be used when converting digital states. Only good values will be converted.
systemEnumerationSet
Type: OSIsoft.AF.AssetAFEnumerationSet
The system enumeration set to be used when converting bad digital states into the equivalent AFEnumerationValue.
uom
Type: OSIsoft.AF.UnitsOfMeasureUOM
The UOM of the specified value.

Remarks

Sets the value of this object from a PISDK.PIValue object. This method can be used to convert a PISDK.PIValue object to an AFValue object. By using the type and typeQualifier parameters, it is possible to change digital states to a AFEnumerationValue.

Note Note
In the .NET 4 version of the SDK, a digital state will always be converted to an AFEnumerationValue instead of sometimes returning a digital state COM object. For bad values, the systemEnumerationSet will be searched first for a match if specified followed by the AFEnumerationSet.SystemStateSet. For good values, the AFEnumerationSet specified by the typeQualifier parameter will be searched if specified. If an AFEnumerationValue is not found, then a dynamic AFEnumerationValue will be returned.

Note Notes to Callers
This method, property, or class is not available in the .NET 8 version of the SDK.

Version Information

AFSDK

Supported in: 2.6, 2.5, 2.4
Obsolete (compiler warning) in 3.1.1
Obsolete (compiler warning) in 3.1.0
Obsolete (compiler warning) in 3.0.2
Obsolete (compiler warning) in 3.0.1
Obsolete (compiler warning) in 3.0.0
Obsolete (compiler warning) in 2.10.11
Obsolete (compiler warning) in 2.10.5
Obsolete (compiler warning) in 2.10.0
Obsolete (compiler warning) in 2.10
Obsolete (compiler warning) in 2.9.5
Obsolete (compiler warning) in 2.9
Obsolete (compiler warning) in 2.8.5
Obsolete (compiler warning) in 2.8
Obsolete (compiler warning) in 2.7.5
Obsolete (compiler warning) in 2.7

See Also

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