13 type translator rules, 1 type translator rule xml files, Type translator rules -1 – Echelon i.LON SmartServer 2.0 User Manual
Page 189: Type translator rule xml files -1, Type translator rule xml files
![background image](/manuals/735732/189/background.png)
i.LON SmartServer 2.0 Programmer’s Reference
13-1
13
Type Translator Rules
You can use the Type Translator Rule SOAP functions to create additional Type Translator Rules for
the SmartServer, or to modify the Type Translator Rules provided with the SmartServer software.
Each Type Translator Rule defines the network variable type of the data points a Type Translator will
accept 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 will 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. In addition, this chapter describes the pre-defined
type translator rules included with the SmartServer software. For more information on the Type
Translator application, see Chapter 12, Type Translator.
13.1
Type Translator Rule XML Files
The configuration of each Type Translator Rule defined for the SmartServer will be stored in an XML
file in the /root/config/Software/translatorRules directory of the SmartServer. 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.
This chapter describes how to use the SOAP interface to create a new Type Translator Rule, how to
modify an existing Type Translator Rule, and how to use the pre-defined Type Translator Rules on the
SmartServer.
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 two 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.
Rule)