The Choice-Translator logical device provides a 2-way translation table for choice parameters. A common application for the Choice-Translator is to rename switch positions from the predefined ON/OFF resp. A/B labels to application specific designations like 'Transmit path 1'.
To make use of the Choice-Translator, install it in the device setup, configure the translation tables and the message ID you want to translate. In your user screens operate the translated parameter now through the 'value' parameter of the Choice-Translator instead of directly via the parameters original message ID.
Device window pages
The following table shows which device window pages are available with this individual device type. Tool-bar functions not mentioned here are described at the general description of device windows .
--- Simply contains a choice box to operate the translated parameter. Provided for completeness and for testing purposes.
--- The device info page.
--- The maintenance page. The configuration parameters from this page are described below.Configuration parameters
At the maintenance page of the device window there are a couple of configuration parameters which must be set to interconnect the Choice-Translator device with the device / parameter it shall translate.
| parameter | description |
|---|---|
| messageId | Enter the message identifier here of the parameter which shall be translated, eg. "SWITCH-1. position". Look at the list of device driver variable definitions to see correct name of this setting at the device type you are using. |
| choices | Enter the original choices of the parameter to translate, separated by commas. Ensure that all choices defined for this parameter are contained and that they are written exactly the same than the original. There must be no additional spaces between the items. |
| newChoices | Enter the translated list of choices here. There must be the same number of items in 'choices' and 'newChoices'. |
| fileName | The name of a file to read the 'choices' / 'newChoices' from. See Translation File below for details. |
Translation File
Instead of defining the 'choices' / 'newChoices' lists explicitly, you may read these settings from a file. This gives the opportunity to define recurring translation settings once and re-use them in multiple Choice-Translator instances. The file must define one pair of choice / newChoice value per line, separated by a comma character. Empty lines and lines beginning with a '#' character are ignored. Example:
# Example Choice-Translator definition file
#
OFF,NO
ON,YES
This translates the device settings OFF/ON to the values NO/YES in the Choice-Translator. To use this feature, edit a file with the translation definition and enter the name of the file in the 'fileName' configuration setting of the Choice-Translator. This sets the 'choices' / 'newChoices' values to the lists parsed from the file and makes these settings read-only. To return to normal mode, enter an empty String to the 'fileName' parameter.
Remarks
If the controlled parameter changes to a value which is not found in 'choices', the translated value does not change. The other way round, if 'choices' contains a value not recognized by the controlled parameter, the latter will change in a non predictable way.
Be aware, that there are some sophisticated device drivers which dynamically change the available choices (e.g. a modem may allow certain FEC settings only on QPSK, not in BPSK mode). Controlling such parameters with a Choice-Translator may end up in confusing results.
Variables defined by this device driver
| name | type | flags | range |
|---|---|---|---|
| info.driver | TEXT | R/O | StringRange R/O |
| info.type | TEXT | R/O | StringRange R/O |
| info.frame | TEXT | R/O | StringRange R/O |
| config.messageId | TEXT | SAVE SETUP | StringRange |
| config.choices | TEXT | SAVE SETUP | StringRange |
| config.newChoices | TEXT | SAVE SETUP | StringRange |
| config.fileName | TEXT | SAVE SETUP | StringRange |
| value | CHOICE | EnumRange () | |
| reset | TEXT | NOPRESET | StringRange |