MODBUS – Glad You Asked!

I travel a lot. When you travel as much as I do, you tend to have habits – they allow you to just move through airports, hotels and rental car agencies with minimum thought. But every once in a while you have to do something new, something you haven’t done before, and it becomes a challenge because now you have to engage your mind. Last week, for example, I was on Southwest Airlines and I NEVER fly Southwest. So I didn’t know how all that worked. A quick set of answers to how to fly Southwest would have been helpful (I did manage to survive the experience anyway, though my seat mate spilled her drink on me).

I was thinking about this after a gentleman in Toronto says to me, “I have a weather vane and it speaks this weird protocol, Modbus, do you know anything about it?” I pulled my Modbus book, Modbus: The Everyman’s Guide to Modbus – Real Time Automation, out of my bag and gave him a free copy. But I thought, why don’t I have the set of Modbus questions that everyone wants to know? So I dug into my files and here’s some of what I found:

What is Modbus?
Modbus is the most pervasive communications protocol in industrial and building automation, and the most commonly available means of connecting automated electronic devices. Some might call it the grandfather of industrial networking. Modbus’ unconnected message and simple request-response communication structure is almost quaint in today’s “everything connected all the time” age. It’s nearly the same age as the first Programmable Logic Controller, the Modicon 084, which in those days was called a PC for “Programmable Controller.”

Modbus is an open standard. No one has to pay anything to build it into their equipment and there are no royalties. Modbus is widely used by many industrial device vendors operating in many different industries. Modbus typically transmits data from some kind of instrumentation to a programmable logic controller or a system for archiving data. For example, in the building automation industry, current temperature and humidity are often communicated to some long term storage. In SCADA (Supervisory Control and Data Acquisition) applications, Modbus is often used to connect a supervisory control computer with a remote terminal unit (RTU).

Why is Modbus Successful?
I think the answer is easy to understand. Modbus is very, very simple. It can be implemented quickly. It’s a universal standard that lots of devices can support without much effort or investment.

If you’re a small shop with expertise in vibration or flow, or some other technology, and need a way to communicate with your device, Modbus is the common denominator. These people typically aren’t network experts. They know nothing about system architectures and the networking strategies being implemented by their customers, so they’ll always just resort to a Modbus link to get some connectivity.

What does the RTU mean?
There are two kinds of serial Modbus: Modbus RTU (Remote Terminal Unit) and Modbus ASCII. Modbus ASCII is a relic of the old, very slow computers of the 1950s and 1960s. It relies on sending each byte as two ASCII characters. For example, a byte containing the hexadecimal value 2B (printable as the plus sign character) is transmitted as two bytes: one with hexadecimal value 32 (character ‘2’) and one with hexadecimal value 42 (character ‘B’). The RTU is the advanced version of this where all the characters are transmitted as their binary value: a 2B is transmitted in a single byte (hexadecimal 2B) to send the plus sign.

What does Modbus TCP mean?
Modbus TCP is the Ethernet version of Modbus.

How do I get started with Modbus?
There are many open source solutions and tool kit vendors like Real Time Automation that can provide the code to you. Here’s where you can find the RTA solutions: Modbus RTU Master and Slave, and Modbus TCP Master and Slave.

How does it compare to things like IO-Link, EtherNet/IP and ProfiNet IO?
Those communication protocols are all much higher speed with much more complex messaging instructions and more sophisticated data models. Modbus is the simple, easy-to-understand and use industrial protocol.

How can I use Modbus with an Allen–Bradley ControlLogix?
The Allen–Bradley ControlLogix family does not directly support Modbus communications. A gateway solution is your best bet:

  • The RTA Modbus RTU Master gateway connects a set of Modbus RTU slaves to a ControlLogix or CompactLogix
  • The RTA Modbus RTU Slave gateway makes your ControlLogix or CompactLogix look like a Modbus RTU Slave device
  • The RTA Modbus TCP Client gateway connects a set of Modbus TCP slaves to a ControlLogix or CompactLogix
  • The RTA Modbus TCP Server gateway makes your ControlLogix or CompactLogix look like a Modbus TCP Server

These questions are all general Modbus questions. Next time I’ll post questions on the protocol itself.

Attn: Our office is closed November 24-25 in observance of Thanksgiving. Orders placed after 2 pm CST 11/23/22 will be processed 11/28/22.