Data translation tables provide on-the-fly data conversion and are available in the OT Bus Stop. You can assign a translation table to a tag that converts a given shopfloor message field value into a channel message tag value and vice versa. The translation table acts as a lookup table.
Translation tables can be used for many things. For example:
Translate recipe numbers into readable text.
Translate error numbers into readable text.
Translate string constants into values.
The rules for a translation tables depend on whether it is for upload use, download use or bidirectional use:
Download: Has unique Shopfloor Message Field Values.
Upload: Has unique Channel Message Tag Values.
Bidirectional: Has unique Channel Message Tag Values and Shopfloor Message Field Values.
Select the OT Bus Stop tab.
Click Translation Tables.
A list of the existing translation tables is shown.
Click Add.
The Edit Translation Table dialog opens.
In the General tab, enter a unique name for the table.
Select the direction in which the data is being translated. This can be Upload, Download or Bidirectional.
Messages are Uploaded towards the Bus and Downloaded away from it.
Select the Data Translations tab.
Click Add.
Enter values for the Shopfloor Message Field Value and the Channel Message Tag Value. For example, in an Upload message, if the Channel Message Tag Value is 1 and the Shopfloor Message Field Value is 00001 then when the tag value received is 1 the field value will be 00001.
Click OK. The tag/field translation is added to the table.
Click Save.
The data translation table is saved.
Translation tables can be imported and exported as XML files by clicking Import or Export.
The following example shows how the translations appear in the XML file. If the translation table contains the following translations...
...the exported XML will look like this:
<Bus>
<OTDataTranslation Code="TranslateUp" ExternalId="c3a4aaa1-25ba-4d0a-9f82-e574a333aef6" Direction="Upload">
<TranslationPairs>
<OTDataTranslationPair Code="One -> 1" ShopfloorMessageFieldValue="One" ChannelMessageTagValue="1" />
<OTDataTranslationPair Code="Two -> 2" ShopfloorMessageFieldValue="Two" ChannelMessageTagValue="2" />
<OTDataTranslationPair Code="Three -> 3" ShopfloorMessageFieldValue="Three" ChannelMessageTagValue="3" />
</TranslationPairs>
</OTDataTranslation>
</Bus>
The data translation table can now be specified in the data source when adding tags to channel messages. This can be done in all channel messages.
When adding or editing a tag the data source is set to Data Translation Table. The required translation table can then be selected. When data is then received on the specified access path it will be translated according to the translation table. If the received value isn't specified within the translation table then the value won't be translated.
Can we improve this topic?