Modbus: Using Legacy Code to Solve
Modern Challenges
Overview
In December 1990, a world-renowned economist named Paul Zane Pilzer published a book titled “Unlimited Wealth.” Among other things, the book looked
at the ever-increasing role technology played in the business world and made a
number of projections about how technology would dominate business as time
went on.
During that discussion he coined a phrase – “The Technology Gap”, defined as the
gap between what is currently invented and available, and what is actually being
used in the market. As the speed of technological inventions increased, the gap
would widen and cause a number of difficulties for business – particularly for
industries like manufacturing that relied heavily on technology.
The challenge would be for companies to find a way to quickly – or even
permanently – span the “technology gap” so that they did not consume vast
resources on staying current within a whirlwind of new developments and
technologies.
Today's Technology Gap
Consider how the “technology gap” plays out within the industrial and
manufacturing sector. A production piece of equipment is purchased in the mid
1990’s. It has a 20-year functional lifespan and is designed to communicate with
the computers and PLC’s of the day.
Yet, within 5-years, CPU’s, networks, interfaces, software, DAQ components, and
other technologies have taken a massive leap ahead and changed – in some cases,
even down to the way they connect and communicate (ie, the advent of wireless
systems, USB, etc…). Suddenly a “technology gap” exists between the
production hardware and the operational controllers and communication lines.
Closing the Gap
In this scenario, it is readily apparent that, in order to stay competitive in the
market, the manufacturer has a significant need to upgrade their operational,
control, and communication components – but not necessarily their production
equipment. The problem is that, in many respects, the elements are no longer
designed to interact on friendly terms.
Fortunately, there is a sturdy bridge, which, at least for t the time being, appears to
present a permanent solution to the “technology gap” issue being faced by the
industrial sector.
The “Bridge” relies on two layers to ensure its strength:
- Software layer, consisting of Modbus and its various forms
- Hardware layer, consisting of RS-232 and RS-485 – the physical layers of
Modbus
For the time being, we’ll focus in on the Modbus software layer.
Introduction to Modbus: The Technology Gap Bridge
In late 1979, long before Mr. Pilzer was theorizing on the speed of technological
developments, Modicon, a small company out of California, had its engineers
develop a communication protocol that allowed programmable logic controllers
(PLC’s) to effectively communicate with factory and industrial equipment.
The Modbus protocol had several distinct advantages:
- First, it is thin, simple, and effective. It requires very little by way of
hardware to run it – thus saving valuable space and allowing for smaller, less
expensive electronic components.
- It is fairly simple to learn and program into new and existing hardware – thus
significantly reducing development and programming time for manufacturers
and end users. This feature allows a Modbus system to be implemented and
up and running within days – not months. Today, many Modbus modules are
actually plug-and-play, making installation virtually instantaneous
- Modbus typically utilizes RS-232 and RS-485 to physically connect to PLC’s,
I/O, and other hardware – connection ports that remain the standard on
today’s industrial equipment.
- Modbus is designed to move raw data, regardless of form or function. This
gives vendors enormous flexibility in development on their end, and greatly
minimizes data format restrictions.
- One final aspect of Modbus makes it very attractive: it is free. Early on,
Modicon opened the protocol to everyone and anyone who wanted it.
Even given these benefits, the success of Modbus, and its virtually universal
acceptance as the de facto industrial communication protocol, is somewhat of a
wonder. Today, it is reported that there are well over 7 million Modbus nodes in
North America and Europe alone, with thousands of different types of devices
utilizing it.
The far reach of Modbus has added yet another benefit to its utilization:
Interoperability. The simplicity of Modbus and the way it packages information,
enables it to effectively communicate with virtually any piece of industrial
equipment or operating system on the market today.
Three Transmission Modes
Over the years, Modbus has taken three primary variations or ways in which it can
package information. These three transmission modes are:
- ASCII (American Standard Code for Information Interchange) – The original
transmission mode has several advantages, the strongest of which is that all
data is sent and received in a format that humans can read. This relieved the
end user of the need of complex software converters and somewhat reduced
resources.
The drawback to this mode is what’s referred to as “bloat ware” because it
takes up a lot data space and is, compared to its binary counterpart, less
efficient.
The ASCII mode also utilizes the cyclic redundancy check (CRC) method to
verify that information is sent and received without errors. CRC tends to be
more time consuming and less effective than the longitudinal redundancy
check (LRC) method that is more widely used.
- RTU (Remote Terminal Unit) – As computer technology grew, so did the
world of binary communications – or sending data using only 1’s and 0’s. In
response, a second Modbus transmission mode was developed – RTU.
RTU is compact, faster, and utilizes LRC to verify the accuracy of
transmissions. Because of this, it is more widely used today than the ASCII
mode.
- TCP/IP (Transmission Control Protocol/Internet Protocol) – As will be
shown in a minute, TCP/IP mode allows the most flexibility, fastest data
transmission speeds, most powerful communication arrays, and highest level
of accuracy and reliability.
Modbus TCP/IP essentially allows data generated following the Modbus
protocol to be packaged within the TCP/IP protocol. Because TCP/IP is the
standard communication protocol for the Internet, Ethernet networks, and
intranet structures, this mode allows for unlimited communication and
interoperability options while still using legacy Modbus.
Modbus Network Configuration Considerations
Here are just a few technical details to consider when establishing a Modbus
network:
- Master-Slave – Modbus is a master-slave technology. This means that only
one device on the network can act as master, while the others act as slaves.
- Single, Multi, or Network – Modbus supports single, direct connections, or
multi-drop connections, or network configurations.
- Polling – Modbus does not “report by exception” but rather relies on schedule
polling to acquire data. Depending on the volume of data being transmitted
and the frequency at which information is needed, this could consume large
levels of bandwidth – a consideration in some industrial environments.
- Node Limits – Modbus is limited to 254 connections per master unit/system.
The exception to this is when TCP/IP mode is utilized because it makes the
ratio between master and device virtually unlimited.
- Contiguous Transmission – Modbus demands contiguous data transmission
as time and data gaps are translated into starts and stops of whole data
sections. This requires that all devices on the network be able to buffer data
and prevent gaps in transmission.
An Easy Solution to Modbus’ Own Technology Gap
There is, however, one area where Modbus is not interoperable: With itself. When
looking for converters, repeaters, or other components to utilize within a Modbus
environment, it is essential that all components on a given network utilize the
same transmission mode.
For example, a Modbus converter configured with ASCII will not communicate
with an RTU element on the network. Likewise RTU components will not speak
with ASCII systems.
TCP/IP elements are the exception to this, in that they will speak to either, but
require some type of Ethernet component to unwrap the TCP/IP packaging from
around the Modbus formatted data, before it is delivered to the Modbus system or
component.
Given Modbus’ inability to communicate with itself in different transmission
modes, several manufacturers have developed Modbus servers that seamlessly
manage traffic from all three modes and convert between ASCII/RTU and TCP/IP. (For an example of this type of module and how it is configured see Modbus Serial
Server model MES1A and MES1B).
Before leaving the subject of incompatibility, it should be noted that one other
scenario could create complications. Consider the situation when two pieces of
equipment operate with the same Modbus transmission mode (ie ASCII or RTU),
but have different physical layers (ie one has RS-232 and the other RS-485).
Even though the transmission mode is the same, these two pieces of equipment are
physically incompatible. This situation is readily solved with a wide array of
converters that allow you to seamlessly flow from an RS-232 connection to an RS-
485, and back again. (For examples, see Serial Converters).
Filling The Gap: Economic Advantages of Modbus
The real power behind Modbus is not in its ability to transmit data, but rather in its
ability to fill the technology gap. In turn, this translates into a number of solid
economical advantages that appear to be timeless. What this means is that,
regardless of where technology goes in the future, Modbus will continue to be an
economical and advantageous communication protocol to incorporate.
Here are just a few of the ways Modbus can be used to provide economic
advantages for manufacturing and industrial companies:
- Retention of Legacy Equipment – Because Modbus encapsulates and moves
raw data, it can facilitate communications between your legacy equipment and
the constant changing world of CPU’s, processors, modules, wireless systems,
PCL’s and other cutting-edge technologies.
The economic advantages here should be obvious: New technologies can be
incorporated and enjoyed without incurring the enormous costs of changing
out functioning and productive equipment.
- Integration of New Equipment and Systems – Just as Modbus allows for
the retention of legacy equipment, it also provides unlimited flexibility in
moving forward with new equipment and technologies. With Modbus TCP/IP
and today’s advanced Modbus plug-and-play modules, such as wireless
systems, servers, and converters, new technologies can be installed,
configured and brought online within hours.
This ensures ongoing productivity, equipment remaining current and up-todate,
low installation costs, and rapid repair/replacement of damaged or out
dated devices. It also allows greater flexibility in purchasing new equipment,
without the fear of running into compatibility issues.
- Distance and Remote Access – The introduction of Modbus TCP/IP and
Modbus wireless systems eliminates the need of having control units
physically close to all nodes and devices.
Through TCP/IP, data and systems can be monitored and controlled through
any Internet connection, anywhere in the world. This frees up managers,
engineers, and executives to travel as needed and perform their functions from
virtually any location. Additionally, it gives companies the power to centrally
control geographically diverse operations, creating a solid economics of scale
that can save countless dollars in purchasing duplicate systems performing the
same functions.
Wireless Modbus can eliminate wiring headaches, greatly simplify
installation, reconfiguration, and repairs, and extend your reach to over 20
miles. The savings in not running physical wires can drastically overshadow
the cost of converting to a wireless version of Modbus. (For more info on the
power and possibilities of wireless, see “Industrial Wireless: Solving Wiring
Issues by Unplugging“and Zlinx Wireless Modbus.)
- Free Protocol – And, of course, it goes without saying that because Modbus
is a free and open standard, it lowers the cost of development and
implementation on all ends. This means no licensing fees, upgrade fees, or
proprietary data to incur ongoing costs.
Overview of Modbus Converters and Modules
Because Modbus is so widely utilized in the industrial world, anything short of a
general overview of the different types of converters, modules and components
available is impossible. However, a quick summary may be helpful:
- Converters – Modbus converters come in two different types. First,
sometimes it is necessary to move data from one transmission mode to
another. This regularly occurs when going from RTU/ASCII to TCP/IP, and
sometimes, though less frequently, it is necessary to move from ASCII to
RTU and back. Converters facilitate this kind of data movement.
The second type of Modbus converters you will find is in the connection
world. While RS-232 and RS-485 remain the standard connection ports in the
industrial world, some PCL’s and computers have switched to USB ports. At
other times, it is necessary to connect one piece of equipment with RS-232 to
another with RS-485. Connection converters facilitate this, while preserving
the data structure and remaining compatible with Modbus. B&B offers a
number of Modbus compatible protocol converters. Our most popular serial
models are the 485DRCi, 485LDRC9, and 4WSD9OTB. USB Converters are
available in Panel, Inline, and DIN Rail Mounts. (For more details on USB
converters see “USB Converters – Essential Components for Today’s
Industrial Connections”.
- Servers – Modbus servers are, in a way, converters, but possess the added
ability to manage and direct traffic. Servers typically can be DIN rail
mounted or cabinet mounted, and typically serve as a conjunction point
between TCP/IP and ASCII/RTU traffic. In all cases they facilitate
management at a distance and simplify the setup of a Modbus network.
- Wireless – Modbus wireless components simply remove the wiring between
Modbus connections and extend the scope and reach of industrial companies.
- Modules and Sensors – Modbus enabled modules come in every shape, size
and functionality imaginable. Voltage sensors, thermo couplers, optosensors,
relays, and many, many more.
Summary
Because the Modbus protocol is so widely used, extremely adaptable in its
applications, and timeless in its usability, it serves as the perfect technology gap
bridge between legacy hardware, equipment, and modules, and today’s cutting
edge technologies.
In a way, it acts as a safeguard against the “technology gap”. An investment in
industrial equipment from 10 years ago… or the purchases being made this
month… will not be wasted due to rapidly advancing technologies. This fact
should give companies an added layer of confidence in moving forward.
Final Technical Note
At B&B Electronics, we recognize that the process of configuring and deploying
new and existing systems can be confusing, time consuming, expensive, and often
times very frustrating. Because of this we continue to offer complimentary
consultation services. Have a question? Simply pick up the phone and contact
one of our Application Engineers at (815) 433-5100. Additionally, you can log
onto our website at www.bb-elec.com and ask questions via our live chat. Our
team is happy to help point you in the right direction.
|