Índice
Toggle¿Qué son los protocolos Modbus RTU y Modbus TCP?
In the 1970s, the field of industrial automation was undergoing rapid development. The rapid development of the industry also brought some problems. At that time, different equipment manufacturers used different protocols, preventing their equipment from communicating with each other.
Para resolver este problema, se creó el protocolo Modbus. Se trata de un protocolo abierto y estandarizado que admite diversos tipos de datos y códigos de función para satisfacer distintas necesidades de comunicación. Protocolo Modbus tiene 3 tipos: ASCII, RTU y TCP.
Cuando el protocolo Modbus utiliza la transmisión por puerto serie, se pueden seleccionar los dos primeros tipos, pero es necesario comprobar los datos. Cuando se utiliza la transmisión Ethernet, se utiliza el tipo TCP, que no requiere sumas de comprobación. Modbus ASCII se utiliza con menos frecuencia debido a la ineficacia de la transmisión de datos utilizando principalmente códigos ASCII. Por el contrario, Modbus RTU y Modbus TCP son más adecuados para su uso en entornos industriales modernos que requieren una mayor eficiencia de transmisión. En este artículo, analizaremos estos dos protocolos, presentaremos sus principios de funcionamiento y escenarios de aplicación, y esperamos serle de utilidad.

Principio de comunicación Modbus
Modbus communication is the principle that it uses a master-slave communication mode. It means that there are master and slave devices, and the master device can initiate the transmission and then send a request to the slave device. The slave device cannot answer the request actively, but can only answer according to the request of the master device. The slave device then performs the requested operation and then sends a response to the master device. The master device receives the response and parses it, thus completing the communication process.
Un dispositivo maestro puede conectarse a uno o varios dispositivos esclavos al mismo tiempo, pero sólo puede haber un dispositivo maestro y un dispositivo esclavo en una comunicación. Si un dispositivo maestro se conecta a un dispositivo esclavo, se comunican entre sí en modo unicast. Sin embargo, si el dispositivo maestro está conectado a más de un dispositivo esclavo, es necesario seleccionar el modo de difusión para la comunicación.
Cómo funciona Modbus RTU

Modbus RTU supports a variety of electrical interfaces, such as RS-232, RS 485 and RS-422. It transmits data in binary form, and each byte contains two 4-bit hexadecimal numbers. RTU protocol commands consist of 5 parts: address code, function code, start address, data, and check code. For example, send instruction: 01 03 76 83 00 0C AE 6F, where 01 is the address code, on behalf of the slave address; 03 is the function code, which means “read”; 76 83 is the address of the register; 00 0C is the number of read registers; AE 6F represents the CRC checksum.
Modbus RTU Escenarios de aplicación
Because Modbus RTU is simple and stable in binary form for data transmission, it is very suitable for long-distance communication, difficult wiring scenarios, or scenarios with a wide distribution of devices. For example, industrial automation scenarios, small control systems, etc.
Principio de funcionamiento de Modbus TCP

Modbus TCP is created so that Modbus data can be transmitted on Ethernet, using the TCP502 port. Modbus TCP is based on Modbus RTU, plus the MBAP header. Since TCP is based on a reliable connection service, it no longer uses CRC checksums but relies on TCP’s own error detection and correction mechanisms. For example, send the command: 68 68 00 00 00 06 01 03 33 65 00 04. Among them, 68 68 is the message sequence number; 00 00 indicates that it is the Modbus TCP protocol is used; 00 06 indicates the number of subsequent bytes; 01 is the slave address; 03 is the function code; 33 65 indicates the register address; 00 04 is the number of registers.
Modbus TCP Escenarios de aplicación
Modbus TCP se utiliza a menudo en escenarios más complejos debido a su alta velocidad de transmisión y fiabilidad. Por ejemplo, grandes sistemas de control, sistemas de control de edificios, etc.
In practice, we need to consider whether to use the Modbus RTU or Modbus TCP protocol. If you have an existing network infrastructure and need to exchange large amounts of data with a fast response, TCP is a good choice. If you need simple, low-cost, long-distance communication, then using RTU is a wise choice.
Modbus RTU and Modbus TCP are like a pair of good friends; they each have their advantages, and together they help effective data exchange between devices. With the development of Industry 4.0, they will be integrated into more new technologies. Let’s look forward to the future; they will create more value for the development of industrial automation!
Agnes Wang is an IoT Solutions Specialist at IOTRouter, focusing on industrial IoT gateways, edge computing, and industrial automation solutions.
She specializes in industrial communication technologies, including Modbus, IEC 60870-5-104, MQTT, OPC UA, PLC integration, and remote monitoring applications. She contributes to technical articles and application guides covering industrial IoT solutions, protocol conversion, and edge computing.
- Agnes Wang
- Agnes Wang
- Agnes Wang
- Agnes Wang



