What is Modbus and How does it work?

Modbus is one of the most common communication protocols in industrial automation, in this post, I am going to share with you what is Modbus, the types of Modbus, its advantages of Modbus, when not to use it, and how to diagnose it.

What is ModBus communication protocol?

Modbus communication protocol is a serial communication protocol developed by Modicon® in 1979 for use with its programmable logic controllers (PLCs).

In simple terms, it is a method used for transmitting information over serial lines between electronic devices one being the master ( the one that initiates the communication) and the other the slave ( the one that responds to a communication).

How does Modbus work?

In a few words, this is how the Modbus protocol works. The Modbus protocol exchanges data using a request/response mechanism between a master and a slave.

The master/slave principle is a type of communication protocol in which a device (the master) controls one or more devices (the slaves).

What is ModBus communication protocol?

Why is Modbus so popular?

Modbus is popular among engineers and technicians because it is so easy to understand, you do not need to be a programmer to understand it.

I remember when I was providing training to new here I would tell them that Modbus RTU is very simple, connect A to A and B to B and everyone was able to wire it on the first day of class.

Is Modbus dead?

No Modbus is not dead, this is a myth It will continue to live on as there are millions of Modbus devices, and every day many of them are being built and implemented.

Is Modbus protocol industry-specific?

No, the Modbus protocol is not industry-specific and can be used in different types of industries such as factory automation, building automation, process control, oil & gas, traffic & parking, agriculture & irrigation, water & wastewater, pharmaceutical and medical, material handling, etc.

When should you not use Modbus?

Don’t use Modbus if you have a lot of data to transfer. The packets are limited to around 120 bytes maximum. Transferring 1K requires almost ten messages. It’s just not efficient for any kind of large data transfer.

What are the advantages of Modbus?

– Longer distances.

– Higher speeds.

– The possibility of multiple devices on a single multi-drop network.

Types of Modbus Communication Protocols

Several versions of the Modbus protocol exist for the serial port and Ethernet and the most common are:

– Modbus RTU

– Modbus ASCII

– Modbus TCP

– Modbus Plus

Modbus RTU (Remote Terminal Unit)

Modbus RTU is the most common implementation available for Modbus, it is used in serial communication and it makes use of a compact, binary representation of the data for protocol communication.

Modbus ASCII (American Standard Code for Information Interchange)

This is the type of Modbus that is used in serial communication and makes use of ASCII characters for protocol communication.

The ASCII format uses a longitudinal redundancy check checksum. Modbus ASCII messages are framed by a leading colon (‘:’) and trailing newline (CR/LF).

Modbus TCP/IP or Modbus TCP

This is the type of Modbus protocol that is used for communications over TCP/IP networks.

The Modbus data is wrapped around TCP/IP internet protocols and then the data is transmitted over standard internet.

Modbus Plus (Modbus+ or MB+)

Modbus Plus is a peer-to-peer protocol that runs at 1 MBS. The Modbus Plus protocol specifies the software layer as well as the hardware layer. This remains proprietary to SCHNEIDER ELECTRIC.

Modbus RTU

This is the most commonly used type of Modbus is industrial automation, let us answer a few questions about this type of Modbus.

What is a Modbus RTU?

Modbus RTU is an open serial protocol derived from the master/slave architecture (now client/server) originally developed by Modicon (now Schneider Electric). It is a widely accepted protocol due to its ease of use and reliability.

How many slaves can be connected in Modbus RTU?

Modbus RTU will support up to 247 slaves from addresses 1 to 247 – address 0 is reserved for broadcast messages.

What is the difference between Modbus RTU and Modbus TCP?

The main difference between MODBUS RTU and MODBUS TCP/IP is that MODBUS TCP/IP runs on an Ethernet physical layer, and Modbus RTU is a serial protocol.

Is Modbus RTU serial?

Yes, Modbus RTU is an open, serial (RS-232/422/485) protocol derived from the Master/Slave architecture.

What is Modbus RTU speed?

The majority of Modbus RTU devices only support speeds up to 38400 bits per second.

Modbus TCP IP

What is Modbus TCP/IP?

Modbus TCP/IP ( is simply the Modbus RTU protocol with a TCP interface that runs on Ethernet.

The Modbus messaging structure is the application protocol that defines the rules for organizing and interpreting the data independent of the data transmission medium.

What is the difference between Ethernet and Modbus TCP/IP?

The main difference between Ethernet and Modbus TCP/IP is that Modbus TCP/IP combines a physical network (Ethernet), with a networking standard (TCP/IP), and a standard method of representing data (Modbus as the application protocol).

Essentially, the Modbus TCP/IP message is simply a Modbus communication encapsulated in an Ethernet TCP/IP wrapper.

How to troubleshoot Modbus communication failure?

Troubleshooting Modbus failure can be the most difficult troubleshooting because it means that no activity is being recognized between the slave and master.

Basic Checks for No-response from slave error:

Check that communication settings parameters are correct

This is the most common error I found in many Modbus communication, you need to set the same baud rate in the master and the slave, also double check if the protocol selected is Modbus ( most field devices can communicate via different communication protocols.

Check that the slave’s address

If you have more than one field device, you need to assign them different addresses, most field devices come with a default address of 1, if you do not change it, you will have a duplicated address problem and this will cause a communication error.

Also, check on the controller side, the number of addresses on the datalogger should be equal to the number of field devices connected.

Check Modbus wiring

Just to be sure check your wiring, make sure there are no loose cables or open circuits, and also make sure that the cable distance is less than 2000 ft ( 660 meters).

Avoid using T-Taps, if you have more than one field device, you must daisy chain them.

Check for reversed polarity on RS485 lines

Wiring Modbus devices is simple, they have two terminals A and B, just wire A to another A and B to another B. But sometimes manufacturers will use different terminology (some use TX and RX),  If uncertain, just try swapping them.

Conclusion

That is it, in this post, we defined what is Modbus, and how it works and we answered a few common questions about the Modbus communication protocol.

If you have questions please feel free to let us know and will answer them as soon as we can.

Leave a Comment