Language Alias Conversions

Different languages and cultures use different methods for indicating distance, temperature, currency, and many other aspects of everyday life. The language aliasing system (LAS) provides a method for not only translating one string to another, but can convert one value to another with both a value expression and units of measure translation or substitution.

 

This topic describes the process needed to convert one data point's value to another language using the example of converting an American temperature display in degrees Fahrenheit to a European Common Market temperature display in degrees Celsius (formerly Centigrade).

 

To perform a language alias conversion in a GraphWorX64 display, do the following:

  1. Open GraphWorX64 and create a process point. When you draw the process point on the work area, the Unified Data Browser opens. Go to its Language Conversions tab.

  2. Select the conversion output type from the drop down menu, as shown in the figure below.

The Language Conversion Output Type

  1. Assign a data point (OPC UA) to the process point; then select the units of measure unit binding from the Language Conversions tab, as shown in the figure below.

Define a Data Point and Units of Measure in the Data Browser

Use the data browser to select first a data point, and then a language conversion.

 

The value of the data point is taken from the data source, while the unit binding provides the required lookup to conversions in different languages to be used by the unit conversion function. The Data Browser formats your data point and units of measure selection appropriately putting in the correct paths (e.g., Temperature\FromFarenheit) and formatting.

 

Note. The FrameWorX Server must be running in order for the Data Browser to display data.

 

The DataSource Embeds the UnitBinding and Conversion Formula In GraphWorX64

Set the DataSource in the Data Browser's Language Aliasing Tab.

  1. Assign a conversion function for the unit binding in the Unit Binding form, as shown below.

Unit Bindings Provide the Instructions for Unit Conversion Based on Locale

Unit bindings give language specific instructions for conversions.

Notice that the Unit Binding takes values in the current unit of measure and assigns a language specific Unit Conversion for the locale (e.g. F to C for Germany, France, etc.). It sets the Data Type, and since the Default Unit Conversion is F-C all of the countries other than English (United States) use the default unless otherwise specified. For English (United States) to English (United States) the Unit Conversion F-F is assigned, where no conversion is performed.

  1. Create a set of unit conversions for each of the different possibilities (C-C, F-C, F-F, and C-F), as shown in the figure below.

Unit Conversions Contain Conversion Instructions for Each of the Different Possibilities

 

Using Fahrenheit to Celsius as an example conversion, you need not only F to C, and C to F, but F to F and C to C for situations where the conversion is not performed.

 

If you were performing conversions between the three different types of tonnage: short tons, long tons, and metric tons, then you would need definitions for: ST-ST, LT-LT, MT-MT, ST-LT, ST-MT, LT-ST, LT-MT, MT-ST, and MT-ST or nine separate functions. The number of conversions you must define is 2n+1, where n is the number of different units of measure being converted.

  1. Enter a READ and WRITE expression for the value conversion.

  2. Specify how the units of measure will be converted in the Units section: as a prefix or suffix; as text or more commonly from an alias that you define.

In the screen above, the alias Celsius is used as a suffix since Celsius is what the Fahrenheit value is being converted to. This feature allows you to control how each individual language translates the output for Celsius required for this specific conversion.

  1. If a conversion requires formatting (optional) enable the Format Numbers check box, enter the number of Decimal digits, and/or enable the Digit Grouping check box. For example, many countries specify Celsius appear with a single decimal place (22.7); or that large dollar values appear in the form: $1,500,000.00.

  2. Click Apply to enforce your new settings.

Changes you make in the LAS are automatically propagated to clients and should appear in a short time in a display. Typical refresh intervals of from 1 to 3 seconds should be observed.

 

See Also:

Language Support

Language Aliasing System

Language Alias Translation

Language Alias Database