Interfacing Multiple Arduinos with MODBUS/HMI

Hello All,

I am in the process of developing a prototype that connects 4 Arduino boards to an HMI using MODBUS.

In the past I have built several small systems using Arduino and MODBUSslave library. There is a great tutorial I found by krak, but this is limited to only connecting a single HMI to a single Arduino.

Arduino MODBUSslave HMI Tutorial

I imagine that I can connect many more Arduino boards to the same HMI as long as they have unique device IDs. Hopefully, with some help I can get this to work. Before starting I was wondering if I could parallel all the TX/RX lines together into a TTL to RS232 (max232) converter. Then this converter has a cable that plugs into the HMI. Is this possible or do I need some termination resistors?

Also, is hardware flow control necessary? I have CTS/RTS pins closed and not currently being used. I am worried that these devices will not be able to talk simultaneously. In this case I would consider using RS485.

For what it's worth I am running at a low speed (9600 baud and 30 kb/s).

Any help is appreciated. Thanks!

For multiple devices on a given network, so that you have a multi-drop network you will need an interface such as TIA-485 (commonly known as RS-485).

Each device, be it slave or master will need its own TIA-485 interface to allow it to connect onto the two wire half-duplex differential network.

With Modbus, the master is the master and is the only device that will initiate communications to other devices, called slaves. Slaves will have their own unique Modbus network address.

Since the the mater initiates communications and waits for the requested slave to respond, there will be no data collisions as such. The Modbus protocol handles all the data transaction.

In each slave device, in your case, an Arduino, you will need to use a suitable Modbus RTU slave (server) library. If the master is also an Arduino, you will need to use the complimentary Modbus RTU master (client) library and define the data packets required from each slave device. If the master is an HMI or SCADA system, then configure it to use Modbus RTU protocol, again, configuring the required data from each slave.

Modbus does not use hardware flow control, so no need to worry about CTS or RTS, which are more for use with RS-232 type devices, such as modems and serial printers or other terminal equipment.

Hope this helps.

Paul - VK7KPA