LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My Code Gets Stuck in One Loop

Hey LabVIEWer's,

 

Sometimes when I try to run code with mulitple loops the code execution gets stuck in just one of the loops leaving the other loops to run once initially but then fail to run again unless I stop the code and restart.  Has anyone had any experience with this?  Does anyone have any advice?

 

I've attached an image of my code.

 

Thanks,

Mike

0 Kudos
Message 1 of 6
(3,522 Views)

Unfortunately, you don't really show the rest of the code, and it's kind of impossible to debug a picture. What are the termination conditions on the other loop. Is the other loop actually stopping, or is it waiting for something? Did you turn on highlighting to see whether you're stuck inside a subVI? You may have subVI dependencies so that the one loop is calling a subVI that eventually uses a subVI that is called by one of the VIs in the other loop. If you get stuck inside this subVI then the other loop as to wait, unless that subVI is reentrant.

Message 2 of 6
(3,510 Views)

To add to smercurio_fc, if all the loops have the same stop condition, why don't you create a shared variable (such as stop control) and wire it to the stop icon of all of the loops?

Message 3 of 6
(3,493 Views)

Thanks for the help guys.  I still can't figure out what's going on but I moved everything into a new VI and now I'm not having the same problem... so it's fixed I guess.

 

Thanks again,

Mike

0 Kudos
Message 4 of 6
(3,419 Views)

That sounds ... odd. I don't see how doing that would fix the problem. Are you sure you didn't do something else?

0 Kudos
Message 5 of 6
(3,401 Views)

Sounds like a race condition that "solved" through a recompile.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 6
(3,380 Views)