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

AF SDK Reference

UOMClass Class

  • Last UpdatedNov 18, 2025
  • 6 minute read
UOMClass Class
The unit-of-measure class (UOMClass) represents a group of units of measure and describes the fundamental dimensions of their measurements.

Inheritance Hierarchy

SystemObject
  OSIsoft.AFAFObject
    OSIsoft.AF.UnitsOfMeasureUOMClass

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

Syntax

[SerializableAttribute]
public sealed class UOMClass : AFObject, 
	IComparable<UOMClass>
<SerializableAttribute>
Public NotInheritable Class UOMClass
	Inherits AFObject
	Implements IComparable(Of UOMClass)

Dim instance As UOMClass
[SerializableAttribute]
public ref class UOMClass sealed : public AFObject, 
	IComparable<UOMClass^>
[<SealedAttribute>]
[<SerializableAttribute>]
type UOMClass =  
    class
        inherit AFObject
        interface IComparable<UOMClass>
    end

The UOMClass type exposes the following members.

Properties

  NameDescription
Public property
BaseClasses
Gets the collection of UOMBaseClass objects that represent base unit-of-measure (UOM) classes on which this class is based and their respective powers.
Public property
CanonicalUOM
This is the canonical unit of measure (UOM) for this class.
Public property
Database
This read-only property allows access to the UOMDatabase associated with this object.
Public property
Description
Read/write property that provides a more detailed description of the object.
Public property
ID
Read-only property that provides a unique identifier for the object to be used for quick access that is not dependent upon the index.
(Inherited from AFObject.)
Public property
Identity
This read-only property contains identity of the object.
(Inherited from AFObject.)
Public property
IsBaseClass
This property indicates if this is a base unit of measure (UOM) class.
Public property
IsDeleted
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.)
Public property
Name
Read/write property that identifies the name of the object.
Public property
PISystem
This read-only property allows access to the PISystem associated with this object.
(Inherited from AFObject.)
Public property
UniqueID
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.)
Public property
UOMs
Gets the collection of UOM (unit of measure) objects that were created from this class.

Methods

  NameDescription
Public method
CompareTo(Object)
Compares this instance with a specified Object.
(Inherited from AFObject.)
Public method
CompareTo(AFObject)
Compares this instance with a specified AFObject.
(Inherited from AFObject.)
Public method
Equals(Object)
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.)
Public method
Equals(AFObject)
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.)
Public method
GetHashCode
Gets the hash code for this instance of the object which is suitable for use in hashing algorithms and data structures like a hash table.
(Inherited from AFObject.)
Public method
GetPath
Returns the full path to the object, using just the names.
(Inherited from AFObject.)
Public method
GetPath(AFObject)
Returns the path to the object relative from another object.
(Inherited from AFObject.)
Public method
GetPath(AFEncodeType, AFObject)
Returns the path to the object relative from another object, using the name and/or id as specified by encodeType.
(Inherited from AFObject.)
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
Persist
This method returns the persistence string for the object.
(Inherited from AFObject.)
Public method
ToString
Returns a String that represents the current object.
(Inherited from AFObject.)

Remarks

Examples of UOM classes are Mass, Volume, and Density. In order to convert between two units of measure (UOM), both UOMs must be in the same UOMClass.

Examples

// This example will create a base UOM Class and then display its information.

// Get the Database
PISystems myPISystems = new PISystems();
UOMDatabase myDB = myPISystems.DefaultPISystem.UOMDatabase;

// Create a UOM Class
UOMClass LengthUOMClass = myDB.UOMClasses.Add("QALength", "QAmeter", "QAm");
LengthUOMClass.Description = "UOM Class representing length";

// Display the name, description, and Canonical UOM of each UOM Class
Console.WriteLine("Name of UOM Class = {0}", LengthUOMClass.Name);
Console.WriteLine("Description = {0}", LengthUOMClass.Description);
Console.WriteLine("Canonical unit of measure = {0}", LengthUOMClass.CanonicalUOM.Name);

// Display a message telling if this is a Base Class
if (LengthUOMClass.IsBaseClass)
    Console.WriteLine("This UOM Class is a Base Class");
else
    Console.WriteLine("This UOM Class is NOT a Base Class");
' This example will create a base UOM Class and then display its information.

' Get the Database
Dim myPISystems As New PISystems
Dim myDB As UOMDatabase = myPISystems.DefaultPISystem.UOMDatabase

' Create a UOM Class
Dim LengthUOMClass As UOMClass = myDB.UOMClasses.Add("QALength", "QAmeter", "QAm")
LengthUOMClass.Description = "UOM Class representing length"

' Display the name, description, and Canonical UOM of each UOM Class
Console.WriteLine("Name of UOM Class = {0}", LengthUOMClass.Name)
Console.WriteLine("Description = {0}", LengthUOMClass.Description)
Console.WriteLine("Canonical unit of measure = {0}", LengthUOMClass.CanonicalUOM.Name)

' Display a message telling if this is a Base Class
If LengthUOMClass.IsBaseClass = True Then
    Console.WriteLine("This UOM Class is a Base Class")
Else
    Console.WriteLine("This UOM Class is NOT a Base Class")
End If

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

Version Information

AFSDK


See Also

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