Meter interfaces

RS-485 vs Modbus vs RS-232

RS-485 is an electrical interface and Modbus is a protocol. What each one defines, how RS-232 and RS-422 compare with RS-485, and what to ask for before you connect a device.

RS-485 is an electrical standard. It defines the voltages on a twisted pair and how many devices can share it. Modbus is a protocol. It defines the requests and responses that travel over a connection. Modbus RTU often runs on RS-485, so the two names are used together. But a device with RS-485 terminals may speak a different protocol, and Modbus TCP runs over Ethernet with no RS-485 at all.

Where each setting belongs

Each setting you need to connect a device belongs to one layer, and each layer can fail on its own:

LayerWhat you needExample
PhysicalInterface, wiring mode and terminal namesRS-485, two-wire, terminals D+ and D− plus common
Serial settings and protocolProtocol, baud rate, parity, stop bits, addressModbus RTU, 9,600 baud, even parity, 1 stop bit, address 12
ApplicationRegisters and data formatTotal kWh at input register 0x0156, 32-bit float, high word first

Two products with RS-485 terminals cannot exchange data if one speaks Modbus RTU and the other speaks BACnet MS/TP. Two Modbus RTU devices can match on wiring and settings and still disagree on the registers, because each manufacturer defines its own register map.

What RS-485 defines

RS-485 (TIA/EIA-485-A) is a differential interface. Each signal travels on a pair of wires, and the receiver reads the difference between them. Noise from nearby cables adds to both wires equally, so the difference survives. The Texas Instruments overview (SLLA070) and unit-load note (SLLA166) give the limits that matter on site.

A receiver must read a difference of 200 mV or more correctly while each wire sits anywhere from −7 V to +12 V relative to its own ground. That common-mode range is what lets devices with different local earths share a bus. It only holds if the devices share a reference, which is why the Modbus serial guide includes a common conductor alongside the pair.

The load limit is 32 unit loads, not 32 devices. One unit load is about 12 kΩ. Many current transceivers are rated at 1/4 or 1/8 unit load, which allows 128 or 256 of them on one bus without a repeater. The Modbus serial guide still states 32 devices without a repeater, and the addresses stop at 247. On a metering bus the polling time usually runs out first.

Cable length falls as the data rate rises. TI's rule of thumb is that length in metres times data rate in bit/s should stay below 10⁸. A 500 m run can carry up to 200 kbit/s. A 1,200 m run at 19,200 baud gives about 2.3 × 10⁷, far below the limit, so at meter baud rates cable loss sets the length instead. TI gives about 1,200 m as the recommended maximum. The Modbus serial guide gives 1,000 m at 9,600 baud on AWG26 or thicker cable, halved if four-wire cable is used as two-wire, with stubs no longer than 20 m.

RS-485 runs half-duplex on one pair (two-wire) or full-duplex on two pairs (four-wire). It says nothing about the characters, the messages or the addresses. It also does not define the terminal letters. The Modbus guide names the conductors D0 and D1, but manufacturers label them A/B in both orders, or D+/D−, 485+/485− or TX+/TX−. Use the signal definition in each manual, not the printed letter. In the Modbus guide, D1 is the line that is more positive when the bus is idle, so a multimeter across the pair of an idle, biased bus shows which terminal is which. A swapped pair is one of the most common reasons a new bus gets no reply. The RS-485 wiring guide covers polarity, the common conductor, the 120 Ω termination at each end of the trunk and the bias that holds the idle bus in a known state.

What Modbus defines

The Modbus application protocol defines function codes (for example 03, read holding registers, and 04, read input registers), the data model of coils and registers, and exception responses. It runs over several transports:

VariantTransportFraming
Modbus RTUSerial line, usually RS-485Binary, with a 16-bit CRC
Modbus ASCIISerial lineHexadecimal characters, with an LRC
Modbus TCPTCP/IP over Ethernet, port 502A 7-byte MBAP header, no CRC

The Modbus serial guide adds the rules for RTU on a serial line. One master sends every request. Devices use addresses 1 to 247, and address 0 is a broadcast write that no device answers. Every character is 11 bits: a start bit, 8 data bits, a parity bit and a stop bit. Even parity is the required default. With no parity, the guide requires 2 stop bits to keep the 11 bits. Every device on the bus must use the same baud rate, parity and stop bits. A parity mismatch usually shows as no response or intermittent CRC errors, not as wrong values.

RTU has no start or end character. A frame ends when the line stays silent for 3.5 character times, and a gap of more than 1.5 character times inside a frame makes the receiver discard it. At 9,600 baud one character takes 1.15 ms, so the silent interval is about 4.0 ms. Above 19,200 baud the guide recommends fixed values of 1.75 ms and 750 µs instead. The Modbus RTU timing calculator works these out for any setting, and the Modbus TCP vs RTU guide compares the serial and network variants.

RS-232 vs RS-485

RS-232 is the older serial interface of PC COM ports and some meter configuration ports. The table compares it with RS-422 and RS-485:

RS-232RS-422RS-485
SignalSingle-ended, against groundDifferentialDifferential
DevicesOne transmitter, one receiverOne transmitter, up to 10 receiversUp to 32 unit loads, any of them may transmit
Cable length (TI guidance)About 20 m, set by a 2,500 pF load limitUp to 1,200 m at low data ratesUp to 1,200 m at low data rates
Typical useA laptop to one deviceOne-way links over distanceMulti-drop buses of meters and controllers

An RS-232 receiver switches at ±3 V relative to its own ground. A ground difference between two panels, or noise induced on the one signal wire, adds directly to that signal. An RS-485 receiver measures only the difference between two wires, which the same noise shifts equally. Use RS-485 for any link with more than one device, any cable longer than about 15 m to 20 m, or any cable that runs near power wiring. An RS-232 port on a meter is usually for configuration on the bench, not for a permanent network.

An RS-232 to RS-485 converter changes the electrical signal only. Both sides must still use the same protocol and serial settings. The converter also has to switch its RS-485 driver off in time for the reply. A converter that does this automatically is easier to set up than one controlled by the RTS line from software.

Other protocols on RS-485

RS-485 carries many protocols besides Modbus RTU. Modbus RTU is the usual protocol on submeters, power meters and plant controllers. In buildings and energy metering you will also meet these:

ProtocolWhere you find it
BACnet MS/TPHVAC controllers (see the BACnet/IP vs MS/TP guide)
DLMS/COSEMSome utility meters, though more of them expose it on an optical port (IEC 62056-21)
Vendor protocolsDrives, inverters and older meters

M-Bus is sometimes confused with these. It is a separate two-wire bus with its own physical layer (EN 13757-2), and it reaches an RS-485 or RS-232 port only through a level converter. The BACnet vs Modbus guide compares the building protocols.

One bus, one master

A Modbus RTU bus has one master that sends every request. The devices answer only when addressed. If a BMS already polls the meters on a bus, you cannot add a second master to the same pair. The two masters transmit over each other, and both see timeouts and CRC errors that come and go with their polling cycles. Choose one of these options:

  • read the data from the existing master, over its own network interface;
  • use a meter with a second communication port;
  • replace the bus master with one that serves both systems, for example through a Modbus TCP gateway.

A TCP gateway can accept several network clients, but it still sends one request at a time on the serial side. Each client adds to the polling cycle of the one bus. The protocol gateway guide explains the difference between a bridge and a translating gateway, and the commissioning guide works through a polling-time estimate for ten meters.

What to ask for before you connect

Collect this for every device before site work starts:

  • the physical interface, two-wire or four-wire, and the terminal names with their signal definitions;
  • the protocol, baud rate, parity, stop bits and the address;
  • the unit load of the transceiver, and whether the device has termination or bias, and whether it is switchable;
  • the register map for the exact model and firmware;
  • which system is the master today, if the device is already connected.

The Modbus register map guide covers the application layer. For a Modbus RTU meter that is far from the Gateway, a ZMB Modbus interface reads it on a short local bus and sends the registers over the Zigbee mesh to a Gateway running Edge.

Common questions

Is RS-485 the same as Modbus?

No. RS-485 is an electrical standard for the signal on a twisted pair. Modbus is a protocol for the requests and responses. Modbus RTU often runs on RS-485, but Modbus TCP needs no RS-485 at all, and RS-485 also carries BACnet MS/TP, DLMS/COSEM and vendor protocols.

What is the difference between RS-232 and RS-485?

RS-232 uses one signal wire per direction, measured against ground, and connects two devices. Its cable is limited by a 2,500 pF capacitive load, about 20 m. RS-485 uses a differential pair, connects up to 32 unit loads on one bus, and works up to about 1,200 m at the baud rates meters use. Its receiver needs only 200 mV between the two wires, and a ground offset between devices of up to −7 V to +12 V does not corrupt the data.

Can I connect an RS-232 device to an RS-485 bus?

Only through a converter, because the electrical signals are different. The converter must also switch its RS-485 driver between transmit and receive. Converters that switch automatically are simpler to set up than ones controlled by the RTS line, which can release the bus too early or too late for a reply.

What is Modbus RTU over RS-485?

Modbus RTU messages, in binary with a 16-bit CRC, sent as 11-bit serial characters over an RS-485 pair. One master polls the devices in turn by their address, from 1 to 247. Address 0 is a broadcast that no device answers.