02-04-2013 04:43 AM
Hi Community
I need your comments/help on How to correctly design an application to read multiple devices that are on a RS485 Line.
The application I'm doing now has 10 devices that are connected to the PC by rs485, all in the same line. They are all different and thus they use different protocols. Some I can use with modbus, other with ascii protocols, but I managed to do drivers for every one of them using ascii.
My main problem is that I can only query one device at once. For each one of them I need to send the message and wait for the response. and then I can query the next one, and so on, otherwise I get messed up data when reading the answers. This procedure may take some seconds to do a complete query to all devices.
The way I wam doing this is query each one in series for current status, and when i need to change the setpoint i'm using event structure to do it (when the user changes the setpoint, labview sends the command to the correspondent device).
My questions are:
-I'm I doing this the correct/best way? Any other suggestions on that?
-From your experience, is there a better way to do it?
-How to get more effeciency from it, better timing?
I hope you can discuss this with me.
Thank you.
02-04-2013 10:03 AM
@mgouveia wrote:
My main problem is that I can only query one device at once. For each one of them I need to send the message and wait for the response. and then I can query the next one, and so on, otherwise I get messed up data when reading the answers. This procedure may take some seconds to do a complete query to all devices.
That's the way it is with RS485: you can only have a conversation with one device at a time; otherwise, two or more devices may try to respond at the same time.
If it is taking too much time, maybe you could use more RS485 lines.
Albert
02-05-2013 04:48 PM
Ok, that goes on what I think about how RS485 communication works.
Still there should be good design ways to get better performance and efficency using multi devices in one line.
Any other sugestions? Please
02-05-2013 09:05 PM
My only suggestions are to get an additional RS485 port and split the load and make sure your code is as good as it can be. Make sure your baud rates are as high as possible. Maybe with two lines you could put devices that are capable of higher rates on one line and slower ones on the other.
Albert
02-05-2013 10:22 PM