Introduction to Modbus Protocol: A Comprehensive Guide

The Modbus protocol is a widely used communication protocol specification and is one of the earliest protocols applied in industrial fields.

Since the emergence of industrial serial links in 1979, the application of Modbus has become common, enabling communication between various automation devices. Friends engaged in embedded product development should be familiar with it, as Modbus can be seen everywhere. Moreover, in China, Modbus has formed standardized regulations, and corresponding national standard documents can be referenced.

Interested friends can refer to the standard documents:

GBT 19582.1-2008 Industrial Automation Network Specification Based on Modbus Protocol Part 1: Modbus Application Protocol
GBT 19582.2-2008 Industrial Automation Network Specification Based on Modbus Protocol Part 2: Implementation Guide for Modbus Protocol on Serial Links
GBT 19582.3-2008 Industrial Automation Network Specification Based on Modbus Protocol Part 3: Implementation Guide for Modbus Protocol on TCP/IP

Although there are standard documents that are easy to access, beginners and those who have never encountered Modbus may need to spend a considerable amount of time studying these national standard documents for development, which can be time-consuming and mentally taxing. Therefore, I would like to break down the Modbus protocol based on my experience using it in project development, explaining the important aspects of Modbus in an orderly manner to help everyone quickly understand the Modbus protocol and apply it in projects.

Key Question: What is Modbus?

Essentially, Modbus is an application layer messaging protocol that belongs to the application layer of the OSI model. It supports communication between devices on various types of buses and also supports applications over Ethernet. See the image below:

Introduction to Modbus Protocol: A Comprehensive GuideModbus implements a master/slave communication protocol structure on the device side, which is a request/response communication model. How to understand this? It means that in devices communicating using the Modbus protocol, one device acts as the master while the others act as slaves, and communication occurs between the master and the slaves. The schematic diagram is as follows:Introduction to Modbus Protocol: A Comprehensive GuideCommon Communication Links for Modbus

Modbus is widely applicable and can be used in almost any scenario that allows data exchange. When applying the Modbus protocol between devices, there are no restrictions on what type of physical link is used for data flow.

For example, commonly used wired methods include: EIA/TIA-232-E, EIA-422, EIA/TIA-485-A, fiber optics, network cables, etc. Many wireless methods are also available. The implementation is an asynchronous communication method on a serial link, allowing data to flow to one end of the device at a time, with no simultaneous flow at both ends. The Modbus communication stack is as follows:

Introduction to Modbus Protocol: A Comprehensive GuideCommon Technical Terms in Modbus Applications

When using Modbus, you often encounter some technical terms and English abbreviations, each with specific meanings and representations. Common abbreviations include:

ADU: Application Data UnitHDLC: High-Level Data Link ControlHMI: Human-Machine InterfaceIETF: Internet Engineering Task ForceI/O: Input/Output DeviceIP: Internet ProtocolMAC: Media Access ControlMB: MODBUS ProtocolMBAP: MODBUS Application ProtocolPDU: Protocol Data UnitPLC: Programmable Logic ControllerTCP: Transmission Control Protocol2W: Two-wire configuration defined in the "Electrical Interface" chapter, or one of the interfaces.4W: Four-wire configuration defined in the "Electrical Interface" chapter, or one of the interfaces.2W+2W: Special configuration using a four-wire interface in a two-wire system (refer to Schneider Electric Momentum document 870 USE 101 10 if needed).AUI: Attachment Unit InterfaceCommon Terminal: Common terminal in EIA/TIA standards (Common). In a two-wire or four-wire RS485 Modbus network, the common terminal for signals and optional power supply.Power Supply Common TerminalDCE: A Modbus device. For example, a programmable controller adapter implementing RS232 data circuit equipment (Data-Circuit Equipment). Also known as data communication equipment (Data Communication Equipment).Device: Modbus deviceDriver: Generator or transmitterDTE: A Modbus device. For example, a programmable terminal or PCITr: Physical bus interface on the trunk side (Interface on Trunk Side).IDv: Physical bus interface on the device side (Interface on Derivation Side).LT: Line Termination.Line Termination (Line Termination).Modbus: A device that implements the Modbus serial link and follows the technical specifications.RS232: EIA/TIA-232 standard.RS485: EIA/TIA-485 standard.RS485: Two-wire or four-wire network consistent with the Modbus technical standard.

Leave a Comment