What is the communication protocol?

Communication is the communication between two or more parties, and a communication protocol is a communication method that two or more parties need to abide by. For example, it is now stipulated that two people need to use numbers to represent words. At present, only A means “I”,B means”you”, and C means “he”. Now one of the two people said A, and the other immediately knew to say It’s “I”, but if someone doesn’t speak according to the rules and says a D, then the other person doesn’t understand what he’s talking about. In this example, the defined representation of A,B,and c is a simple communication protocol.

General introduction

Modbus is a one-to-one communication method of one master and one slave (the host sends a frame, and the slave sends back one frame). Of course, it also has one master and multiple slaves, but it is actually one-to-one communication.
There is a slave responding.
If you need to communicate with multiple slaves at the same time,broadcast is also supported here,that is, the master sends commands, and all slaves receive commands and execute, but do not respond.

ASCII

ASCII is a character-based communication method,generally based on serial communication.
The message format is encoded in ASCII code, and consists of five parts: frame header (:) + Slave ID + data + LRC check + frame end(/r/n). But it is in ASCII encoding form, such as slave lD, when RTU is 01-byte,the ASCII representation is 3031 two bytes.
Therefore,Modbus/ASCII is rarely used in practical industrial applications because the communication efficiency is too low.
In addition, there is another difference from RTU, that is, the check used here is not the CRC check, but the LRC check.

RTU

RTU is a remote terminal control system,which refers to a communication form of Modbus. Communication is generally based on serial ports.
The message format is hexadecimal, and consists of three parts: Slave ID + data + CRC check. For the data part,please refer to the above message analysis. The rest is the data check, the CRC check (Cyclic Redundancy Check, CRC for short) is used here.
lt should be noted that in the data part, the high-order data is in the front and thelow-order data is in the back,while the CRC check is that the low-order data is in the frontand the high-order data is in the back.

TCP

TCP is a network protocol, and Modbus/TCP is an application layer protocol based on network protocols.
lts message format is hexadecimal, which consists of header (2-byte frame number +2-byte protocol type + 2-byte data length +1-byte slave lD) + data.
Since the communication method is based on a reliable protocol such as TCP/IP, no additional verification mechanism is required for communication.

Modbus Plus

Modbus Plus (also known as MB+) is a high-speed field bus network and a typical token bus network.