Set Up Unit Types¶
You set up unit types to group engineering units based on a specific kind of measurement. For each unit type, you can then assign unit conversions to enable converting a measurement from one unit to another within the same unit type.
For example, if you have a unit type called “Temperature” with the base unit Fahrenheit (F), you can add a unit conversion that converts Fahrenheit to Celsius (C), and another unit conversion that converts Fahrenheit to Kelvin (K).
Follow the steps below to set up unit types and assign unit conversions to them.
Define Unit Types¶
Choose
from the menu.On the Units tab, select the Unit Type radio button on the top of the tab page.
Click
Add on the toolbar.
In the Unit Type Configuration dialog, enter data as follows:
Field
Description
Name
Enter a name that uniquely identifies the unit type.
Internal Default Unit Name
Specify the name of the base unit that you want to use for the unit type. This will be the primary unit of measurement within a unit type that serves as the reference point for all conversions to other units within that type.
Description
Enter any additional information about the unit type as required.
Click Submit to save your entries.
Result
A new row for the unit type entry gets added to the grid. A default unit conversion is automatically assigned to the unit type with Gain value 1 and Offset value 0. To add additional unit conversions, follow the steps described in Add Unit Conversions. You can edit or delete the new unit type entry using the corresponding icon in the Action column.
Add Unit Conversions¶
Once you have created a unit type, you can add unit conversions to it as described below:
Choose
from the menu.On the Units tab, start adding a unit conversion in either of the following ways:
Option 1
Select the Unit Type radio button on the top of the tab page.
Expand the row of the relevant unit type by clicking the
icon in the first column of the row.
Under the expanded row, click
at the top of the Units Conversion table.
Option 2
Select the Unit Conversion radio button on the top of the tab page.
Click
Add on the toolbar.
In the Unit Conversion Configuration dialog, enter data as follows:
Field
Description
Unit Type Name
Enter the name of the unit type to which you want to assign the unit conversion. This is only necessary if you use Option 2 for creating the unit conversion.
Name
Specify the target unit for the conversion. This wil be the unit to which the conversion will be performed. For example, if the unit type is area, this can be “m2”.
Base Unit Name
Select the primary unit of measurement within the Unit Type that serves as the reference point for conversions. For example, if the unit type is area, this can be “ft2”. The available options depend on the units predefined for the selected unit type.
Default DotNet Format
Set the default formatting style applied to the unit when using dotnet format. This ensures consistency in how the unit is displayed and processed in .NET applications.
Gain
Enter the multiplication factor used in unit conversion. It determines how much the base unit value should be multiplied to convert to another unit.
Offset
Specify the addition or subtraction factor used in unit conversion. It adjusts the base unit value by adding or subtracting a specific amount to convert to another unit.
Example
If the unit type is Temperature, the base unit is Fahrenheit and the target unit is Celcius, you configure the unit conversion as follows:
In this case, if the tag has a value of 212 F, the unit conversion will be performed as follows:
TempC = (TempF * Gain) + Offset TempC = (212 * 0.555556) + -17.777778 = 100 Deg C
The reverse conversion would be:
TempF = (TempC - Offset) / Gain TempF = (100 - -17.777778) / 0.555556) = 212
Tip
You can test the unit conversion at the bottom of the dialog in the Unit Calculator.
Save your entries.
Result
A new row for the unit conversion entry gets added to the grids, both in the Unit Conversion table under the expanded Unit Type, and in the Units Conversion grid. You can edit or delete the new unit conversion entry using the corresponding icon in the Action column.
Example Unit Conversion¶
The example below shows setting up conversions for an Energy Rate unit type, illustrating how to convert between a base rate and a millionths multiplier.
To set this unit conversion up, you follow the steps below:
You create a unit type for the energy rate, with the default base unit BTU/hr.
You add a unit conversion for the base unit (BTU/hr) as well as a unit conversion for the target unit MMBTU/hr.
In this case, unit conversions are performed as follows:
Conversion from BTU/hr to MMBTU/hr:
MMBTU/hr=(BTU/hr * Gain) + Offset MMBTU/hr=(1000000 * 0.000001) + 0 = 1 MMBTU/hr
Reverse conversion from MMBTU/hr to BTU/hr:
BTU/hr = (MMBTU/hr - Offset) / Gain BTU/hr = (1 - 0) / 0.000001 = 1000000 BTU/hr