
ModBus Protocol Implementation 2
1. NMID30-2 Smart Meter Modbus Protocol Implementation
1.1 Modbus Protocol Overview
This section provides basic information for interfacing the Smart meter to a Modbus Protocol network. If background information or more details of
the Smart implementation is required please refer to section 2 and 3 of this document.
RS485 is a bidirectional, full or half-duplex communication bus structure consisting of a single Master and at least one Slave. The maximum number
of slaves can vary widely from system to system however; most manufacturers cap the max number of slaves between 16 and 32. Most RS485
signals operate ideally on a DC bias of 5 volts. The signals are driven alternately from each other. That is, each line operates inversely from the other
and each is also referenced to the other from an electrical standpoint. The receiver looks at the difference, not the absolute voltage value, of the two
signals. This is referred to as the “Line Bias” and it is critical in RS-485 applications. A bias difference of higher than 0.3 v is generally accepted as
valid but can be as high as 0.7v, depending on the system. Absolute values below this are considered “undefined” or “grey” and may result in either
a high or low reading by the receiver. In many nonisolated applications, a “signal ground” or “shield” connection is provided in addition to the 2 data
lines however, this is not necessary as the signals are referenced to each other and not to absolute ground. It is only provided as a ground point for
the communication cable shielding. It is important to note that the shield ground should only be connected at a single trunk end in non-isolated
applications. If grounds are tied together in non-isolated systems, even a slight voltage difference, between the absolute ground points, will create a
“ground loop” condition which can cause serious damage to the equipment. Note that in isolated equipment, the above does not apply as there is
no direct connection between the ground points however, in all applications, proper cable shield grounding should be practiced to eliminate and/or
reduce electrical interference.
Our NMID30-2 offers the option of an RS485 communication facility for direct connection to SCADA or other communications systems using the
Modbus Protocol RTU salve protocol. The Modbus Protocol establishes the format for the master’s query by placing into it the device address, a
function code defining the requested action, any data to be sent, and an error checking field. The slave’s response message is also constructed
using Modbus Protocol. It contains fields confirming the action taken, any data to be returned, and an error-checking field. If an error occurs in
receipt of the message, the NMID30-2 will make no response. If the NMID30-2 is unable to perform the requested action, it will construct an error
message and send it as the response.
The electrical interface is 2-wire RS485, via 2 screw terminals. Connection should be made using twisted pair screened cable (Typically 22 gauge
Belden 8761 or equivalent). All “A” and “B” connections are daisy chained together. Line topology may or may not require terminating loads
depending on the type and length of cable used. Loop (ring) topology does not require any termination load. The impedance of the termination load
should match the impedance of the cable and be at both ends of the line. The cable should be terminated at each end with a 120 ohm (0.25 Watt
min.) resistor. A total maximum length of 3900 feet (1200 meters) is allowed for the RS485 network. A maximum of 32 electrical nodes can be
connected, including the controller. The address of each the NMID30-2 can be set to any value between 1 and 247. Broadcast mode (address 0) is
not supported.
The format for each byte in RTU mode is:
Coding System: 8-bit per byte
Data Format: 4 bytes (2 registers) per parameter.
Floating point format ( to IEEE 754)
Most significant register first (Default). The default may be changed if required -See Holding
Register “Register Order” parameter.
Error Check Field: 2 byte Cyclical Redundancy Check (CRC)
Framing: 1 start bit
8 data bits, least significant bit sent first
1 bit for even/odd parity (or no parity)
1 stop bit if parity is used; 1 or 2 bits if no parity
Data Coding
All data values in the NMID30-2 meter are transferred as 32 bit IEEE754 floating point numbers, (input and output) therefore each NMID30-2 meter
value is transferred using two Modbus Protocol registers. All register read requests and data write requests must specify an even number of
registers. Attempts to read/write an odd number of registers prompt the NMID30-2 to return a Modbus Protocol exception message. However, for
compatibility with some SCADA systems, the NMID30-2 will respond to any single input or holding register read with an instrument type specific
value. The NMID30-2 can transfer a maximum of 40 values in a single transaction; therefore the maximum number of registers requestable is 80.
Exceeding this limit prompts the NMID30-2 to generate an exception response.
Data transmission speed is selectable between 2400, 4800, 9600, 19200, 38400 baud.
1.2 Input register
Input registers are used to indicate the present values of the measured and calculated electrical quantities. Each parameter is held in two
consecutive16 bit register. The following table details the 3X register address, and the values of the address bytes within the message. A ( ) in the
column indicates that the parameter is valid for the particular wiring system. Any parameter with a cross (X) will return the value zero. Each parameter
is held in the 3X registers. Modbus Protocol function code 04 is used to access all parameters.
For example, to request: Amps 1 Start address =0006
No. of registers =0002
Amps 2 Start address =0008
No. of registers =0002
Each request for data must be restricted to 40 parameters or less. Exceeding the 40 parameter limit will cause a Modbus Protocol exception code to
be returned.
NMID30-2 _ Modbus
√