Xentara v2.0.4
User Manual
|
Converted values are skill data points that convert the value of another skill data point using a set of value mappings. The source data point is referred to as the raw value, and must be either a numeric data point, or a Boolean data point. For Boolean data points, the value false is interpreted as 0, and the value true as 1. Converted values support both integers and floating point values as raw values, but the converted value is always a double precision floating point value.
The converted value data point supports the same I/O directions as the raw value data point. If the raw value data point supports the input direction, then its value is automatically converted to a converted value. If the raw data points supports the output direction, any value written to the converted value data point is converted back into a raw value and written to the raw value data point. Both conversions are done automatically and do not require a task to be scheduled.
The conversion is performed using one or more value mappings, each of which specifies the desired converted value for a specific raw value. There are three types of conversions, depending on the number of value mappings you specify. The conversion types are described below.
The simplest type of conversion is a proportional scaling, that simply multiplies the raw value with a fixed factor. A scaling requires only one single value mapping, that specifies the desired value for an arbitrary raw value. Since the scaling is a simple multiplication, a raw value of 0 will have a converted value of 0.
The conversion between raw and converted values for a proportional mapping looks like this:
The raw value and the converted value can be positive or negative, and the raw value need not lie within the range of the raw value data point. Neither the raw value not the converted value must be 0, however.
Proportional scalings are generally used in three situations:
A linear conversion uses two value mappings to define a linear function that is used to convert the values. A linear conversion is similar to proportional scaling, but a raw value of 0 does not necessarily represent a converted value of 0.
The conversion between raw and converted values for a linear conversion looks like this:
The raw values and converted values can be positive or negative, and the raw values need not lie within the range of the raw value data point. Because the conversion must work in the output as well as the input direction, the mapping must be invertible, however, meaning that neither the two raw values nor the two converted values can be the same.
Linear conversions are generally used in two situations:
Strictly speaking, linear conversion is a special case of linear interpolation with only two interpolation points.
Multi-point linear interpolation uses a set of value mappings and perfrom a linear interpolation to convert the value. Values that lie between to interpolation points are interpolated, and values that lie outside the range are extrapolated.
The conversion between raw and converted values for a multi-point linear interpolation with five value mappings looks like this:
The raw values and converted values can be positive or negative, and the raw values need not lie within the range of the raw value data point. Because the conversion must work in the output as well as the input direction, the mapping must be invertible, however, meaning that the conversion graph must be strictly ascending or strictly descending.
Multi-point linear interpolation is generally used to calibrate a sensor attached to an analog input in the case where the sensor response is non-linear. A set of measurements must be taken, and the obtained raw values mapped to the correct real-world values, resulting in a set of calibration points. These calibration points must then be attached to the converted value data point as value mappings.
Converted values have the following members:
key | The converted value’s primary key. |
name | The converted value’s name. The name is the last component of the primary key. |
UUID | The unique UUID of the converted value. |
type | The converted value’s element type. For converted values, this is always “converted value”. |
category | The converted value’s category. For converted values, this is always “data point”. |
value | The converted value’s value. This attribute has the same readability and writability as the raw value’s value attribute, meaning that this attribute is readable if the raw value’s value attribute is readable, and writable if the raw value’s value attribute is writable. |
updateTime | The last time the value was updated. This attribute is only available for converted values whose raw value supports the input direction. |
changeTime | The last time the value changed. This attribute is only available for converted values whose raw value supports the input direction. |
quality | The quality of the current value. This attribute is only available for converted values whose raw value supports the input direction. |
error | If the quality attribute is anything but “good”, this attribute contains the error that caused the quality to degrade. This attribute is only available for converted values whose raw value supports the input direction. |
changed | This event is raised when the value, the quality, or the error changes. This event is only available for converted values whose raw value supports the input direction. |
Additionally, the converted value will inherit all attributes and events related to the input and/or output data from its raw value, as applicable. At least the following attributes are inherited from the raw value data point, if is provides them:
Each individual type of skill data point can have additional attributes and events that are inherited by converted values. Please refer to the documentation of the specific skill data point for details. Converted values inherit the same attributes and events as data points.