ModBus RTU and ModBus TCP are the two main variants of the ModBus protocol. Traditionally, ModBus RTU (the RTU required to transmit information back to a ModBus master or SCADA HMI) has been used by many different types of devices. The ModBus RTU protocol is usually sent serially over RS485. This daisy-chain communication channel allows multiple devices to report to a single HMI port in a master-slave configuration. Each slave device is able to talk by sending traffic to the master device. This keeps the ModBus network structure fairly simple.
Table of Contents
Basic structure of all ModBus protocols What is the difference between ModBus RTU and ModBus TCP 1.Is RS-485 the same as Modbus? |
Related products (support Modbus):
LOW COST LoRa Module RS485 Long Range Wireless LoRa Modem Support Modbus-E95-DTU(400F30-485) | EBTYE OEM/ODM NB114 Long-distance and efficient Data Serial to Ethernet server-NB114 |
Transmission method: Use serial communication method, usually through RS-232 or RS-485 interface.
Data format: RTU uses binary encoding, which is a compact binary format with no gaps between each data byte.
Frame format: An RTU frame includes address, function code, data and CRC (Cyclic Redundancy Check) check.
Advantages: RTU mode has a higher data transfer rate than ASCII mode because it does not require character gaps to be inserted between bytes.
Transmission method: Using Ethernet communication based on TCP/IP, communication is carried out through a standard Ethernet connection.
Data format: TCP uses ASCII encoding to encapsulate Modbus RTU frames in TCP packets.
Frame format: Modbus TCP frame contains an MBAP header (Modbus Application Protocol Header) and RTU frame, which is transmitted through the TCP connection.
Advantages: TCP mode is more suitable for modern Ethernet networks than RTU because it allows communication over a wide area network and can be connected through standard Ethernet devices.
Basic structure of all ModBus protocols
Regardless of the variant, all standard ModBus communications follow the same messaging structure. Everything revolves around storing values in registers and then reading them. There are several data types at play here.
For example, discrete inputs can be stored as individual bits. More broadly, input registers store values collected by ModBus-based devices. Multiple discrete devices are stored as a single bit, while analog values or even ASCII characters may be stored in 8-bit registers (least significant bit is 0, most significant bit is 64 bits).
The different types of registers are categorized by the function code used to poll them. A "1" in the function code field is for "read coil" (checks the state of the control relay). "2" means "read discrete input" (check the state of the discrete input). "3" is "Read Holding Registers" (collect data from multipurpose read/write registers). There are many more in the ModBus specification. Registers are requested by their "start address", which is a 16-bit value that uniquely identifies each register in the device. Master requests to the RTU or other device will always refer to the desired registers to report on.
The main difference is that ModBus RTU uses a daisy-chain network, so you can connect the entire network with two wires and communicate with each device by giving each node a unique address. ModBus TCP uses a star network where each node has a separate cable called Cat5 or Cat6. They can be connected using a router. They also carry a personal address that is unique to each node on the network. The addresses can be from 1 to 255, which means that in theory, you could have 254 devices on the same network. You can also use ModBus TCP over the Internet.
EBYTE Modbus RTU IO Module Overview: MA01-AACX2240 (From the real evaluation of KOL)
The trend in 2023 is for more field devices to use ModBus RTU, but the ModBus TCP communication protocol is catching up. Pressure transmitters, flow meters and gas analyzers use ModBus RTU. PLCs, DCS and control room equipment use ModBus TCP. Some devices that communicate with web servers over the internet are using ModBus TCP. Input and output analog and digital modules are available on ModBus RTU and ModBus TCP.
Can the ModBus communication protocol be used as a low-cost solution?
For ModBus RTU protocol and ModBus TCP protocol, the answer is yes. ModBus RTU protocol application needs to read 4-20mA or 0-10 V input and display in PC or PLC device. Whereas with the ModBus TCP protocol, you only need an analog ModBus TCP card and connect it directly to a PC with a Cat5 or Cat6 cable using a crossover cable or through a router, and you can read the ModBus registers very quickly.
Whether using the ModBus RTU communication protocol or the ModBus TCP communication protocol, you will find it a simple and low-cost solution for your application. Depending on the size and complexity of the system, one can choose a protocol that better suits the user's needs, but both protocols provide excellent solutions for industrial automation applications.
RS-485 (Recommended Standard 485): RS-485 is a hardware standard for serial communication and specifies the electrical characteristics of drivers and receivers. It is a hardware specification, not a communications protocol. RS-485 can be used for various communication protocols, of which Modbus RTU is one of them. Modbus RTU is a serial communication protocol that typically utilizes the RS-485 physical layer for communication. RS-485 provides a way to transmit data between devices in industrial environments.
Ethernet is a widely used networking technology that uses a set of standards to enable communication between devices in a local area network (LAN). It operates on the data link layer and physical layer of the OSI model. Ethernet supports various communication protocols, among which Modbus TCP is one of them. Modbus TCP encapsulates Modbus RTU frames within TCP/IP packets, allowing the use of Modbus over Ethernet networks.
Modbus: Modbus is a communication protocol that defines a set of rules for organizing and interpreting data. It was originally developed for serial communication (Modbus RTU) but was later adapted for use on Ethernet (Modbus TCP). Modbus itself is a protocol that operates on different physical layers, including RS-485 and Ethernet.
Modbus TCP: Modbus TCP is an extension of the Modbus protocol that uses Transmission Control Protocol (TCP) for communication. It allows Modbus messages to be encapsulated in TCP/IP packets to achieve communication on an Ethernet network. While Modbus RTU is commonly used for serial communications, Modbus TCP is designed for use in Ethernet-based networks.