| ??? 11/06/03 02:47 Read: times |
#57917 - RE: 485 advise, since there is 2 threads Responding to: ???'s previous message |
Shahzad,
regarding my comments on the multi master 485, yes, there is a possbilility that 10 devices might want to talk at the same time, and yes, it will create a major collision. If each device is listening to the data on the 485 bus whilst it is sending and it finds the data it sent isn't what it received we have a collision. therefore the device has to stop sending. At some time later, the packet can be resent. Ethernet uses a 'binary backoff algorithm' whereby the node backs off for a random amount of time before retrying. thus if all 10 devices try to send, they all backoff a differnet amount of time and then retry. Also, it pays to see that no one else is sending on the bus before trying to send something yourself. Another method is 'token passing' whereby a device sends it's packet, then sends a token packet to the next device to let it send and so on. the problem here is if one device fails - it can't hand on it's token therefore the system hangs. There are many means of handling this, say, if a device does not respond within a certain time, the next device assumes the token. Multi master comms a lot more trickier than single master, multiple slave comms. As I mentioned before. try www.modbus.com for a industry standard protocol. I use it for a lot of my devices as there is heaps of hardware and software that talk it. your application just has to fit the mould of 16 bit registers and bits which in most cases is perfectly adequate. See also www.wintech.com for s/w tools for you pc that talk modbus - MODSCAN is a very useful tool. MODBUS ASCII is the easiest to implement. Apart from MODBUS, there is many different protocols you can use or create yourself. just remember you'll have to write some tools to debug the comms. |



