From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 While Loops - not simultanous?

Hi!
Ich have 2 While-Loops, one big, with other loops and Case-Struktures and another small wich only executes a little SubVI.
Formerly LabView handled them simultanousily, so both of the loops were executed. But now it only executes the big one - i havent changed anything big on the structure.

What's wrong?
Zwitsch
0 Kudos
Message 1 of 10
(3,208 Views)
Hello,
Our lab has been looking at this issue as well. If you attach your code I can look at it see if I can see anything.

~Desmond Kaplan
0 Kudos
Message 2 of 10
(3,208 Views)
Your Lab?
Sorry, this week i cant submit the Code, is it possible to email it to you next monday?

Thx for ur answer!
Zwitsch
0 Kudos
Message 5 of 10
(3,208 Views)
A few simple things to check:

Make sure there is no data dependency between the loops.
Does the small loop execute once or never.
Does the subVI in the small loop *really* terminate?
(Does it show a green execute arrow of you "highlight execution".)
Put an indicator on the loop counter, initialized with default=-1. Does it ever show at least zero?
0 Kudos
Message 3 of 10
(3,208 Views)
Well, there is a data dependency, but it is not necessary, that data is transmitted.
The small loop is executet until the big one goes further in the Case-Strukture - then it hangs.
No, it doesnt terminate, there is this green arrow.

Im not that experienced in LabView, by the way...

Thx for ur answer.
Zwitsch
0 Kudos
Message 4 of 10
(3,208 Views)
The green arrow is usually when labview is inside of another subvi. Do uou have break points in another subvi that you may have forgotten about? Or something in another subvi that may be causing to "hang"

~Desmond Kaplan
0 Kudos
Message 6 of 10
(3,208 Views)
I dont think so, because i didnt changed anything in this bis loop.
None of my SubVi can hang, because they all r executed once, then the output is checked, and then it gets executed again.

I attach the code Monday, okay?

Tank you very much for you response.
Zwitsch
0 Kudos
Message 7 of 10
(3,208 Views)
LabVIEW uses dataflow programming for its code execution. This means that a process will never be allowed to go until it has received all of its inputs. This also means that parallel processes (like parallel loops) are executed in their own processor thread. One loop can hog the entire CPU processing time and make the other one execute slowly and sporadically. I suspect this is what you are seeing. The way to fix the problem is to add a delay with the wait (ms).vi or wait until next ms multiple inside of the loops. This causes LV to pause the loop and execute processes waiting (i.e. the other loop) for processor time. You can even make the wait zero ms to get this checking ability without unnecessarily slowing down your code.

To debug your code, I sug
gest using the highlight execution mode (the light bulb). This allows the programmer to see how the program is executing. This way you can check to see if the smaller loop is waiting for an input that never arrives.


Jeremy Braden
National Instruments
0 Kudos
Message 8 of 10
(3,208 Views)
Hi!
Thank you for your answer. I made what you'd suggested (i've put a wait.vi in the big loop and one in the small) but there's still this green arrow (highlight exec) on my SubVi in the small Loop.

What does it mean? There is NO datadependency.

Bye
Zwitsch
0 Kudos
Message 9 of 10
(3,208 Views)
The green arrow means that the subVI is processing. Double click on it and look at its block diagram with highlight execution mode to see what is holding up your program.

Jeremy Braden
National Instruments
0 Kudos
Message 10 of 10
(3,207 Views)