How Modbus Communication Works

Follow+Star Public Account, don’t miss the wonderful contentHow Modbus Communication WorksAuthor | strongerHuangWeChat Public Account | Embedded ColumnLearning electronics requires mastering some common communication protocols, and Modbus is one of them. Modbus is widely used in real life, and it is basically present in many industrial electronic device systems.How Modbus Communication WorksToday, we will describe some common questions about Modbus for beginners.

What is Modbus?

Modbus is a communication protocol developed by Modicon (now Schneider) in 1979 for PLCs, primarily used for networking communication between industrial electronic devices.How Modbus Communication WorksModbus is an application layer communication protocol, located at the 7th layer of the OSI (Open Systems Interconnection) model.It provides client/server communication between devices connected on different types of buses or networks.Modbus consists of a Master and up to 247 Slaves in a communication network.For more information about Modbus, you can refer to:https://modbus.org/

What is Modbus used for?

Modbus is an open communication protocol that you can apply to your devices for free, without paying royalties.Modbus is a widely used standard communication protocol. If your devices from different manufacturers all adhere to the Modbus standard protocol, they can communicate and transmit data.

How does Modbus work?

Modbus typically communicates at the lower level based on UART serial 485. The simplest communication between a master device and a slave device is done through serial Tx and Rx for data transmission.How Modbus Communication WorksThe underlying serial communication is the familiar “0” and “1” communication. On this basis, adding the Modbus communication protocol facilitates protocol parsing and multi-device networking.In a master-slave configuration, each slave has a unique address, allowing the master to communicate with the corresponding slave by parsing the slave address.

What is Modbus ASCII?

Modbus ASCII is one of the transmission methods in the Modbus protocol, and there is another transmission method called Modbus RTU.After Schneider Electric acquired Modicon, they introduced the Modbus TCP protocol.How Modbus Communication WorksProtocol format:How Modbus Communication Works

What is a slave address?

A slave address (or slave station ID) is a unique address assigned to each slave device, facilitating identification during communication establishment by the master. The slave address is set at the factory.

What is a function code?

A function code is an item in the Modbus communication protocol, with the second byte sent by the master being the function code. This includes the read and write coil register contents you see.Here are some common function codes:How Modbus Communication Works

What is CRC?

Standard communication protocols generally have a checksum to ensure that the transmitted data is error-free.Checksums, CRC checks, etc., are common checksums in embedded device communication protocols.Modbus uses CRC cyclic redundancy check, with the checksum information located in the last two bytes of the message.Here is a recommended article to read: 《Custom Serial Communication Protocolfor related content in Chinese.Reference:http://www.simplymodbus.ca/crc.xls

What is word/byte ordering?

Byte ordering refers to whether the high byte or low byte is stored (transmitted) first. For example: 0x1234, it consists of two bytes, typically transmitted as 0x12 and 0x34.In communication, there is a byte ordering issue, but the Modbus specification does not precisely define how data is stored in registers.Since the Modbus standard protocol does not specify this, developers need to agree on whether to transmit the high byte or the low byte first during development.

Finally

Modbus is a widely used standard communication protocol. Students in industrial automation, electronics, and embedded systems are advised to take some time to learn it.Due to time constraints, this article only covers some basic content. For more introductions and specific details about the protocol, please visit the official website for in-depth understanding.https://modbus.org/(Public account does not support external links, please copy the link to your browser to open)

———— END ————

How Modbus Communication Works

●Column “Embedded Tools”

●Column “Embedded Development”

●Column “Keil Tutorial”

●Selected Tutorials from Embedded Column

Follow the public account and reply “Join Group” to join the technical exchange group according to the rules, reply “1024” to see more content.

How Modbus Communication Works

How Modbus Communication Works

Click “Read Original” to see more shares.

Leave a Comment