Below is the list of the most important interview questions on Modbus:
- 1. What is Modbus and how does it work?
- 2. What are the different versions of the Modbus protocol?
- 3. What are the mediums used for Modbus communication?
- 4. What are master and slave in Modbus?
- 5. What are the basic settings required at the slave to enable Modbus RTU communication?
- 6. What is a slave ID?
- 7. What is a baud rate?
- 8. What is parity bit?
- 9. How many slaves can be connected to a Modbus master?
- 10. What does a typical Modbus data packet look like?
- 11. What are the various function codes?
- 12. What are the different registers in Modbus?
- 13. What is CRC?
- 14. What is LRC?
- 15. What is a Modbus Map?
- 16. What is Modbus TCP/IP?
- 17. What are the components of a Modbus TCP/IP data packet?
- 18. What is the MBAP header?
- 19. What is a PDU?
- 20. Structure of Modbus TCP/IP Application Data Unit (ADU)
- 21. How does the data transfer occur in TCP/IP?
- 22. Through which port is the Modbus data transmitter?
- 23. What is the difference between Modbus ASCII and Modbus RTU?
- 24. What is the maximum Modbus RTU communication?
- 25. RS 232 and RS 485 connections.
1. What is Modbus and how does it work?
Modbus is an application protocol that defines rules for organizing and interpreting data and is essentially a messaging structure that is independent of the underlying physical layer. It is an open-source protocol and is widely supported by many manufacturers. It was designed by Modicon. Data can be transmitted over serial lines (Modbus RTU) or via Ethernet (TCP/IP). These devices communicate using a master-slave technique. Only the master can initiate transactions and the slaves respond by supplying the requested data to the master, or by taking the action requested in the query.
The official Modbus specification can be found at http://www.modbus.org/
The data is sent as a series of bits. Each bit is sent as a voltage such that positive voltages stand for zero bits and negative voltages stand for one bit.
2. What are the different versions of the Modbus protocol?
- Modbus RTU
- Modbus ASCII
- Modbus TCP/IP
- Modbus Plus
3. What are the mediums used for Modbus communication?
- RS 232
- RS 485
- RS 422
4. What are master and slave in Modbus?
The Master is the device from which a request is sent for the execution of a function whereas the slave is the device that responds to the request made by the master. The slave processes the master’s requests and responds with the result.
5. What are the basic settings required at the slave to enable Modbus RTU communication?
The following are the necessary settings at the slave end to enable communication:
- Slave ID.
- Baud rate.
- Parity bit.
6. What is a slave ID?
Each slave device in the network is assigned a unique address. This address is referred to as the slave ID.
7. What is a baud rate?
Baud rate is the rate at which the signal is sent across the transmission medium per second. It is basically the transmission speed. Following are the possible baud rates in Modbus: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200bps.
8. What is parity bit?
The parity bit is an additional bit added to the transmitted message block, depending on the setting, either even or odd, it indicates the number of 1s in the transmitted message block.
- The parity is set to even, 1 is added to the end of the message block if there are an even number of 1-bits in the transmitted message block. 0 is added if there are an odd number of 1-bits.
- The parity is set to odd, and 1 is added to the end of the message block if there are an odd number of 1-bits in the transmitted message block. 0 is added if there are even number of 1-bits.
Learn more about parity bits: https://erg.abdn.ac.uk/users/gorry/eg3576/parity.html
9. How many slaves can be connected to a Modbus master?
The number of slaves that can be connected to a master varies for each communication medium. Below is the list:
|Medium||Number of slaves||Max devices (including master)|
|RS 232 + Bridge connection||247||248|
10. What does a typical Modbus data packet look like?
A Modbus data pocket or ADU (Application Data Unit) structure is shown below: