The "Four New Inventions of China", which are now popular all over the world, are deeply changing people's lives. Take shopping as an example. In the past, when buying things, we had to go shopping in the mall, first find a floor guide, then visit the corresponding counter, and then shop happily. After selecting the right items, we went through some bargaining, and finally paid to pick them up and leave. These were all common scenes. However, if one does not actually see anything, only sees photos online, and pays before seeing the merchant, and then waits for the item to be delivered to their home, these scenes would be unimaginable in the past, but they are achieved through a set of effective transaction rules, which is an agreement that all parties need to abide by.
Since shopping can be so convenient through a set of rules, can communication also be achieved? The answer is yes, because communication is data exchange, and it can also be facilitated by establishing a set of rules, which are communication protocols. The beginning of everything is difficult. Once you understand the protocol and communication protocol, MODBUS will explain half of it. Because MODBUS is a communication protocol, what kind of communication protocol is MODBUS?
As is well known, the rules of online shopping are designed to coordinate the relationships between buyers, sellers, and third-party platforms, specifying the rights and obligations of each party, and proposing some steps and methods required to complete transactions. Scenarios that come to mind directly, such as e-commerce companies displaying product and service content (buy, return, and exchange), online platforms (Taobao, Tmall) establishing transaction rules, and courier companies defining the method of transmitting goods (packages, delivery notes).
Similarly, the MODBUS communication protocol is designed to facilitate data exchange between controllers and devices. On the surface, it consists of many provisions similar to "user instructions", but in fact, it refers to several things: protocol functions, communication content, communication rules, and communication data format.
1) Communication function: The MODBUS communication protocol defines functions including reading, writing, and diagnosis. Imagine this: when you make a phone call to handle a certain business, the voice prompts you: Please enter the business you want to handle, press button 1 to query, 2 to recharge, 0 to provide manual service. Isn't this the function code!
2) Communication content: Just as e-commerce displays products for everyone to choose from, the MODBUS communication protocol defines communication content including hold registers, input registers, coils, etc. There are both small and large items in the product, and some can be returned or not. Some of these communication contents can be read and written, while others can only be read.

3) Communication rules: The MODBUS communication protocol uses a client/server mode for communication. You can see the analogy between this communication mode and online shopping in Figure 2. Obviously, the two clients cannot communicate directly because what can the two buyers do?

4) Communication data format: After online shopping, the seller will use logistics delivery. The courier company will not deliver the goods to the home like a restaurant waiter, but will use the form of a package to accurately deliver them according to the courier documents. This is the form of online shopping goods.
In order to achieve accurate data transmission, the MODBUS communication protocol also requires "packaging" and "express delivery". If the product is a hold register, then the packaging process is to package the value of the hold register with a function code to form a protocol data PDU (similar to a package); Labeling the goods with a delivery note means that the data PDU is addressed and error checked to form a complete communication data frame (application data ADU).

In summary, MODBUS is a communication protocol that includes the above four contents. In fact, some technologies in the industrial Internet are not particularly abstruse. You can find prototypes from life. Don't you think the MODBUS communication protocol can also be very popular and intuitive?
Leave a Reply