LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Run-Time Stopping weirdness

Hi,
I have a problem with a VI that i'm working on. Basically, my VI opens a VISA session and then enters a case structure, then runs a bunch of while loops that only stop once my STOP button is pressed. Once my STOP button is pressed, the VI should exit the while loops, then exit the case structure and close the VISA session.
However, my VISA session remains open (my instrument keeps running) and the VI doesn't close (the red stop button is still red) until I decide to press CTRL-E to look at the block diagram. At the instant that I press CTRL-E, the program decides to immediatly turn my instrument off and gray out the STOP button on the labview taskbar.

What's going on?

I tried closing my instrument within the while loops, and the instrument properly closes as soon as I press my STOP button... however, the VISA SESSION doesn't close, and you still have to either press CTRL-E to end the program, or press the Labview STOP button.

Thanks for your help!
Aleks.
0 Kudos
Message 1 of 4
(2,737 Views)
Hi Labuda,

A screenshot of your code might help out in this situation. What stop button are you using to stop your program? The abort button at the top of LabVIEW? Or a stop button you've added as a control on your front panel? Also, how are you stopping all of the loops with one stop button? Are you using local variables?

Again, a screenshot would be most helpful to allow us on the forums to help out with this.

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 2 of 4
(2,722 Views)
Hi,
Thanks for the reply.

I will not post a screen shot until i clean up my code... it's incomprehensible right now.

For now, I like to clear up that:

1. "my STOP" refers to a stop button i created. "labview STOP" refers to the red abort stop sign
2. Yes, I exit all the loops using a local variables of the STOP button.

However, the weird part is that labview finishes executing my code properly only when I look at the block diagram (CTRL-E). Until i do, i just hangs there, unless i press the labview STOP button, in which case the last part of code - outside the main case structure - doesn't execute, because its prematurely terminated.

Thanks,
Aleks.
0 Kudos
Message 3 of 4
(2,708 Views)
Hi Aleks,

Try to create a new VI. In the VI just have 3 or 4 while loops that are all stopped by one stop button using local variables like you currently are. See if you get the same problems. If so, let us know (and it will certainly be an odd situation). If not, we need to find out what is causing this issue in your current VI. It's very strange that the application stops just fine when you switch to the block diagram. Try this. Open your application and press ctrl+T to tile the windows side by side. Then run your application and try to stop it. See if this stops the application. Let us know what you find out.

Regards,
Matt S.

LabVIEW Integration Engineer with experience in LabVIEW Real-Time, LabVIEW FPGA, DAQ, Machine Vision, as well as C/C++. CLAD, working on CLD and CLA.
0 Kudos
Message 4 of 4
(2,689 Views)