Skip to main content

13.3 Units of Measurement

In industrial and IoT environments, measurements collected from different devices or systems often use different units. Even after data is stored in TDengine TSDB, unit inconsistencies can remain across assets or over time. IDMP manages this through a Units of Measurement (UOM) library that enables automatic unit conversion in attribute formulas, calculations, and display.

UOM is managed under Libraries → UOM.

13.3.1 UOM Classes​

IDMP organizes units into UOM classes — groups of units that measure the same physical quantity. Each class has a canonical unit (the base unit used internally for conversions) and optionally one or more base UOM classes (for derived quantities such as Pressure = Mass / (Length × Time²)).

IDMP ships with the following built-in UOM classes:

ClassCanonical UnitBase UOM Classes
Areasquare meterLength
Computer Storagebyte—
Densitykilogram per cubic meterLength, Mass
Electric Currentampere—
Electric Potentialvolt—
Electric PowerVoltAmp—
Energyjoule—
Lengthmeter—
Masskilogram—
Molecular Weightgram per mole—
Molesmole—
Plane Angleradian—
Powerwatt—
PressurepascalLength, Mass, Time
Ratio%—
Specific Energyjoule per kilogramLength, Time
Specific Volumecubic meter per kilogramLength, Mass
Temperaturekelvin—
Timesecond—
Velocitymeter per second—
Volumecubic meterLength

You can extend this list by adding custom UOM classes.

13.3.2 Viewing Units in a Class​

Click any UOM class name to see its individual units. The unit list shows:

ColumnDescription
NameUnit name (e.g., liter, US gallon)
AbbreviationShort symbol (e.g., L, US gal)
OriginSystem Defined for built-in units, or the user name for custom units
DescriptionOptional description
CanonicalConversion formula relative to the canonical unit
Quantity ConvertedHow many of this unit equal one canonical unit

A Quantity field at the top lets you enter a reference amount to preview conversions across all units in the class.

13.3.3 Creating a Custom UOM Class​

Click + on the UOM list page to create a new class. Fill in:

FieldDescription
Name (required)Class name. Accepts letters, numbers, underscores, hyphens, and spaces.
Canonical UOM (required)The name of the canonical (base) unit for this class.
UOM Abbreviation (required)The abbreviation for the canonical unit.
DescriptionOptional description.
Base UOM ClassOptional. Add one or more existing classes that this class is derived from (e.g., Pressure is derived from Mass, Length, and Time). Click + to add each base class.

Click Save to create the class.

13.3.4 Adding a Custom Unit to a Class​

Open a UOM class and click + to add a new unit. Fill in:

FieldDescription
Name (required)Unit name. Accepts letters, numbers, underscores, hyphens, and spaces.
Abbreviation (required)Short symbol for the unit.
DescriptionOptional description.
Ref UOMThe reference unit to convert from (defaults to the canonical unit of the class).
Ref FactorMultiplicative factor: new_unit = Ref_Factor × Ref_UOM. Default: 1.0.
Ref OffsetAdditive offset applied after the factor: new_unit = Ref_Factor × Ref_UOM + Ref_Offset. Use this for non-proportional conversions such as Celsius ↔ Fahrenheit. Default: 0.0.

Click Save to add the unit.

13.3.5 Assigning UOM to Attributes​

Each attribute can be configured with:

  • UOM Class — the physical quantity type (e.g., Temperature)
  • Default UOM — the unit in which data is stored in TSDB (e.g., kelvin)
  • Display UOM — the unit shown to users (e.g., Celsius)

When the default UOM and display UOM differ, IDMP automatically converts the stored value to the display unit.

13.3.6 Automatic Unit Conversion in Formulas​

When attributes with UOM assignments participate in formula expressions, IDMP applies unit conversion rules automatically. This ensures that calculated results are physically meaningful.

13.3.6.1 Addition and Subtraction​

For A + B or A - B:

  • If A and B belong to different UOM classes, an error is reported.
  • If A and B belong to the same UOM class but have different units, IDMP converts B's unit to A's unit before computing.
  • If one operand has a UOM and the other does not, the unitless operand is treated as having the same unit as the other.

13.3.6.2 Multiplication and Division​

For A * B or A / B:

  • Both operands are first converted to their respective canonical units.
  • The result's UOM class is determined by combining the base UOM classes of the operands (e.g., Mass / (Length × Time²) = Pressure).
  • The result unit is the canonical unit of the resolved class.
  • If the resulting combination does not match any defined UOM class, an error is reported.

Example: Attribute A has unit cm (Length), attribute B has unit m² (Area). The formula A * B converts A to meters, multiplies by B, and produces a result in m³ (Volume).

13.3.6.3 Comparison and Bitwise Operators​

For operators =, <>, >, <, >=, <=, |, &:

  • If both operands have UOM and belong to different classes, an error is reported.
  • If one operand has UOM and the other does not, UOM is ignored.
  • If both operands have UOM and belong to the same class with different units, the right operand is converted to the left operand's unit before the operation.

13.3.6.4 Functions​

The result of a function applied to an attribute carries the same UOM as the function's first argument. For example, SIN(A) has the same UOM as A.

tip

When editing a formula expression on an attribute, click the Evaluate button in the expression editor to preview the computed value and automatically detect unit errors. If the attribute has no UOM assigned yet, IDMP will suggest the UOM inferred from the last evaluation result.