I am working on a project that currently uses an RS-485 network with up to 32 slave devices connected back to a master PC. The system is running fine, but it could be better.
The only time the master needs data from a device is when a change in the device occurs which is as low as every 30-40 seconds but normally is in the range of 10-20 minutes. When the change occurs, I need to log that time the master. To do this I am having the master poll each device in succession continually and as fast as it can (worst case 3-4 seconds/device if a timeout occurs). Based on this, I could be logging event over a minute too late -not good.
Can anyone tell me how I can change my communication protocols so the slaves send data when it changes without first getting a request from the master? Like a slave only network? Does something like this already exist? I would bet so, but I haven't been able to find details about a reliable method of implementation.
I have have hardware in place and would like not change it if at all possible.
thanks
kevin
Yea I can to some extent, but I would still be pinging every device once every 20-30 seconds at best waiting for something that will occur once every 5-10 minutes on average. This systems would be much better if I can get the slaves to notify that master rather than the master ask the slave.
kevin
kebo:
Can anyone tell me how I can change my communication protocols so the slaves send data when it changes without first getting a request from the master? Like a slave only network? Does something like this already exist? I would bet so, but I haven't been able to find details about a reliable method of implementation.
There are a lot of different ways to handle this problem! Having a master communication controller and slaves that only respond to the master is one of the easiest ways to prevent collisions. Without that, you've got to figure out some way to prevent the nodes from talking over each other.
A token topology (only the machine that has received a token can talk/send a token) is another way to prevent collisions. You can also address this problem in hardware with dominant/recessive bits (like CAN Buses). There's also CSMA/CD but I think that one is really ugly, personally.
At the moment I have a similar project. I would prefere a Solution with dominant/recessive bits (like CAN Buses). The problem I have is that Serial and also SoftwareSerial doesen't read back the bits they send. But, if I have understand how CAN works, this is how to detect if any one else has started a message at the same time.
Is there a library for arduino that implemements a lightwight CAN-like protocol?
For hardware I found these modules [10pcx TJA1050 CAN communication module drive interface module / High Speed CAN Transceiver ](http://10pcx TJA1050 CAN communication module drive interface module / High Speed CAN Transceiver). I ordered some but until now they didn't arrive.