07-16-2018 01:36 PM
Hey guys,
I've got three while loops, 2 of which are in series, running in parallel with the third, all nested in another while loop. I want the first loop in series to run, then the second, while the third is continuously running. Then repeat. My issue comes in when trying to create a master stop button. I've had success in doing so when using an event structure paired up with notifiers, but that doesn't work for my needs because then the big loop just sits and waits for the event structure to execute. I've attached one VI with the program without any attempt of mine at a master stop, and then one with. Hopefully you guys can help me out as I feel like I've hit a bit of a wall.
Here's a screenshot of my attempt as well:
Solved! Go to Solution.
07-16-2018 01:55 PM - edited 07-16-2018 01:58 PM
@Kai456 wrote:
Hey guys,
I've got three while loops, 2 of which are in series, running in parallel with the third,
Nope, the bottom loop is dependent on the queue reference coming from the loop on the right.
Scratch that. I just couldn't interpret the drawing with all the backwards wires and wires exiting from the wrong terminal of the subVIs.
07-16-2018 01:59 PM
Sorry. I need to work on organization. Any ideas?
07-16-2018 02:05 PM
Move the Event Structure into a loop that is in parallel with your main loop.
07-16-2018 02:39 PM
That makes more sense, but it's giving me an error that I can't figure out. Here's what I've changed:
And I get this error message when I try to stop it:
Could it be that I'm playing my grab notifier in the wrong place?
07-17-2018 07:39 AM
Do not close your Notifier until all potential readers are done. In other words, close the Notifier after your top loop as completed.
07-17-2018 11:19 AM
So far I've put he release inside of the main loop, tunneled into, but outside of the main loop, inside and outside of the event loop (just trying stuff at this point). How would I ensure that it is released when the main loop has stopped? I'm stumped.
07-17-2018 11:30 AM - edited 07-17-2018 11:36 AM
@Kai456 wrote:
How would I ensure that it is released when the main loop has stopped?
Do exactly what you did with your bottom loop in your last image. But instead, use the top loop. Wire the Notifier reference out from the Wait For Notification to a tunnel on the loop and to the Close Notifier.
07-17-2018 12:07 PM
I see. My mistake was thinking that it always had to come out of the Send Notifier vi (don't ask). The issue with this solution now though is that while it does terminate the loop, the program still resets and starts over when you hit stop!
07-17-2018 12:12 PM
It looks like the three loops receive the notification before the larger main one does? It has to iterate one more time before it sees the notification. Why is this?