Bit integer format – Vaisala MMT330 User Manual

Page 165

Advertising
background image

Appendix A _________________________________________________________ Modbus Reference

VAISALA _______________________________________________________________________ 165

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 … 1 aw) 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.

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
integer range. Maximum writable value is 32767 also for configuration
registers that do not accept negative values.

Advertising