annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

While loop does not exit and LabVIEW hangs

I have a while loop with an event handler inside.

When the OK button is pressed and the OK event is called, this sends a TRUE to the loop exit condition.

But sometimes (it's not consistent) at this point LabVIEW just 'stops' and it doesn't seem to exit the loop.

 

Although not in the picture below I placed a true/false case structure just before the loop exit with some debug to a file- so I know the data flow leaves the event handler and is on the wire that goes to the exit condition. But after the case structure everything just stops and the VI seems to go into no man's land.

 

CropperCapture[4].Png

 

There seem to be other problems like this on the forum, but I can't see anything that applies to my situation.

 

Is there a list of potential reasons why a loop won't exit or the VI will seem to just stop working?

 

Thanks,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Messaggio 1 di 12
5.939Visualizzazioni
Do you have parallel loops in your code? If so, are all the loops exiting? This sounds like a classic case of not propigating the exit to all running loops. If they don't all exit then you will be left in a state like the one you described. Beyond that it is hard to say what could be happening since we are only seeing a very small portion of the code.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Messaggio 2 di 12
5.935Visualizzazioni
Does it still hang when you disable the code (the "ESRT LOG TO FILE" vi) inside the OK Button case?
Richard






0 Kudos
Messaggio 3 di 12
5.915Visualizzazioni
I know I haven't given you much to work with - but there are no parallel loops, and the ESRT LOG TO FILE vi is there as a trace to try and debug the problem.
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Messaggio 4 di 12
5.902Visualizzazioni
Turn on Highlight Execution (Light Bulb on Block Diagram Window) and run it.
0 Kudos
Messaggio 5 di 12
5.899Visualizzazioni

Just as a test, I would wire the OK button directly to the Stop terminal and act on the True condition (rather than using the constant), and I'd read this.

Richard






0 Kudos
Messaggio 6 di 12
5.804Visualizzazioni

Additional to this points: If the issue persists, could you please post a detailed description with information about what exactly happens if the loop does not stop. And, if possible, attach the code to this post then.

 

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Messaggio 7 di 12
5.797Visualizzazioni

As Norbert mentionned, if you attach your code, we can run it and see if the same behavior occurs.

Or see why that behavior occurs.

0 Kudos
Messaggio 8 di 12
5.792Visualizzazioni

Thanks for all your comments and advice - I'll try them out. One thing I didn't mention was that this VI is being called from TestStand. When it (the VI) refuses to work - then it will never work again until I exit TestStand and begin again. Then all is well for a while.

 

I wondered if it had anything to do with a memory leak, so I'm looking carefully at that - but haven't seen anything yet.

 

Thanks again,

 

Ronnie

TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Messaggio 9 di 12
5.758Visualizzazioni

Hi Ronnie,

 

If you run the VI on it's own (instead of calling it from TestStand), do you see the same thing happening? Or does it only happen when called from TestStand?

0 Kudos
Messaggio 10 di 12
5.733Visualizzazioni