Modbus RTU Communication

What is Modbus RTU?

Modbus protocol is widely used in manufacturing world. It is a serial-based protocol that supports the master-slave concept. In this protocol, the master initiates communication. The master sends a communication request message to the slave, and the slave processes this request and sends a response. Without the master’s request, the slave doesn’t provide a response or transmit data to other slave devices. Master initiates only one request at time.

To establish Modbus RTU communication, you need to know the following details of the slave device you want to communicate with using your PLC/HMI.

Modbus RTU Communication Example:

Now I want to communicate Proface HMI with Modicon 984 with Modbus RTU protocol.

Here Proface HMI is master and Modicon 984 PLC is slave.

Master Slave

1.Physical Layer-RS232/RS485/RS422

Check which physical layer is available on the slave device side- RS232 or RS422/RS485. RS422/RS485 supports both two-wire and four-wire connections. The same physical layer should also be available on your PLC or Master Device.

2. Wiring:

2.(a)RS232 Connection

Then prepare wiring Cable as shown in above figure. For wiring you need to refer pinout of both Master and Slave Device RS232 port.

2. (b)-RS485/RS422 4 wire connection

then Below cable connection required.

If Device Supports 2 Wire connection, then below connection required.

2.(c)-:Two wire connection -RS485

3.Parameters Setting is Modbus RTU

After wiring, confirm the parameter settings of the slave device and replicate the same settings on the master device as well.

  • Word Length:– Refer to the Slave Device manual once more and ensure that the word length is set the same on the Master Device, whether it’s 8 bits or 7 bits.
  • Baut rate:- Maintain the same communication speed for both the master and slave stations, ranging from 9600 to 256 KBPS.
  • Parity:- Whether it’s Even, Odd, or None, ensure that the parity setting is the same on both devices.
  • Stop Bit:-1 or 2

“Maintain uniformity in all the parameters mentioned above for both the master and slave stations. Once the wiring and parameters are rectified, proceed to verify communication. However, ensure accuracy in specifying the address of the slave device intended for reading or writing. For reference, consult the tables provided below for this crucial information.”

4:-Address Mapping in Modbus Devices

Function Code

Now if I want to read 40001 address of slave which is analog Output Holding Register Then use Function code 03 Hex while programming in PLC or HMI whichever is your master Device.

Leave a comment