Displays Units Conversion (Reference) enables automatic conversion between measurement systems, allowing multiple client displays to show values in their preferred units (Metric/Imperial) while connected to the same server.
Units Conversion provides:
Each client station can display values in its preferred measurement system without affecting other connected clients or server values
The Units Conversion interface helps convert different metrics, units, and measurement systems. This functionality already includes conversion tables for both Metric to Imperial and Imperial to Metric, but you can extend and modify them according to your requirements.
This feature allows two or more Client Displays connected to the same server to see the values and units on their own computers according to the metric currently selected for that operator station.
Table of Contents maxLevel
2 minLevel 2 indent 10px exclude Steps style none
@Tag.Temperature.Units = "°C"
@Client.Units = "MetricToImperial"
@Tag.Temperature.DisplayUnits
Property | Description | Example |
---|---|---|
BaseUnit | Original unit before conversion | °C |
NewUnit | Unit after conversion | °F |
Div | Division factor for conversion | 1.8 |
Add | Addition factor for conversion | 32 |
BaseName | Base unit display name | Celsius |
NewName | New unit display name | Fahrenheit |
MeasurementType | Category of measurement | Temperature |
NewValue = (BaseValue / Div) + Add
Base | New | Div | Add |
---|---|---|---|
°C | °F | 0.556 | 32 |
°F | °C | 1.8 | -32 |
Base | New | Div | Add |
---|---|---|---|
m | ft | 0.3048 | 0 |
ft | m | 3.281 | 0 |
km | mi | 1.609 | 0 |
mi | km | 0.621 | 0 |
Base | New | Div | Add |
---|---|---|---|
bar | psi | 0.0689 | 0 |
psi | bar | 14.504 | 0 |
kPa | psi | 6.895 | 0 |
csharp
// Set conversion table for client
@Client.Units = "MetricToImperial";
// Check current conversion
string currentTable = @Client.Units;
// Remove conversion
@Client.Units = "";
csharp
// Original unit
string baseUnit = @Tag.Pressure.Units; // "bar"
// Converted unit (after conversion applied)
string displayUnit = @Tag.Pressure.DisplayUnits; // "psi"
// Original value
double baseValue = @Tag.Pressure.BaseValue; // 10 bar
// Converted value
double displayValue = @Tag.Pressure.Value; // 145.04 psi
BaseUnit: m/s
NewUnit: km/h
Div: 0.278
Add: 0
MeasurementType: Speed
csharp
// Client 1 - US Operator
@Client.Units = "ImperialUnits";
// Sees: 72°F, 14.7 psi, 100 ft
// Client 2 - EU Operator
@Client.Units = "MetricUnits";
// Sees: 22.2°C, 1.01 bar, 30.5 m
// Server stores single value set
// Each client sees converted display
Organize conversions by category:
Values not converting:
Wrong conversion:
Client differences:
xml
<TextBlock Text="{Tag.Temperature.Value}" />
<TextBlock Text="{Tag.Temperature.DisplayUnits}" />
<!-- Shows: "72" and "°F" for Imperial client -->
csharp
public void ToggleUnits()
{
if (@Client.Units == "MetricToImperial")
@Client.Units = "";
else
@Client.Units = "MetricToImperial";
}
Page Tree | ||||
---|---|---|---|---|
|
To configure a tag for unit conversion:
Tag.<TagName>.Units
.Client.Units
property.Tag.<TagName>.DisplayUnits
.Property
Description
ID
Identifies each unit conversion entry uniquely.
VersionID
Tracks the version of the unit conversion entry.
BaseUnit
Represents the original unit of measurement before conversion.
NewUnit
Represents the unit of measurement after conversion.
Div
Indicates the division factor used in the conversion process.
Add
Indicates the addition factor used in the conversion process.
BaseName
Names the base unit.
NewName
Names the new unit after conversion.
DateCreated
Records the creation date and time of the unit conversion entry.
DateModified
Records the last modification date and time of the unit conversion entry.
MeasurementType
Specifies the type of measurement for the units involved, such as length or weight.
In this section:
Page Tree | ||||
---|---|---|---|---|
|