Appendix B ______________________________________________________ MODBUS Reference
VAISALA ______________________________________________________________________ 187
A “quiet NaN” value is returned for unavailable values. Writing any NaN
or infinite value is silently ignored. A Quiet NaN is, for example,
0x7FC00000; however, the master should understand any NaN value.
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, mixing ratio (x) value 658.92 g/kg is returned in 16-bit
integer format as 356 (0x0164). You will need to add suitable offset to
the 16-bit data in the MODBUS master to get valid value out:
356 (16-bit register value) + 65536 (offset) = 65892 --> 658.92 g/kg
(scaled by ×0.01).
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.