Rika Sensor is a weather sensor manufacturer and environmental monitoring solution provider with 10+ years of industry experience.

Industrial Control School: Interpretation of Modbus communication protocol [Yi Collection]

by:Rika Sensors     2021-12-14
Industrial Control School: Interpretation of Modbus communication protocol [Yi Collection]
As an industrial controller, Modbus communication protocol must be familiar to you. Modbus communication protocol can be said to be the most widely used communication protocol in the field of industrial automation. Because of its openness, scalability and standardization, it has become a general industrial standard.

In 1979, Schneider Electric developed a bus protocol Modbus protocol for industrial field. Nowadays, many RS485 communication occasions in the industry use Modbus protocol, so today we come to understand the Modbus communication protocol.

Modbus is a communication protocol developed by Modicon for its PLC communication. It is also the world's first bus protocol that is truly used in industrial fields. Modbus network is an industrial communication system, which is formed by connecting a programmable controller with an intelligent terminal and a computer through a public line or a local dedicated line. Its system structure includes both hardware and software. It can be applied to various data acquisition and process monitoring.

Modbus features:

(1) Standard and open, users can use the Modbus protocol for free and with confidence, without paying license fees, and will not infringe on intellectual property rights.

(2) Modbus can support a variety of electrical interfaces, such as RS-232, RS-485, etc., and can also be transmitted on various media, such as twisted pair, optical fiber, wireless, etc.

(3) Modbus frame format is simple, compact and easy to understand. It is easy for users to use and easy for manufacturers to develop.

Since its inception in 1979, it has become an industry standard in the field of industrial communication. The original Modbus only supports serial ports, which are divided into Rtu and ACSII signal transmission modes (usually based on RS485 serial communication media). As the times change, Modbus has a new TCP version, which can communicate via Ethernet. In addition, Modbus also has a ModbusPlus version dedicated to Modicon.

Modbus is a master/slave communication mode with a single master station. It consists of 1 substation and multiple slave stations, allowing multiple devices to communicate on the same network.

Introduction of three Modbus communication protocols:

ModbusTCP, Ethernet, RJ45.

ModbusRTU/ASCII, asynchronous serial communication, RS232/485/422, optical fiber, wireless

ModbusPlus, high-speed token passing network, coaxial cable or optical cable.

Among them, ModbusRTU and ModbusTCP are the most commonly used.

Signal transmission mode comparison

1. RTU and ASCII

1. ModbusASCII protocol has start and end tags, ModbusRTU does not.

This makes the processing of data packets in the ASCII protocol more convenient.

For example: the transmission interval between a data packet in the ASCII protocol can be as high as 1s (generally no more than 1s, more than 1s the receiving device considers it to be an error).

The RTU protocol stipulates that the sending or receiving time between every two bytes shall not exceed 3.5 times the character transmission time, otherwise it will be considered as the beginning of a new frame if the specified time is exceeded.

2. The ASCII protocol has strong readability and low transmission efficiency.

Because the ASCII protocol transmits all visible ASCII characters, the debugging stage will be more intuitive.

But this is also its disadvantage at the same time. The increase in readability brings about low communication transmission efficiency. For example, to transmit a hexadecimal number 0xF9, ASCII will transmit two characters 'F' and '9Complete the transfer.

As a communication protocol used in the industrial field, Modbus is mainly for skilled workers and engineers. It does not require strong readability. Instead, the amount of data transmitted is generally relatively large, so it is rarely used in the industrial field. Use ASCII protocol.

3. Different verification procedures

RTU uses CRC verification, while ASCII uses LRC verification. The LRC check procedure is simpler than the CRC check procedure. The two verification methods will be described in detail in subsequent articles.

2. TCP and Rtu

1. The concept is different: Modbus is a standard industrial control data exchange protocol. It can use RTU and ASCII for mutual transmission of protocol data. RTU uses binary data. The method transmits data directly, and TCP converts each byte of binary data into a fixed two-digit hexadecimal string, and then concatenates them in sequence to transmit data in the form of TCP code. Generally, the RTU method is the most used.

2. Different communication methods: Ethernet, the corresponding communication mode is ModbusTCP. Asynchronous serial transmission (various media such as wired RS-232-/422/485/; optical fiber, wireless, etc.), the corresponding communication mode is ModbusRtu or ModbusASCII. High-speed token passing network, the corresponding communication mode is ModbusPLUS.

Modbus function code

Custom message
Chat Online
Chat Online
Chat Online inputting...