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.
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?
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.
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"
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.
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.
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.
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.