Unit systems |
Top Previous Next |
Conversion functions The variable object can convert values of numerical variables for the display/input. This enables a value to be displayed in different unit systems. The unit system is selected via Button action unit=<index>. The set unit system can be displayed with the /S/APP/UnitIdx system variable. The unit system is changed by changing the /S/APP/UnitIdx system variable. The conversion functions for the different unit systems are defined as follows in the Function column:
<unit>function0,function1,...</unit>
/S/APP/UnitIdx specifies which of the defined functions are used: 0 -> function0 1 -> function1 ...
The following predefined functions are available:
Example: <unit>,°c_°f</unit>
/S/APP/UnitIdx=0 -> No conversion /S/APP/UnitIdx=1 -> Conversion from °C to °F
User-defined functions Simple functions can however be defined by the user. For this the operators *,/,+,- are supported. An operand (floating point number) must follow an operator. Any operator-operand combinations can be linked and the result of the first operation transferred to the next operation.
Example: <unit>,*1.8+32</unit>
/S/APP/UnitIdx=0 -> No conversion /S/APP/UnitIdx=1 -> VarValue is multiplied by 1.8 and added to 32. (corresponds to °c_°f)
Unit system dependent formatting Unit system dependent format strings can be configured as follows in Column B Text/File:
[Leading text]<unit>format0,format1,...</unit>[Trailing text]
Example: Boiler temperature <unit>%f °C,%f °F</unit>
/S/APP/UnitIdx=0 -> Boiler temperature 80.00 °C /S/APP/UnitIdx=1 -> Boiler temperature 176.00 °F
|