Type translator rules, Type translator rule xml files, Type translator rules -1 – Echelon i.LON 100 e2 Internet Server User Manual
Page 194: Type translator rule xml files -1, 13 type translator rules, 1 type translator rule xml files
![background image](/manuals/735745/194/background.png)
i.
LON 100 Internet Server Programmer’s Reference
13-1
pe
Translator
13 Type Translator Rules
You can use the Type Translator Rule SOAP functions to create additional Type Translator
Rules for the
i.
LON 100, or to modify the Type Translator Rules provided with the
i.
LON 100
software. Each Type Translator Rule defines the network variable type of the data points a
Type Translator will take as input, and the network variable type these data points will be
translated to. In addition, they define the factors that are required to determine the value to
be assigned to the output data point during a translation, such as scaling, offsets, and case
structures to handle enumerations and fields within structures. This section provides an
overview of how this works.
A Type Translator referencing a Type Translator Rule will specify input data points
matching the input network variable types for that rule, and output data points matching
the output types for that rule. The values of the input data points will then be translated and
stored in the output data points each time any of the input data points are updated.
If an input data point is a structure, you can specify which field(s) in the input data point is
to be translated. Similarly, if the output data point is a structure, you can specify which
field(s) the result of a translation is to be stored in. Using these features, you can configure a
Type Translator Rule to convert multiple input data points into a single output data point, or
a single input data point into multiple output data points.
You can optionally create case structures that define the logic for a translation. For example,
if the input data point has a scalar value and the output data point is an enumeration, you
could set up a case structure to map ranges of scalar values to different enumerations for the
output data point. Alternatively, you could set up case rules to map the various enumeration
values an input data point to scalar values, or to different enumeration values, for an output
data point.
This chapter describes how to create a Type Translator Rule. Once you have created a Type
Translator Rule, you can reference it from a Type Translator. For more information on the
Type Translator application and how to create a Type Translator, see Chapter 12, Ty
.
13.1 Type Translator Rule XML Files
The configuration of each Type Translator Rule defined for the
i.
LON 100 will be stored in an
XML file in the /root/config/Software/TranslatorRules directory of the
i.
LON 100. All files in
this directory are read during boot, and valid rules are made available to the Type Translator
application. By default, this directory contains several XML files that you can use with your
Type Translators. Chapter 13 introduces the Type Translator Rules defined by these files,
and describes how to use them with a Type Translator.
This chapter describes how to use the SOAP interface to create a new Type Translator Rule,
or to modify an exisiting Type Translator Rule.
The following sample shows the XML file that stores the configuration of a Type Translator
Rule called 2xSwitch_to_Switch. This Type Translator Rule takes 2 SNVT_switch data
points as input. It stores the state field of the first input data point, and the value field of the
second input data point, in the output data point, which is also a SNVT_switch data point.