beautypg.com

Creating a custom rule-based translation – Echelon SmartServer 2.2 User Manual

Page 471

background image

472

Using Type Translators

11. Repeat steps 7–8 for each case to be created in the current type translation. Each case in the

translation will be executed.

Creating a Custom Rule-Based Translation

To create a custom rule-based translation, you define one or more cases and a rule for each case that
executes when the case evaluates to TRUE. Each case is declared in an if-then statement or a nested
if-then statement. The rule specifies the value to be copied to the output points.

To create a custom rule-based translation, follow these steps:

1. Create a custom rule-based translation by adding a new translation or selecting a pre-defined

translation and customizing it to fit your application.

To add a new translation, on the Rule box, click Add Rule.

To create a custom translation by editing a pre-defined one, select the pre-defined translation
from the list below the Rule icon and then click Copy Rule. Alternatively, you can select a
pre-defined translation, click the Rule icon, and then begin editing the rule. The dialog in
which you create a new Type Translation appears. Proceed to step 2.

2. Follow steps 2–6 in the previous section, Creating a Custom Scalar-Based Translation.

3. Click the top-level ALWAYS case, select IF from the list, and then click Submit.

4. The IF-THEN statement can then be edited.

a. If you added more than one input point, you can change the default input point by clicking it

and then selecting an input point from the list.

b. If the input point is a structured data point, you can select a field within the data point to be

evaluated. By default, the entire structure is evaluated. You can explicitly set the rule to
evaluate the entire structure by selecting * from the list. This is required if you first select a
field and then decide to evaluate the entire structure.

c. Select one of the following comparison functions: equal to (default), not equal to, greater

than, less than, greater than or equal to, or less than or equal to. If you are evaluating a
structured data point as a whole, you can only select the equal (=) or not equal to (!=)
comparison functions.