ConvertersΒΆ
Introduction
A converter is an object used in one or more advanced dynamic links to transform the source value before assigning it to the parent node. The link in this case is defined as advanced dynamic link.
Every converter has one or more source variables, one output, and a variable number of properties.
Types of Converters
Here are the available native converters:
Engineering Unit Converter: a simple, linear converter used to transform a range of raw values in input into significant values for an HMI application (e.g.: it is possible to transform values from 0 to 65.535 supplied by a temperature sensor into corresponding values on a scale from -20 to +70).
Key-Value converter: converts the value of the source variable according to a table of key-value pairs. Allows converting heterogeneous data (e.g.: color-value conversion).
String Formatter: modifies the formatting of one or more values according to a customizable rule (e.g.: if the value of the source variable is a number, it is possible to add more characters before or after the value).
Expression Evaluator: performs arithmetic calculations with one or more input values with custom expressions.
Graphical Representation of Converters
In the advanced dynamic link editor, converters are represented graphically, as shown in the following example, for an engineering unit converter:
Part |
Description |
---|---|
A |
Parent variable. It is assigned the value of the converter output. |
B |
Converter Output |
C |
Converter (in the example, |
D |
Converter Properties. Their values can be set in various ways:
|
E |
Converter Sources. These are always dynamic links or other converters. |
Local and Type Converters
Depending on the need to reuse or not, a converter can be local or a type with the relative instances.
If a converter with its properties is used in a single advanced dynamic link, it is appropriate to create a local converter in the advanced dynamic link editor.
If a converter with its properties is used in several advanced dynamic links, it is useful to create a type converter in Projectand create instances of the advanced dynamic link editor.