01-14-2014 11:56 AM
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
01-14-2014 12:09 PM - edited 01-14-2014 12:12 PM
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.
01-14-2014 12:37 PM
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.
01-14-2014 12:38 PM
I do have 6 hardware COM ports, the program i attached is called 6 times from my main VI.
01-14-2014 12:39 PM
OK, I will try this tommorrow. thx
01-14-2014 12:41 PM
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?
01-14-2014 12:45 PM
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 ?
01-14-2014 02:50 PM
@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.
01-14-2014 02:52 PM - edited 01-14-2014 03:07 PM
@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.
01-14-2014 03:11 PM
yep, both of them
thx for caring btw