Operating Instructions 31
Modbus Communication
The WattNode Modbus meter uses Modbus RTU communication. For full specifications, see
http://www.modbus.org/specs.php
. Modbus RTU is a binary protocol consisting of message
frames. Each frame contains a one byte address, a one byte function code, a variable number
of data bytes, and a two byte CRC. The end of a frame is signalled by a pause with no bytes
transmitted; the pause duration must be at least equivalent to 3.5 character (byte) periods. At
9600 baud the pause must last 3.6 milliseconds.
The Modbus RTU serial specification requires that the default serial protocol use 8 data bits, even
parity, and one stop bit. However, very few devices follow this part of the Modbus standard, so
the WattNode meter defaults to 8 data bits, no parity, and one stop bit instead. If your application
requires even parity, order
Option EP
or change the parity using the
ParityMode
register.
The Modbus protocol is a master/slave protocol, with only one master and many slaves. The
WattNode meter is always a slave device, and responds only when queried.
Modbus on EIA RS-485 allows for either full-duplex or half-duplex communication, but the
WattNode meter only supports half-duplex, meaning that the same wires are used both for
transmitting and receiving and only one device can be transmitting at a time. To avoid conflicts
(two devices trying to transmit at the same time), the Modbus protocol only allows the master
to initiate a request. After the master has finished transmitting, if the meter has received a valid
packet addressed for it, then the meter transmits its response.
Modbus Functions
In most cases, your Modbus software will automatically use the correct Modbus command for
any action you wish to perform, so you may be able to skip this section. The Modbus specifica-
tions list numerous possible commands, but the WattNode meter only supports the following:
●
03 (0x03) - Read Holding Registers:
Holding registers can be read and written and are
intended for configuration values, but the WattNode meter treats input registers and holding
registers interchangeably, so you can use functions 04 or 03 to read any registers.
●
04 (0x04) - Read Input Registers:
Input registers are generally read-only and report power,
energy, and related values. The WattNode meter treats input registers and holding registers
as interchangeable, so you can use functions 04 or 03 to read any registers.
●
06 (0x06) - Write Single Register:
This writes a new value to a single register.
●
16 (0x10) - Write Multiple Registers:
This writes a new value to a range of registers.
●
17 (0x11) - Report Slave ID
: This returns a packet containing an ASCII text identification
string. See the next section for details.
Other functions will result in Modbus exception
01 - Illegal Function Code
.
Measurement Overview
The WattNode meter performs measurements every one second. The measurements are used to
update three types of registers:
●
Energy registers
: These accumulate up (or sometimes down) based on the consumed
energy during each measurement period. Energy values are preserved across power failures.
●
Instantaneous registers
: These are non-accumulating values, like power, volts, current, etc.
These are not preserved across power failures.
●
Demand registers
: these accumulate data from each measurement, but the reported
demand values only update at the completion of a demand interval (or subinterval), which
is typically every 15 minutes. Only the peak demand values are preserved across power
failures.