09-10-2010 11:10 AM
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
09-10-2010 11:30 AM
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.
09-10-2010 11:55 AM
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?
09-15-2010 06:06 PM
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
09-15-2010 10:15 PM
That sounds ... odd. I don't see how doing that would fix the problem. Are you sure you didn't do something else?
09-16-2010 03:06 AM
Sounds like a race condition that "solved" through a recompile.