Point Conversion

Point conversions are used to convert between the representations of external systems (the different Connectors List) and the normalized representation. 

How to use point conversion?

To use point conversion, the user must have first of all a connected point.

The point conversion only works for connected points

The point conversion is used by the connector framework with the curConvert, writeConvert, and hisConvert tags. Use cases include:

  • mathematical conversions of raw modbus registers

  • sensor voltage resets

  • sensor thermistor tables

  • unit conversion from fieldbus devices

So depending on the level where the user wants to make the conversion, meaning: the current value,write value or the history value, he will just add a string property tag for that point.

Example

If the user wants to convert the current value, for the numeric point in our screenshot, he will just add a curConvert string with the desired converted value ( let's say we want the value multiplied by 100)

Other examples of possible conversions:

  • multiply raw value by 100 and add 75: * 100 + 75

  • convert °C to °F: °C => °F

  • reset 5-10 to 0-100: reset(5, 10, 0, 100)

  • thermistor table; run pointThermistorTables() for full list: thermistor(10k-2)

  • invert bool true -> false, vise versa: invert()

  • swap endianness of unsigned two byte integer: u2SwapEndian()

  • swap endianness of unsigned four byte integer: u4SwapEndian()

All available functions are:

  1. invert()

  2. reset(inLo, inHi, outLo, outHi)

  3. thermistor(table-name)

  4. u2SwapEndian()

  5. u4SwapEndian()