07-29-2018 04:35 PM
I have a sequence structure, in the first frame of which I create a queue. In the next frame, I wait 5 seconds, then in the frame after that, I enter into a loop of trying to de-queue an item, read it, and act on it. However, execution seems to halt after creating the queue. In the image I've attached, probe 14 executes, but probes 21, 20, and any other downstream probes are not executed. Weirder still, if I enable "highlight execution" at any time, either before running the VI or during execution, it starts working - execution continues down the line as expected.
Even *stranger* is the fact that this VI is a startup VI in a web service, and when I move it out of the web service and run it like a normal VI, it works fine.
This has really stumped me. I have only about a year's worth of (highschool internship) experience with LabVIEW, but I've never seen it behave this way even with vastly more complicated VIs and systems that span dozens of targets. Any help is greatly appreciated!
07-29-2018 06:45 PM
"Highlight Execution" slows everything down.
07-29-2018 07:17 PM
That's why I added the 5 second delay, thinking that for some reason the queue takes a little while to initialize, but that didn't work. It also doesn't make sense that I could run it, it would get stuck, then I could hit highlight execution and it would magically unstick.
07-30-2018 06:49 AM - edited 07-30-2018 06:50 AM
Sounds like a disconnect between what your BD says is your code and your compile cache thinks your code is.
Switching on debugging forces a recompile, so did you
1) have compiled code separated
2) have to switch on debugging in order to enable execution highlighting?
The other less exotic option is that you have a race condition which affects the code inside the sequence and prevents it from ever finishing.
07-30-2018 07:07 AM - edited 07-30-2018 07:08 AM
Your problem is most likely this guy:
He is a "greedy loop". He will use 100% of your CPU, likely preventing the rest of your code to execute. My recommendation is you put what is in that loop at the end of your main loop. This will eliminate local a local variable and only update the GUI when you complete an iteration.
Also, don't use the Abort button to stop your code. Add logic for stopping your loops so that you can gracefully shut down your application.
07-31-2018 02:07 PM
Also, Index Array is expandable, you only need one. Drag the bottom border down until you get 4 outputs. The top 3 will automatically be index 0, 1, and 2 without wiring any constants. Just wire a 12 to the bottom index.