The Ten Most Important Questions (and Answers) on Modbus

10 questions and answers on Modbus

Modbus RTU will live forever. With its simplicity, ease of use, world-wide implementation, and small footprint, it is the easiest and fastest automation protocol to deploy. It’s very important for Control Engineers to understand this important technology even though it plays a minor role in most automation systems. There are ten important questions that every Control Engineer should be able to answer about Modbus. How many do you know?

  1. WHAT IS MODBUS RTU?

Modbus RTU is a communication protocol developed by Modicon in the early years of programmable controllers. Modbus RTU controllers transmit commands to end devices over old-style serial communications.

  1. WHO USES MODBUS RTU?

Modbus is often implemented in small, low-cost devices with small amounts of data. Temperature, pressure and other sensors with only one or two pieces of data often use Modbus because of its low cost and ease of use. [RTA has gateways to connect these devices to EtherNet/IP (Modbus to EtherNet/IP), PROFINET IO (Modbus to PROFINET IO), BACnet (Modbus to BACnet) and other kinds of networks.]

  1. HOW IS A MODBUS NETWORK ORGANIZED?

Modbus RTU networks use a single Modbus RTU Master device that communicates with up to 254 slave devices. Masters identify messages to specific slave devices by a unique slave ID that is transmitted as one of the first bytes of the Modbus command sent to the slave device.

  1. HOW ARE MODBUS SYSTEMS WIRED?

Modbus systems are usually wired using the RS-485 electrical standard. Unlike DeviceNet which uses CAN and EtherNet/IP which uses Ethernet, Modbus typically daisy-chains slave devices using 2-wire, differential signals. To suppress electrical noise, RS-485 uses a differential voltage between the two wires instead of a voltage based on a common.

  1. WHAT ARE THE MODBUS DATA TYPES?

Modbus has two data types: 16-bit unsigned integers and bit values. All registers are 16-bit unsigned integers. All coils are single binary bit data types.

  1. HOW IS DATA MODELED IN MODBUS?

Data is modeled as either 16-bit unsigned registers or single bit “coils.” There are two types of registers: input registers and holding registers. Input registers were originally designed for capturing analog signals while holding registers were designed to hold temporary values. Coils were designed to hold discrete values – both the status of points in the outside world and those driving physical coils in the real world.

  1. HOW ARE MODBUS COMMANDS STRUCTURED?

The structure of a Modbus request and a Modbus response is identical for all forms of Modbus messages. That structure begins with a byte indicating the function the Slave should perform and ends with the last byte of data in the message.

The general components of a Modbus message follow:

 

Function Code (FC)The Function Code identifies the request to the Modbus Slave. There are a large number of possible message requests, but about eight that are commonly used. These are the function codes that are detailed in this chapter.
Starting AddressThe Starting Address is the index into the coil or register data area in the Modbus device.
Bit LengthThe number of bits to read or write.
Word CountThe number of registers to read or write.
Byte CountThe number of data bytes of data included in the message request or response.
Response CodeThis byte indicates the successful completion of the message request. It is identical to the original message request.
  1. WHAT TRANSPORT LAYERS ARE USED WITH MODBUS?

You can use any transport you want. The message content is what makes a protocol that protocol. The Modbus message sequence is the Modbus message sequence whether you send it over Ethernet, RS-232, RS-485, or “sneakernet.” The transport is simply the mechanism you use to move a message from the sender to the receiver.

There are several standard transports/physical layers used to move Modbus protocol messages: RS-232, RS-485, and Ethernet. You can use OPC UA, MQTT, and others, but these are the common ones.

  1. WHAT ARE THE WEAKNESSES OF MODBUS?

Data modeling is the number one weakness of Modbus. Data does not exist only as 16-bit unsigned integers. Data comes in many varieties – signed integers, IEEE Floating point and many others. The other main weakness is the master/slave communications. That type of communication is extremely unresponsive in larger networks.

  1. WHAT IS MODBUS TCP

Modbus communication over Ethernet is known as Modbus TCP. Using Ethernet, Modbus TCP devices can be located miles away instead of hundreds of feet, and with the increased speed of Ethernet, there is much more bandwidth for sending many more messages. You can connect thousands of devices in a Modbus TCP network, not just the 32 like in RS-485, and you can also support multiple Masters, not just a single Master.

If you are looking for a short and entertaining book on the birth and history of Modbus technology and why it has flourished the way it has, my book, “Modbus: The Everyman’s Guide to Modbus is the solution. Providing a deep dive into Modbus technology, the book describes everything else you need to know about Modbus: including the Modbus Organization, certification, router technology, interfacing Modbus to IoT protocols like OPC UA and, most of all, why it will live forever.

This book is an important resource for those companies trying to manage the loss of a generation of engineers and technicians who grew up with Modbus and know the technology inside and out. This book can fill that knowledge gap for that next generation of engineers as they grab the keyboard from their predecessors.