Modbus Peer-to-Peer

R

Thread Starter

Ron B.

I have 6 machines each with a proprietary controller which must poll the same pressure monitor (which uses Modbus RTU), to give each machine the same reading. I would like the 6 machines to operate as masters when polling so that they are independent of one another. I need some type of simple adapter using RS485 to enable this. Help.


 
A

Alex Pavloff

This has nothing to do with Modbus. What you want is some device to arbitrate the RS-485 bus to allow for multiple masters. However, I don't
know of any devices that do this and a search on google brings up no hits. Quite frankly, RS-485 is the wrong thing to use for this, as RS-485 assumes a single-master/multiple-slave system.

What other options do you have for communications?

Alex Pavloff
Software Engineer
Eason Technology
 
P
You can try configurating your pressure monitor to use Modbus Master RTU protocol to broadcast its reading to device 0 on function code 0x10. The 6 machines should be configured to use Modbus Slave RTU protocol. All 6 machines will receive the same information at the same time, and they should not respond to the broadcast.


[email protected]
http://www.ioserver.com/
 
F
RS-485 assumes nothing. It is the physical layer interface and does not imply any particular protocol or how it operates. There are protocols that operate on RS-485 in Peer-to-Peer and/or Master/Slave. Before you can make a statement like that, you have to know what protocol is being used. RS-485 is not necessarily wrong for this application. But you do have to be careful about ground loops, ground differentials, isolation etc.

Regards,

Fred Graham
Graham Controls Consulting
Specializing in LonWorks technology
www.grahamcontrols.com
770.887.9024 (voice)
770.216.1668 (fax)
[email protected]
 
T
Thinking about this, I think it can be done, provided you are prepared to tolerate collisions between the masters and can make some attempt to time synchronise the polling between the masters.

RS485 (2 wire) Masters will tristate their outputs when not transmitting, so the network can tolerate multi-master/single slave. By setting the timeout value in each master to different values, you could in effect implement a 'backoff on collision' strategy to spread the master transactions out, provided you can tolerate the fact that there are inevitably going to be
collisions and hence comms failures. The different timeouts will condition the time each master waits before retrying a transaction.

This also implies that your network scan period is large enough to allow plenty of space so that the masters tend to find a free slot. A tight scan
time won't work, as collisions will dominate proceedings.

You could even get really clever and read back, CAN style, what you transmit for comparison. If what's on the line isn't what was transmitted, you could stop transmission and back off for a timeout period. Would require considerable software work in the masters.

However this is going to be tricky, and not very flexible. The best solution is probably to use a single device effectively as a server to the slave, e.g. a Modbus master reading the slave data, then writing the value to the other devices (all Modbus slaves in this architecture). But how you go about this really depends on what level of flexibility you have in your overall system design and what comms options are available.

Tim Linnell (Eurotherm Ltd)

(All opinions expressed are my own)
 
Go to www.calta.com It is small company in Calgary Canada sell arbitrators for Modbus and AB, with this arbitrators you can connect 2 masters to single slave davice.

 
A

Alex Pavloff

> RS-485 assumes nothing. It is the physical layer interface and does not
> imply any particular protocol or how it operates. There are protocols
that
> operate on RS-485 in Peer-to-Peer and/or Master/Slave. Before you can
make
> a statement like that, you have to know what protocol is being used.
RS-485
> is not necessarily wrong for this application. But you do have to be
> careful about ground loops, ground differentials, isolation etc.

You right -- its possible, but its not easy (as Mr Linnell said). I somehow got it into my head that the guy was talking about two-wire 485, and the complexities of trying to setup a multi master system on that make my head spin.

B&B's excellent 422/485 guide at
http://www.bb-elec.com/tech_articles/rs422_485_app_note/table_of_contents.asp has a section on multi-master RS-485. Here it is, reproduced in its
entirety:

---
Multi-Master RS-485 Systems
Each node in a multi-master type RS-485 system can initiate its own transmission creating the potential for data collisions. This type system
requires the designer to implement a more sophisticated method of error detection, including methods such as line contention detection, acknowledgement of transmissions and a system for resending corrupted data.
---

In short, its not a system that can be set up without hardware/software that's designed to do it.

Alex Pavloff
Software Engineer <<-- GROUND LOOPS? ISOLATION? I'm a software person!
:)
Eason Technology
 
Top