Can Modbus Coexist Over RS485?

J

Thread Starter

Joe

Hello,

Can Modbus be used to communicate with devices on the same RS485 daisy chain as other devices which do not use Modbus? I have to connect a number of devices using RS485, one of which uses the Modbus protocol, while the others use custom communication protocols. Thanks.
 
Well, the Soviet Union and the USA managed to co-exist in a cold war for several decades without a nuclear holocaust, but it got a pretty hot in their proxy wars with lots of dead people and property destruction. I suspect your RS-485 network will be a version of Viet Nam - not a war, merely a 'police action' with lots of battle casualties.

Your 485 network will have no means of preventing two devices from attempting to transmit at the same time. When that happens, neither message will get through.

Depending on what the devices are and how often messaging is expected, there could be lucid moments when the Modbus master's query gets through and slave's response comes back.

But then there will be times when the master's query gets tangled up with another transmission so the slave never hears it, or the slave's response gets bonked by another device.

Use a different 485 link.

Maybe Mr. Miille has a device that can act as a traffic regulator.
 
Ethernet networks use "layered" protocols where the lower layers coordinate things to allow higher level multiple application level protocols to co-exist. There's nothing like that for RS-485. Hypothetically, you could design a custom protocol that wasn't Modbus but which could co-exist with Modbus (the same is probably true for some other protocols such as Profibus). However, there's nothing in your post to indicate that this is the case here.

A more practical problem however is what is the master that is going to be talking to these devices? With RS-485, generally one protocol driver "owns" the port. Would the master know how to "talk" both protocols? Again, Ethernet has special features to allow multiple protocols to share the same physical connection, but whether that is possible in your case cannot be determined from the information you've posted.

What it comes down to is:

1) What you would like to do is hypothetically possible under certain very special circumstances, but:

2) You *probably* will have to use separate RS-485 cables.
 
J

Jerry Miille

To start this conversation, Yes, it is "possible" to do this. Will it work reliably enough to make it a reliable solution is "iffy".

It depends on the protocols that are used and the ability of the "master" to handle errors and how well the slaves will recover from "bad" messages.

It is possible to do this, but it depends a great deal on the protocols involved. We have found that, "usually" there is an error when switching from one protocol to another but if you implement automatic retry, then the second request will "usually" work.

The ordering of the messages is important. You should keep all messages to one type of remote in order (send all of them first) and then switch and send all the messages to Remote Type 2 next.

This is a "sticky wicket" and should not be attempted if there is any critical control involved. But, it can work "good enough" depending on your application.

Jerry Miille
 
L

Lynn August Linse

I assume you are writing the "master code' for all? You won't likely find any commercial tools which support this.

This really depends on both the protocol & the Modbus slave.

A few protocols were explicitly designed to co-exist with Modbus - for example they might start with a fixed byte like '@' and include a Modbus-style CRC16, which means as long as you don't use Modbus slave #64, then all Modbus slaves ignore the alien protocol as 'not for me'.

The risk you run is the Modbus slaves get confused by the alien protocol and thus are not ready for you to poll them when their time comes - for example, they might still be waiting for some inter-char timeout and/or at least 5 bytes.
 
C

curt wuollet

It's a question of what the other devices do with the modbus messages. If they are ignored, and the other messages don't raise errors with the modbus slaves. it might work. I wouldn't bet on it.

Regards
cww
 
Thank you for all of the detailed responses, especially with the extra humor intermingled. That was exactly what I was looking for and was worried about.

I have no interest in trying to squeeze the two protocols together so I will just use another port. Much appreciated...

Joe
 
Top