APPLICATION NOTE

Why and When It Makes Sense to Integrate Modbus and Allen-Bradley ControlLogix and CompactLogix

Part 1 of 2

If Modbus were human, it would be collecting Social Security and shopping for a retirement home in Arizona. Most control engineers on today’s factory floors are now younger than Modbus technology.

Yet Modbus is still everywhere. There are hundreds of thousands of Modbus devices in factories around the world, and that isn’t going to change anytime soon.

All those Modbus devices generate valuable data and very often that data needs to be read by Allen-Bradley ControlLogix and CompactLogix PLCs. This article answers the most common questions about integrating Modbus data into A-B PLCs.

Key Definitions

EtherNet/IP – an implementation of the Common Industrial Protocol (CIP) on Ethernet.
Modbus RTU – a serial communication protocol for industrial automation using binary encoding and RS-485 wiring.
Modbus TCP – a version of Modbus with the same functionality as Modbus RTU but operating over Ethernet.
Gateway – a bridge device that connects industrial controllers with actuators and sensors, enabling data collection.
Serial RS-485 Communications – a serial communication standard for reliable communication in noisy environments.
Coils – the 1-bit memory locations in Modbus devices.
Registers – the 16-bit memory locations in Modbus devices.
Endianness – byte ordering. Big-endian orders bytes and words most significant first. Little-endian orders bytes and words least significant first.
Modbus Master – a Modbus RTU device that transmits requests to and receives responses from Modbus RTU slave devices.
Modbus Slave – a Modbus RTU device that receives requests from and sends responses to Modbus RTU master devices.
Modbus Client – a Modbus TCP device that transmits requests to and receives responses from Modbus TCP server devices.
Modbus Server – a Modbus TCP device that receives requests from and sends responses to Modbus TCP client devices.

Q1. What is Modbus RTU?

Modbus RTU is a serial industrial communication protocol used to read and write data from field devices such as sensors, instruments and drives. The essential features of Modbus RTU technology include:

  • RS-485 serial communication
    RS-485 defines the electrical characteristics of serial lines for use in serial communications systems. It is a form of serial communications for multi-point networks, allowing many devices (32 maximum) on one bus.
  • Request/response protocol
    A single Modbus master node sends individual read and write requests to one of up to 127 Modbus slave nodes. When a response is received, it sends the next request to the next node. Modbus slave nodes are silent until a request is received from the master device.
  • Continuous polling of slave devices
    The single Modbus master continually reads each Modbus slave device to get current data. The poll time for any slave device depends on the number of nodes and the serial baud rate. Slave devices cannot push data or send alarms except when polled by the master device.
  • Available Allen-Bradley PLC support for Modbus functionality
    While some Allen-Bradley PLCs have RS-485 communication ports, it is uncommon to find direct Modbus communication available on Allen-Bradley PLCs. More commonly, Modbus is supported on Allen-Bradley PLCs through AOIs, sample logic and third-party modules.

Q2. What Is Modbus TCP and How Is It Different from Modbus RTU?

Modbus TCP is a communication protocol that uses the same Modbus application protocol as Modbus RTU but transports messages over Ethernet using TCP/IP. The essentials of how Modbus RTU and Modbus TCP differ include:

  • Addressing, timing and wiring
    Modbus TCP operates over TCP/IP rather than serial RS-485. Addressing, message timing and wiring follow Ethernet standards instead of the serial RS-485 standard.
  • Node Addressing
    Modbus TCP devices are addressed by a TCP/IP address, unlike the limited number of node IDs on an RS-485 network. A Modbus TCP client can essentially communicate with an unlimited number of Modbus TCP server devices.
  • Multi-client support
    While Modbus RTU is limited to a single master device, Modbus TCP can support multiple clients. Technically, a Modbus TCP server device can communicate with more than one client, but that is an uncommon architecture. In systems with multiple Modbus TCP client devices, it is more common for each client to communicate with a unique set of Modbus TCP server devices.

Q3. How Is Data Structured in Modbus?

Modbus devices organize data into four areas, each with a maximum of 64K: Coils, Discrete Inputs, Input Registers and Holding Registers. The essential features of Modbus data storage include:

  • Four Modbus data storage areas
    • Coils (single-bit, read/write) for working bit storage
    • Discrete Inputs (single-bit, read-only) for input bit storage
    • Input Registers (16-bit, read-only) for data read from an external source
    • Holding Registers (16-bit, read/write) for working with unsigned integer storage
  • Two built-in data types
    Modbus data values are either single bits (coils) or unsigned 16-bit integers (registers). Devices sometimes overlay the register structure to form other data types. For example, four registers are sometimes combined and used to provide floating-point values.
  • Byte ordering using big-endian (most significant byte first)
    Endianness is the order of bytes in memory and is critical in both Modbus RTU and Modbus TCP. Big-endian (most significant byte first) is a common but not universal byte-ordering convention for Modbus. Though many Modbus devices support big-endian, always verify which endian your Modbus product supports.

Q4. Why Integrate Modbus Devices with Allen-Bradley PLCs?

Integration of Modbus devices such as sensors, meters, drives and others with ControlLogix and CompactLogix PLCs improves operational control, diagnostics and system visibility.

Modbus applications in plants today include legacy instruments, skid-mounted OEM equipment, power meters, drives, analyzers, scales, barcode readers and building and utility systems.

Integrating these devices is less expensive than replacing them. Removing them, replacing them with newer equipment and updating control systems is not only expensive, it generates no Return on Investment (ROI). Often, the downtime associated with “rip and replace” is prohibitive. Integrating them into today’s more advanced control systems with a protocol gateway is faster and less expensive, with little to no downtime.

Q5. How Does the Allen-Bradley Logix Data Structure Compare to Modbus?

The Allen-Bradley PLC data tag structure contains many more data types and data structures and is more user-friendly than the simple register/coil architecture of Modbus.

Compact and ControlLogix PLCs are decades more current than Modbus, and their data structures are more numerous and more sophisticated:

  • Allen-Bradley PLCs support a larger variety of data types than Modbus
    A-B controllers support string, floating-point, array, integer and other advanced data types.
  • Allen-Bradley PLCs use named tags while Modbus uses numeric registers/coils
    A-B PLC programmers name data with string tag names. This is completely different from Modbus, which uses integer values (1–65534) to identify registers and coils.
  • Modbus register values often contain more sophisticated types
    While Modbus data is stored in 16-bit unsigned integer registers, the actual data in these registers is sometimes a more sophisticated type. A Modbus register, for example, may contain a signed integer or decimal value. Two registers may form a double word, or four registers may contain a floating-point value. This is not the case for Allen-Bradley tags.
  • Allen-Bradley PLCs and Modbus use different systems for byte ordering
    Allen-Bradley PLCs use little-endian byte and word ordering (low byte/word first), while Modbus devices can use either big-endian (high byte/word first) or little-endian.

Summary

Modbus RTU and Modbus TCP remain widely used in industrial environments, particularly for legacy instruments, skid equipment and utility systems. Although Allen-Bradley ControlLogix and CompactLogix PLCs do not natively communicate with Modbus devices without additional logic or modules, Modbus data can be reliably integrated when its structure, timing, and byte ordering are properly understood.

Modbus RTU uses serial RS-485 communication with a single master polling multiple slave devices, which introduces timing and throughput limits that must be considered in PLC control strategies. Modbus TCP uses the same application protocol over Ethernet and TCP/IP, removing serial timing constraints and allowing more flexible network architectures, including multiple clients.

Modbus data is organized into coils and registers with limited native data types. Many devices encode higher-level data types, such as signed integers or floating-point values, across multiple registers. Successful integration requires careful attention to register context, scaling, and byte- and word -ordering differences between Modbus devices and Logix PLCs.

Your Next Step

Understanding how Modbus works is the first step. The next challenge is choosing the right integration architecture for implementing Modbus with ControlLogix and CompactLogix PLCs.

Read the companion article, How to Integrate Modbus Data into Allen-Bradley ControlLogix and CompactLogix PLCs, for detailed guidance on exchanging Modbus data with Logix PLCs, including:

  • How to map Modbus registers into ControlLogix and CompactLogix PLC tags
  • The options for integrating Modbus data into Logix PLCs
  • How to select a Modbus gateway
  • Commissioning times required to deploy a Modbus gateway
  • Common problems when integrating Modbus into ControlLogix and CompactLogix PLCs

About the Author

John S. Rinaldi
Real Time Automation, Inc.

John Rinaldi is Chief Strategist and Director of WOW! for Real Time Automation (RTA) in Pewaukee WI. With a focus on simplicity, support, expert consulting and tailoring for specific customer applications, RTA is meeting customer needs in applications worldwide. John is not only a recognized expert in industrial networks and an automation strategist but a speaker, blogger, the author of more than 100 articles on industrial networking and six books including Industrial Ethernet, OPC UA: The Basics, Modbus, OPC UA – The Everyman’s Guide and ETHERNET/IP.