LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview crashes while VISA GPIB+serial send

Solved!
Go to solution
Highlighted

Hi,

 

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.

 

Thanks

0 Kudos
Message 1 of 10
(1,167 Views)
I think you cant simultaneously open mutliple session from the same port. Can you combine the vis since it going to get the same data keep the acquiring part similar and bundle the other functions to subvi running in parallel?
0 Kudos
Message 2 of 10
(1,160 Views)

Hi,

 

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.

 

Thanks

0 Kudos
Message 3 of 10
(1,155 Views)

 


the first VI is using COM1 and GPIB the second one is using COM2. This should work, shouldn't it?

 

Then it should work with no problems.

0 Kudos
Message 4 of 10
(1,152 Views)

Thanks!

 

But the problem still exists. The funny thing is that I don't get an error message. The window is just dead.

0 Kudos
Message 5 of 10
(1,138 Views)

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,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 10
(1,118 Views)
Any update?
0 Kudos
Message 7 of 10
(1,095 Views)

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

 

thanks
0 Kudos
Message 8 of 10
(1,088 Views)

I can see in your code that you can optimize quite some things.


johunger wrote:
[...] 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,

Norbert

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 10
(1,084 Views)
Solution
Accepted by topic author johunger

Thanks,

 

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.

 

Thanks again

J.

0 Kudos
Message 10 of 10
(1,079 Views)