Since 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 Language Alias Conversion:
Open GraphWorX64 and create a process point.
Click on the Ellipsis button to open the Data Browser and 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
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
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
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.
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
Fahrenheit to Celsius conversions 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 tuns, 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.
Enter a READ and WRITE expression for the value conversion.
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.
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.
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: