Modbus protocol is a widely used communication protocol for industrial automation systems, allowing communication between sensors, programmable logic controllers (PLCs), and computers. This article provides an in-depth introduction to the Modbus protocol and working principles as well as its suitable IoT scenarios to help choose suitable Modbus gateways.
What is Modbus protocol and how does it work?
A master-slave relationship is used to implement the request-response Modbus protocol. When two devices are involved in a master-slave relationship, communication always takes place in pairs. The initiating device (the master) is in charge of starting every contact. Normally, the slave is a sensor, programmable logic controller (PLC), or programmable automation controller, and the master is a human-machine interface (HMI) or Supervisory Control and Data Acquisition (SCADA) system (PAC).
The various protocol levels specify the requests and answers’ contents as well as the network layers through which these communications are transmitted. It outlines the message formats, function codes, data encoding, error checking, and other elements required for dependable device connection.
What kinds of devices support Modbus protocol?
The Modbus protocol is supported by a wide range of devices, including programmable logic controllers (PLCs), remote terminal units (RTUs), sensors, actuators, human-machine interfaces (HMIs), and many other types of devices in the industrial automation and process control sectors. Modbus is extensively used and has established itself as the de facto standard for interoperability between devices made by various manufacturers in sectors like manufacturing, energy, transportation, and building automation.
A Modbus gateway is a device that converts the communication protocols used by industrial automation system network hubs. It engages in conversation with the intelligent device, gathers data from the inferior device and transmits it to the Modbus gateway, establishes a connection with the advanced computer network, and engages in Modbus protocol with the network computer.
You may also be interested in What is a Modbus Gateway Converter in IIOT?
What variants of Modbus protocol are there?
The Modbus protocol is available in a number of variations. The decision of which Modbus protocol variation to adopt relies on the particular requirements of the application. Each variant has benefits and disadvantages of its own.
Modbus RTU and Modbus ASCII
The most popular version, Modbus RTU, is used for serial connections. A serial communication protocol called Modbus RTU transmits data using binary representation. It is the most extensively used Modbus variation and is employed in many automation and process control applications. Actually, Modbus RTU and Modbus ASCII are two different forms of serial connections for the Modbus protocol. Since they both use serial cables, Modbus RTU and Modbus ASCII are frequently referred to as Modbus RTU as a convenience.
A serial communication technology called Modbus ASCII transmits data using ASCII characters. It is used in applications that need data that can be read by humans but is less popular than Modbus RTU. The data is presented as readable ASCII when using Modbus ASCII.
While ASCII messages have the advantage of being simple for managers to monitor, binary messages provided via Modbus RTU are shorter and theoretically faster to send and receive. The absence of a start-of-text marker in Modbus RTU messages is a significant distinction for IoT developers. Instead, to identify the beginning of a new message, the receiving device in the transaction waits for a “silent” interval. There are start-of-text markers in ASCII messages.
Depending on the physical signalling protocol utilised, Modbus RTU can support up to 247 server devices but only one client device, and each unit needs its own port. A serial connection that uses a serial cable is simpler to set up than an Ethernet connection that requires installing software, a network card, and configuring an IP address.
Modbus TCP/IP
Industrial Ethernet protocols like Modbus TCP/IP employ TCP/IP at the transport layer. It is used to build a multipoint network that enables physical Ethernet layer communication between a single client device and several server devices. While using Modbus TCP, messages are encapsulated in TCP packets, which are subsequently encapsulated in IP packets, which are then sent through Ethernet electrical signalling.
While IP makes sure that communications are addressed and routed appropriately, TCP’s main job is to make sure packets are received correctly.
Modbus Ethernet connections come in two different varieties. Modbus TCP is a term that is frequently used to refer to both Modbus TCP and Modbus over TCP variations. Modbus over TCP is simply Modbus RTU packets wrapped in a TCP connection, whereas Modbus TCP is simply Modbus TCP packets. As it uses Ethernet, the latter is categorised with Modbus TCP even though technically it should be named Modbus RTU over TCP.
Although speed is frequently not a crucial requirement for the operation of many Modbus devices, such as reporting temperature, Ethernet connections are quicker than serial connections. Also, since data can be transmitted across greater distances, it is more dependable. Large-scale automated control systems and other situations requiring high-speed data transfer frequently employ it.
Unlike Modbus RTU, Modbus TCP permits several devices to use a single network port, and messages include a Modbus Application Protocol (MBAP) header, a 7-byte preamble. The Modbus Application Data Unit (ADU) utilised, which in turn specifies the transport protocol to employ, is identified by the MBAP header. Many client devices can be supported using Modbus TCP, which supports thousands of server devices connected at once.
Modbus Plus
Schneider Electric created the proprietary Modbus variation known as Modbus Plus with the goal of enabling high-speed communication over vast distances in sizable automation systems. Modbus protocol is merely a protocol, whereas Modbus Plus is an entire system with a first-layer physical layer and predetermined medium.
It is a LAN system for industrial control applications that enables networked devices to communicate with one another in order to manage and observe operations at distant points inside an industrial facility. Using a token-passing media access control method, Modbus Plus produces deterministic operation, however it isn’t always quick.
The messaging protocol used for Modbus Serial and Modbus/TCP is essentially the same as the messaging protocol used for Modbus Plus Layer 7. RS485 is used to implement the physical layer, which utilises shielded twisted pair cables. The Data Link Layer (Layer 2) protocol is based on the HDLC (High-level Data Link Control) multipoint ISO/IEC 3309:1991 standard, which uses a token-passing media access control mechanism and sends data synchronously in contrast to Modbus Serial, which transfers data asynchronously. Data is transferred at 1 Mbps as a result. Modbus Plus, in contrast to Modbus, is a proprietary standard created to get beyond the “single master” restriction present in Modbus Serial.
Here, we use a table to illustrate the similarities and differences between Modbus RTU, Modbus TCP, and Modbus Plus:
Feature | Modbus RTU | Modbus TCP | Modbus Plus |
Communication Medium | Serial | Ethernet | Proprietary |
Transmission Format | Binary | ASCII or Binary | Proprietary |
Data Transfer Speed | Up to 115.2 kbps | Up to 100 Mbps | Up to 10 Mbps |
Max Distance | 1.2 km | Dependent on network | Up to 3 km |
Max Devices | 247 | Dependent on network | Up to 32,000 |
Error Detection | CRC | TCP checksum | Proprietary |
Network Topology | Master-Slave | Client-Server | Peer-to-Peer or Bus |
Real-Time Capability | No | No | Yes |
What can a Modbus gateway be used for?
The Dusun DSGW-081 Modbus Gateway provides machines with continuous connection to the Internet using well-liked 3G/4G wireless networks and a selection of Internet services. features robust wireless connectivity, solid security safeguards, and edge computing capabilities. Due to the modular design of each wireless module, customers may choose the optimal configuration for their particular requirements, increasing productivity and lowering expenses.
Using DSGW-081, you can do powerful edge computing. Bottlenecks in cloud-end computing are eliminated, and data flow between field sites and data centres is significantly reduced. Furthermore, it achieves data optimisation, real-time response, flexible connectivity, and intelligent analysis on the IoT edge.
First created for PLC gateways and used in industrial production applications, the Modbus protocol. The Modbus protocol is utilised in practically every industry today, including petroleum and natural gas, telecommunications, cloud services, telemedicine, smart homes, agriculture, electric car production, smart factories, and more, thanks to the growth of IoT gateway.
Companies that offer system integration services to these industries and others that have a high number of connected devices, such data centres and edge computing, also use the Modbus protocol. IoT gateways that control other Modbus devices allow IoT devices that implement the Modbus protocol to connect to those devices. By enabling secure P2P connections across the Internet, this link lowers the need for firewalls and VPNs while enhancing speed.
Dusun IoT has long invested in the study and creation of IoT gateways and the Modbus protocol. We provide several IIoT Modbus gateways. Dusun IoT will fervently tailor an IoT solution if you use the online form or the online chat option to discuss your special circumstances and requirements.
Modbus protocol FAQs
Is Modbus 232 or 485?
When RS485 connection is implemented, the Modbus protocol is frequently utilised. By contrast, RS485 differs from the RS232 standard, which uses ASCII characters for transmission. If you want to work with RS485-compatible devices, it is crucial that you comprehend Modbus.
How many wires is Modbus?
A minimum of three conductors, although shielded two conductor wire may be utilised if the shield is employed as the common conductor. There must be at least three conductors if shielded cable is not used.
Can Ethernet IP and Modbus coexist on the same network?
The short answer is yes, the protocols work together. You can use a variety of protocols as long as everyone adheres to the Ethernet standard. TCP, MODBUS, and other protocols may be carried via IP.
What is the difference between BACnet and Modbus?
Client-server architecture is used by the open standard known as BACnet, which was created by ASHRAE. Modicon created the open protocol known as Modbus, which employs a master-slave design.
You may also be interested in What is a BACnet Gateway and BACnet Router in IoT Application?