LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 multidevice application design

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.

0 Kudos
Message 1 of 5
(2,614 Views)

@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

0 Kudos
Message 2 of 5
(2,594 Views)

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

0 Kudos
Message 3 of 5
(2,571 Views)

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

0 Kudos
Message 4 of 5
(2,561 Views)
And obviously, in order to say how you could improve your code, we would have to see it.
0 Kudos
Message 5 of 5
(2,556 Views)