Bit integer format – Vaisala PTU300 User Manual
Page 211

Appendix C _________________________________________________________ Modbus Reference
VAISALA _______________________________________________________________________ 209
NOTE
A complete 32-bit floating point value should be read and written in a
single Modbus transaction (e.g. function codes 05, 06, and 22 do not
have an effect on floating point values).
16-Bit Integer Format
16-bit integer values are scaled to include the necessary decimals
(see corresponding register table for the scaling factor). Negative values
(when applicable) are represented in 2’s complement (65535 = -1, 65534
= -2, etc.).
NOTE
Measurement parameters with normally positive values (for example,
0 … 100 %RH) may occasionally return small negative values because of
measurement inaccuracy. These negative values are returned as large 16-
bit integer values (2’s complement).
If the scaled value does not fit in the range 0…65535 (16-bit range), the
value is “wrapped” to the range by adding or subtracting 65536 as many
times as needed. For example, barometric pressure values are usually
around 1013.25 hPa, which is displayed in 16-bit format as 35789 (same
as -29747). You will need to add suitable offset to the 16-bit data in the
Modbus master to get valid value out:
35789 + 65536 = 101325
However, most of the measurement data values do not need any offset.
A zero 16-bit value is returned for unavailable values. There is no way to
distinguish missing values from actual zero values if the zero value is
included in the valid measurement range of the parameter.
NOTE
If your Modbus master supports 32-bit floating point values, always use
them instead of 16-bit integer registers.
The use of 16-bit integer values is not recommended in critical
applications because you cannot distinguish true zero values from zero
values generated by measurement failures.
In addition to this, 2’s complement makes negative values look like large
positive values, which must be taken into account when utilizing the
16-bit register values.
When writing 16-bit values in configuration registers, they are always
processed as signed integers in the range of -32768…+32767. You shall
use the floating point registers to write values outside this 16-bit signed