Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't labVIEW communicate simultaneously with all of my six RS 485 devices ?

Hi everyone,

 

i'm writing a VI that is able to read out 8 sensors from 6 devices connected by RS 485. I'm using the VISA subVI for that. 

 

My trouble is, the more devices I connect at the same time, the slower the 8 sensor readings are coming in. One device takes 5 seconds and all six take 18 seconds, when they really should take 5 seconds, too. It seems to me, that labVIEW, the way I use it, can only read and/or write one device at the time. Is there a why to make labVIEW faster ?

 

To be more exact about my diagram. I simply have open/write/read/close structure in a subVI which is called by a subVI that handles progression of the commands and the output strings. This subVI is called 6 times in a one while loop in my main program.

 

I experimented with putting all device-work flows in one sequence structure, but there it became very obvious that more devices slow down the "rhythm" of my VI. 

 

Any help is appreciated.

cheers

 

I attach the middle subVI

0 Kudos
Message 1 of 11
(5,415 Views)

What is it about LabVIEW that you think it can convert a serial bus to a parallel one? Where in the RS485 spec do you see simultaneous communication to different addresses?

 

If you want simultaneous communication to 6 different serial instruments, you need 6 different com ports.

0 Kudos
Message 2 of 11
(5,412 Views)

PI-Control wrote:To be more exact about my diagram. I simply have open/write/read/close structure in a subVI which is called by a subVI that handles progression of the commands and the output strings. This subVI is called 6 times in a one while loop in my main program.

You open/write/read/close each time you communicate?  That will wreak havoc on your performance.  You should open the port once at the start of the program and then close it once at the end.  You can read/write as much as you want in between.  Opening and closing ports repeatedly can really slow you down.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 11
(5,405 Views)

I do have 6 hardware COM ports, the program i attached is called 6 times from my main VI. 

 

 

0 Kudos
Message 4 of 11
(5,404 Views)

OK, I will try this tommorrow. thx

0 Kudos
Message 5 of 11
(5,402 Views)

You did not say that in your original post. Since RS485 supports multi-drop, when you posted a single VI, one could assume the single VI was talking to six different devices.

 

Since you are calling a single VI, have you made it reentrant? 

0 Kudos
Message 6 of 11
(5,400 Views)

Yep, I did made it reentrant. But just to make that clear, labVIEW can comunicate with more then one COM port at the same time, right ? So I guess my huge amount of closing and opening steps slows down my process ?

0 Kudos
Message 7 of 11
(5,396 Views)

@PI-Control wrote:

I do have 6 hardware COM ports, the program i attached is called 6 times from my main VI. 


But your code is just using 1 COM port (COM12 is the default).  It looks like you are just adding the address to the message.  This is consistant with a RS-485 bus.  You only have the 1 bus, but multiple drops that are addressable.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(5,380 Views)

@PI-Control wrote:

Yep, I did made it reentrant.


Since your code is so serialized, that doesn't matter.  You are just adding overhead by making it reentrant.


Nevermind, just noticed you were talking about the VI you just posted.  Is the subVI (RS232PS.vi) also reentrant?  If not, that would cause another bottleneck.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 11
(5,379 Views)

yep, both of them

 

thx for caring btw

0 Kudos
Message 10 of 11
(5,372 Views)