Two Modbus Slave with same Station Number


Thread Starter


The scenario is described as follows.

The Master send a query to one of the station number say 02. That slave would give a response to the Master and that response is also taken by the other slave having same station number 02 as a query from the Master. slave will now again give response to this query. Thus there is a conflict. Can any body please tell me what are the steps required on the slave side to detect and avoid such condition.

Thanks and regards

Jerry Miille

The only way I can think of, and this is predicated on specific hardware configurations and special software is as follows:

First, you need a connection that will allow each slave station to be able to "listen" to what it sends and also hear any other communication that "might" be happening on the network at the same time. There are probably other networks that fit this description but the most common one that I can think of would be a 2-wire RS-485 connection. In that type of connection, everyone can potentially "hear" EVERYTHING that anyone else is sending, and, THIS IS IMPORTANT, it can also hear itself talking. Many RS-485 driver/receiver circuit chips can't do this.

If you have hardware that can listen to what it sends, then you will need software to determine if there is a problem. You will need to have code that will compare the data that has been sent with data that has been received. If two or more Modbus Slaves respond to the same message, then the response will be garbled and the message sent will not match what is received.

Adjusting for delays in processing each serial character from each port will be a challenge. Maybe a fall back simple solution would be to simply look for errors like framing or parity errors to flag a potential problem. That leads to the following paragraph.

Why would you want to do this in the first place? If you have communication errors, particularly CRC or Parity errors from one or two addresses, then this could easily be the problem. This would be the case if there are just TWO addresses that don't work. In this case they are probably set to the same address and the response is garbled when communication is attempted to the common address and in the second case, there is no response at all. An examination of the error (CRC/BCC or No Response) should lead you to the problem.

In my experience, it is best to start off testing any new communication network with only two devices powered on. Once you have them working, add a third. If you are so lucky to have that one work as well then continue on, adding one at a time until you either find a problem or you are done. The last one added that causes an error has a problem!

Jerry Miille

Is it possible for you to change one of the slave station,so that, master will not detect the conflict.

Lynn August Linse

As a side note - if both devices are the SAME type and in theory the same inputs, then you can buy devices which treat one slave #2 as primary and suppress the second slave #2 response unless the first fails to reply.

Or you could allow the "master" to query a slave #2, but a device-in-the-middle can understand that the actual devices are #11 and #12, and give a single unified response. If this is what you want, say so and other community suggestions can flow.

If that is not what you want, then as everyone says you MUST change the address of one device to be unique. Otherwise most of the time both will reply in unison and cause line-contention & total loss of a valid response.