UOM Class
- Last UpdatedNov 18, 2025
- 8 minute read
- PI System
- AF SDK 2024 R2
- Developer
The unit-of-measure object describes the units of a value.

Inheritance Hierarchy
Namespace: OSIsoft.AF.UnitsOfMeasure
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[SerializableAttribute] public sealed class UOM : AFObject, IComparable<UOM>
<SerializableAttribute> Public NotInheritable Class UOM Inherits AFObject Implements IComparable(Of UOM) Dim instance As UOM
[SerializableAttribute] public ref class UOM sealed : public AFObject, IComparable<UOM^>
[<SealedAttribute>] [<SerializableAttribute>] type UOM = class inherit AFObject interface IComparable<UOM> end
The UOM type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| Abbreviation |
This property provides a unique abbreviation for the unit of measure.
| |
| Class |
This read-only property indicates the class of measurement for this unit of measure.
| |
| Database |
This read-only property allows access to the UOMDatabase associated with this
object.
| |
| DayBasedTimeIntegralUOM |
Returns the UOM that corresponds to the day-based time integral of this UOM
or if none is defined.
| |
| DeltaUOM |
The UOM that corresponds to the difference in two quantities in this UOM.
| |
| Description |
Read/write property that provides a more detailed description of the object.
| |
| Factor |
This read-only property provides the conversion factor to the canonical unit for
this unit of measure.
| |
| 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.) | |
| 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.
| |
| Offset |
This read-only property provides the conversion offset to the canonical unit for
this unit of measure.
| |
| Origin |
This read-only property indicates the origin of this unit of measure.
| |
| PISystem |
This read-only property allows access to the PISystem associated with this
object.
(Inherited from AFObject.) | |
| RefFactor |
This property provides the conversion factor to the reference unit of measure for
this unit of measure.
| |
| RefFormulaFrom |
This property provides the formula to convert from the reference unit of measure
to this unit of measure.
| |
| RefFormulaTo |
This property provides the formula to convert to the reference
unit of measure from this unit of measure.
| |
| RefOffset |
This property provides the conversion offset to the reference unit of measure for
this unit of measure.
| |
| RefUOM |
This property indicates the reference unit of measure for this unit of measure.
| |
| TimeIntegralUOM |
The UOM that corresponds to the time integral of this UOM.
| |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) |
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.) | |
| Convert |
This method converts the specified value from the specified unit of measure (UOM)
to the UOM represented by this object.
| |
| 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.) | |
| FindUOMs |
Performs a non-paged text search within the UOMDatabase to retrieve a collection
of UOM objects which have a field that match the specified query string.
| |
| GetGroupMapping | ||
| 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.) | |
| Update |
This method updates the conversion factors for this unit of measure (UOM).
| |
| UpdateFormula |
This method updates the conversion formulas for this unit of measure (UOM).
|
Remarks
The unit-of-measure (UOM) object describes the units of a value. The
UOM also contains information needed to convert one unit to another
unit.
Examples
// This example will create several UOMs of the same UOM class // and then demonstrate how to perform conversions between them. // Get the Database PISystems myPISystems = new PISystems(); UOMDatabase myDB = myPISystems.DefaultPISystem.UOMDatabase; // Set the UOM Class UOMClass LengthUOMClass = myDB.UOMClasses.Add("QALength", "QAmeter", "QAm"); // Create UOMs UOM Meter = myDB.UOMs["QAmeter"]; UOM Inch = myDB.UOMs.Add("QAinch", "QAin", Meter, 0.0254, 0); UOM Foot = myDB.UOMs.Add("QAfoot", "QAft", Inch, 12, 0); UOM Yard = myDB.UOMs.Add("QAyard", "QAyd", Inch, 3 * 12, 0); UOM Mile = myDB.UOMs.Add("QAmile", "QAmi", Foot, 5280, 0); // Display Information each UOM foreach (UOM CurUom in myDB.UOMClasses["QALength"].UOMs) { Console.WriteLine("Name of UOM = {0}", CurUom.Name); Console.WriteLine("Abbreviation = {0}", CurUom.Abbreviation); } // Convert 18 Inches to Feet Console.WriteLine("18 Inches converted to Feet = {0}", Foot.Convert(18, Inch)); // Update the Formula for the Yard UOM Yard.Update(Foot, 3.0, 0); // Convert 18 Inches to Yards Console.WriteLine("18 Inches converted to Yards = {0}", Yard.Convert(18, Inch));
' This example will create several UOMs of the same UOM class ' and then demonstrate how to perform conversions between them. ' Get the Database Dim myPISystems As New PISystems Dim myDB As UOMDatabase = myPISystems.DefaultPISystem.UOMDatabase ' Set the UOM Class Dim LengthUOMClass As UOMClass = myDB.UOMClasses.Add("QALength", "QAmeter", "QAm") ' Create UOMs Dim Meter As UOM = myDB.UOMs("QAmeter") Dim Inch As UOM = myDB.UOMs.Add("QAinch", "QAin", Meter, 0.0254, 0) Dim Foot As UOM = myDB.UOMs.Add("QAfoot", "QAft", Inch, 12.0#, 0) Dim Yard As UOM = myDB.UOMs.Add("QAyard", "QAyd", Inch, 3.0# * 12.0#, 0) Dim Mile As UOM = myDB.UOMs.Add("QAmile", "QAmi", Foot, 5280.0#, 0) ' Display Information each UOM Dim CurUOM As UOM For Each CurUOM In myDB.UOMClasses("QALength").UOMs Console.WriteLine("Name of UOM = {0}", CurUOM.Name) Console.WriteLine("Abbreviation = {0}", CurUOM.Abbreviation) Next CurUOM ' Convert 18 Inches to Feet Console.WriteLine("18 Inches converted to Feet = {0}", Foot.Convert(18, Inch)) ' Update the Formula for the Yard UOM Yard.Update(Foot, 3.0#, 0) ' Convert 18 Inches to Yards Console.WriteLine("18 Inches converted to Yards = {0}", Yard.Convert(18, Inch))
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.