UOMClass Class
- Last UpdatedNov 18, 2025
- 6 minute read
- PI System
- AF SDK 2024 R2
- Developer
The unit-of-measure class (UOMClass) represents a group of
units of measure and describes the fundamental dimensions of their
measurements.

Inheritance Hierarchy
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
| Name | Description | |
|---|---|---|
| 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.
| |
| CanonicalUOM |
This is the canonical unit of measure (UOM) for this class.
| |
| Database |
This read-only property allows access to the UOMDatabase associated with this
object.
| |
| Description |
Read/write property that provides a more detailed description of the object.
| |
| 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.) | |
| Identity |
This read-only property contains identity of the object.
(Inherited from AFObject.) | |
| IsBaseClass |
This property indicates if this is a base unit of measure (UOM) class.
| |
| IsDeleted |
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.) | |
| Name |
Read/write property that identifies the name of the object.
| |
| PISystem |
This read-only property allows access to the PISystem associated with this
object.
(Inherited from AFObject.) | |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) | |
| UOMs |
Gets the collection of UOM (unit of measure)
objects that were created from this class.
|
Methods
| Name | Description | |
|---|---|---|
| CompareTo(Object) |
Compares this instance with a specified Object.
(Inherited from AFObject.) | |
| CompareTo(AFObject) |
Compares this instance with a specified AFObject.
(Inherited from AFObject.) | |
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.) | |
| Equals(AFObject) |
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.) | |
| 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.) | |
| GetPath |
Returns the full path to the object, using just the names.
(Inherited from AFObject.) | |
| GetPath(AFObject) |
Returns the path to the object relative from another object.
(Inherited from AFObject.) | |
| 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.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| Persist |
This method returns the persistence string for the object.
(Inherited from AFObject.) | |
| 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.