MODBUS is the most popular industrial protocol being used today, for good reasons. It is simple, inexpensive, universal and easy to use. Even though MODBUS has been around since the past century nearly 30 years, almost all major industrial instrumentation and automation equipment vendors continue to support it in new products.
Although new analyzers, flowmeters and PLCs may have a wireless, Ethernet or fieldbus interface, MODBUS is still the protocol that most vendors choose to implement in new and old devices.
Another advantage of MODBUS is that it can run over virtually all communication media, including twisted pair wires, wireless, fiber optics, Ethernet, telephone modems, cell phones and microwave.
This means that a MODBUS connection can be established in a new or existing plant fairly easily. In fact, one growing application for MODBUS is providing digital communications in older plants, using existing twisted pair wiring.
In this article, we’ll examine how MODBUS works and look at a few clever ways that MODBUS can be used in new and legacy plants.
What is MODBUS?
MODBUS was developed by Modicon (now Schneider Electric) in 1979 as a means for communicating with many devices over a single twisted pair wire. The original scheme ran over RS232, but was adapted to run on RS485 to gain faster speed, longer distances and a true multi-drop network. MODBUS quickly became a de facto standard in the automation industry, and Modicon released it to the public as a royalty free protocol.
Today, MODBUS-IDA (www.MODBUS.org), the largest organized group of MODBUS users and vendors, continues to support the MODBUS protocol worldwide. MODBUS is a “master-slave” system, where the “master” communicates with one or multiple “slaves.” The master typically is a PLC (Programmable Logic Controller), PC, DCS (Distributed Control System) or RTU (Remote Terminal Unit).
MODBUS RTU slaves are often field devices, all of which connect to the network in a multidrop configuration, Figure 1.
When a MODBUS RTU master wants information from a device, the master sends a message that contains the device’s address, data it wants, and a checksum for error detection. Every other device on the network sees the message, but only the device that is addressed responds.
Slave devices on MODBUS networks cannot initiate communication; they can only respond. In other words, they speak only when spoken to. Some manufacturers are developing “hybrid” devices that act as MODBUS slaves, but also have “write capability,” thus making them pseudo-Masters at times.
- MODBUS ASCII
- MODBUS RTU
All MODBUS messages are sent in the same format. The only difference among the three MODBUS types is in how the messages are coded.
In MODBUS ASCII, all messages are coded in hexadecimal, using 4-bit ASCII characters. For every byte of information, two communication bytes are needed, twice as many as with MODBUS RTU or MODBUS/TCP.
Therefore, MODBUS ASCII is the slowest of the three protocols, but is suitable when telephone modem or radio (RF) links are used. This is because ASCII uses characters to delimit a message. Because of this delimiting of the message, any delays in the transmission medium will not cause the message to be misinterpreted by the receiving device.
This can be important when dealing with slow modems, cell phones, noisy connections, or other difficult transmission mediums.
In MODBUS RTU, data is coded in binary, and requires only one communication byte per data byte. This is ideal for use over RS232 or multi-drop RS485 networks, at speeds from 1,200 to 115Kbaud. The most common speeds are 9,600 and 19,200 baud. MODBUS RTU is the most widely used industrial protocol, so most of this paper will focus on MODBUS RTU basics and application considerations.
MODBUS/TCP is simply MODBUS over Ethernet. Instead of using device addresses to communicate with slave devices, IP addresses are used. With MODBUS/TCP, the MODBUS data is simply encapsulated inside a TCP/IP packet. Hence, any Ethernet network that supports TCP/IP should immediately support MODBUS/TCP.
More details regarding this version of MODBUS will be covered in a later section entitled “MODBUS Over Ethernet.”
To be continued…
Resource: Using MODBUS for Process Control and Automation – Moore Industries