Operating Instructions 33
packet), so the actual register number that appears on the RS-485 bus will be “1000” (or in
hexadecimal, 0x03E8).
●
A common Modbus convention adds the function code as a leading digit on the register
number, so a register like
EnergySum
(
1001
) would be documented as
41001
. All input reg-
isters (function code 04) would use the form
4xxxx
, while holding registers (function code 03)
would use the form
3xxxx
. The WattNode meter treats holding registers and input registers
interchangeably, and does not use this convention. If your Modbus software expects a lead-
ing “3” or “4”, either will work for most registers, and use “3” for configuration registers.
Floating Point and Integer Registers
Most registers are available in floating point and integer formats. We generally recommend using
the floating point registers, because they provide more resolution and dynamic range and they
never requiring scaling. However, for energy variables, the 32 bit integer registers may be a better
choice, because they provide a constant resolution of 0.1 kWh. Since most of the integer registers
are 16 bits, they are faster to transfer over the Modbus interface and may require less space if
they are being logged.
Most of the integer registers are 16 bit signed integers that can report positive or negative
values from -32,768 to +32,767. In a few special cases, such as the energy registers, we use 32
bit signed integer registers (sometimes called “long integer”), which use two adjacent Modbus
registers and can report values up to approximately ± two billion.
Floating point values can report positive or negative values with typically six or seven significant
digits, which is far higher than the WattNode meter’s accuracy. However, for energy measure-
ments (kWh), floating point values have a limitation: the effective resolution in kWh gets lower as
more energy accumulates. If the total energy exceeds 100,000 kWh, the resolution of the floating
point energy will become coarser than 0.1 kWh, the constant resolution of the integer energy
values. At a total energy of 1,000,000 kWh, the floating point energy resolution becomes 1.0 kWh.
Reading and Writing 32 Bit Registers
Since floating point and 32 bit long integer registers require two adjacent registers to store 32
bits, there are some things to note when reading and writing these 32 bit dual registers:
●
The first register (at the lower address) contains the least significant 16 bits of data. This is
called little-endian and is the default for many programs that read 32 bit Modbus values, but
if this results in bizarre values (very large, very small, strange exponents, invalid values), look
for an option to reverse the registers, commonly referred to as “Float - Swapped”, “Float -
Reversed”, “Long - Swapped”, etc. Tridium JACE
®
systems refer to this as “byte order 1032”.
Do not select 64 bit double precision formats.
●
When reading a 32 bit register, read both registers with a single Modbus read command. The
WattNode meter is guaranteed to return consistent results for a single multiple register read
command. If you (or your software) issues two separate read commands for the two registers
making up a 32 bit register, the underlying 32 bit register may be updated between the two
read commands, resulting in an inconsistent or scrambled value.
●
When writing to 32 bit registers, the recommended approach is to use the
Write Multiple
Registers (16)
command to update both registers at the same time. However, meter incorpo-
rates logic to allow two
Write Single Register (06)
commands within 30 seconds, provided
no other Modbus commands are issued between the two writes.
For more information on Modbus register formats, floating point, programming, etc., see
http://www.ccontrolsys.com/w/Category:WattNode_Modbus
.