I have a problem. I'm using Labview 2009 on a WinXP PC. I want to run two VIs simultaneously.
The first one is initializing two instruments using VISA. It is sending quite a few commands via serial and GPIB (Agilent 82350B PCI card). After initializing it's continuously reading the measured values.
The second one is reading and writing on the second serial port.
If I execute the first and second VI simultaneously, the Labview window is dead and I can't do anything (no error message). If I start the first one and after some time the second one it works perfectly.
My guess is that there are some problems when the first one extensively uses VISA and the second one also does. Can I avoid this somehow because it's not really convenient like it is at the moment, and I need to start both VI’s at any time.
Solved! Go to Solution.
sorry maybe I didn't make it very clear:
the first VI is using COM1 and GPIB the second one is using COM2. This should work, shouldn't it?
The reason why I'm makin 2 VIs is: First: if one crashes for same reason, the other one will still work. Second, the routines in the first one are quite slow, while the other ones are quick. Meaning that instrumentcontrol in the second one can react quicker than it would be the case if all are in one VI.
It is working if I run VI one and then start VI two, so I guess in principle I guess it should work.
Then it should work with no problems.
But the problem still exists. The funny thing is that I don't get an error message. The window is just dead.
Could you please post both VIs? Or at least break it down to a simple example?
Are you aware if it is in general possible to use both COM ports simultaneously on your PC at all (maybe a bad controller)?
What if you have both COMs and GPIB in use from a single VI?
hope this helps,
I've attached a zip file with the VI's. the two VI's that make problems are init.vi and Hubercontrol.vi. The init.vi is just sending the GPIB and serial (COM1) commands and Hubercontrol.vi is reading and writing on COM2.
I just set up Labview 2009 with the web install files two months ago. So it should be more or less the most recent version of Labview.
Don't know if it's a problem of the controller. It's onboeard serial ports. How can I check?
I used both COMs and GPIB in a single VI, and it worked perfectly, but it does not send simultaneously on both COMs
I can see in your code that you can optimize quite some things.
[...] I used both COMs and GPIB in a single VI, and it worked perfectly, but it does not send simultaneously on both COMs
Did you use the exact same approach there as you do in your current application?
Is there a reason why you are working with the native GPIB VIs instead of NI VISA?
I suggest you to improve your application in such a way that you do not open/close the interfaces (GPIB/serial) for every access. Please open them once at startup and keep using them until shutdown (remind: what about errorhandling?)
Additional note: You do not need the sequence structures.....nowhere!
hope this helps,
The both VIs I've uploaded have crash, althougn I've removed a few things.
Thanks a lot: If I don't close the GPIB interface everytime it works perfectly. Thanks.
No there is no special reason for the native GPIBs, I just use a few old VIs, from an older LV version, and din't check.