Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:

  • Metric to Imperial conversion
  • Imperial to Metric conversion
  • Custom conversion tables
  • Client-specific display units
  • Runtime unit switching
  • Extensible conversion definitions

Each client station can display values in its preferred measurement system without affecting other connected clients or server values

Overview

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

.

On this page:

Table of Contents
maxLevel

3

2
minLevel2
indent10px
excludeSteps
stylenone

Image Removed

To configure a tag for unit conversion:

  1. Set the tag’s Units property. You can do this through the Unified Namespace / Tags table. You can also change it via CodeBehind or Scripts, by assigning a value to Tag.<TagName>.Units.
  2. To apply unit conversions to your solution, assign the name of the desired conversion table to the Client.Units property.
  3. All tags with units affected by the conversion table will have their values changed. To display the tag’s unit after conversion, use Tag.<TagName>.DisplayUnits.

Configuration Steps

  1. Set Tag Units
    • Navigate to Unified Namespace → Tags
    • Configure Units property for each tag
    • Or set via script: @Tag.Temperature.Units = "°C"
  2. Apply Conversion Table
    • Assign conversion table to client
    • Set @Client.Units = "MetricToImperial"
    • Values automatically convert
  3. Display Converted Units
    • Use @Tag.Temperature.DisplayUnits
    • Shows converted unit string
    • Updates with conversion changes

Conversion Table Properties

PropertyDescriptionExample
BaseUnitOriginal unit before conversion°C
NewUnitUnit after conversion°F
DivDivision factor for conversion1.8
AddAddition factor for conversion32
BaseNameBase unit display nameCelsius
NewNameNew unit display nameFahrenheit
MeasurementTypeCategory of measurementTemperature

Conversion Formula

NewValue = (BaseValue / Div) + Add

Standard Conversions

Temperature

BaseNewDivAdd
°C°F0.55632
°F°C1.8-32

Length

BaseNewDivAdd
mft0.30480
ftm3.2810
kmmi1.6090
mikm0.6210

Pressure

BaseNewDivAdd
barpsi0.06890
psibar14.5040
kPapsi6.8950

Runtime Usage

Client-Side Configuration

csharp

// Set conversion table for client
@Client.Units = "MetricToImperial";

// Check current conversion
string currentTable = @Client.Units;

// Remove conversion
@Client.Units = "";

Tag Properties

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

Creating Custom Tables

  1. Navigate to Displays → Units Conversion
  2. Create new conversion set
  3. Define conversions:
    • BaseUnit and NewUnit
    • Div and Add factors
    • MeasurementType category

Example: Custom Speed Conversion

BaseUnit: m/s
NewUnit: km/h
Div: 0.278
Add: 0
MeasurementType: Speed

Multi-Client Scenarios

Different Units Per Client

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

Best Practices

  1. Define Units Early - Set during tag creation
  2. Group by Type - Organize conversions by measurement
  3. Test Conversions - Verify accuracy
  4. Document Custom - Explain custom conversions
  5. Consider Precision - Account for rounding
  6. Default Tables - Provide standard sets
  7. User Preferences - Store per operator

Measurement Types

Organize conversions by category:

  • Temperature - °C, °F, K
  • Pressure - bar, psi, kPa, MPa
  • Flow - m³/h, gpm, l/s
  • Length - m, ft, km, mi
  • Mass - kg, lb, ton
  • Volume - l, gal, m³
  • Speed - m/s, km/h, mph
  • Energy - kWh, BTU, J

Troubleshooting

Values not converting:

  • Check Units property set on tag
  • Verify conversion table assigned
  • Confirm table contains unit mapping
  • Review Div/Add factors

Wrong conversion:

  • Check formula factors
  • Verify unit strings match exactly
  • Test with known values
  • Review calculation order

Client differences:

  • Confirm each client's Units setting
  • Check local vs server values
  • Verify table assignments
  • Test client isolation

Examples

Temperature Gauge

xml

<TextBlock Text="{Tag.Temperature.Value}" />
<TextBlock Text="{Tag.Temperature.DisplayUnits}" />
<!-- Shows: "72" and "°F" for Imperial client -->

Dynamic Switching

csharp

public void ToggleUnits()
{
    if (@Client.Units == "MetricToImperial")
        @Client.Units = "";
    else
        @Client.Units = "MetricToImperial";
}

In this section...

Page Tree
root@parent
spaces93DRAF

Units Conversion Table Columns 

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
rootV10:@parent
spacesV10