07-24-2012 01:37 PM
Hi - I'm hoping someone can help. I'm tryign to figure out the best architecture to use for an application, and I think notifiers will help, but I'm struggling to get it right.
Please see attached code.
I want a loop that can be started or stopped, controlled by an event structure. The loop does some processing. It can't be in the event structure, because I need to monitor the FP while the loop is processing. I thought sending a notifier would do it, but the problem is that once the loop is started, the notifier is never called again. There must be another way of acheiving this. Any ideas?
Many thanks,
Jon.
Solved! Go to Solution.
07-24-2012 01:44 PM
The problem is that the only way to get the while loop in the true case in the lower loop to stop is to hit the stop button. But if you do that, you are going to effectively stop your upper while loop as well.
How do you want to really stop that lower, inner while loop? You might want to eliminate that inner while loop. You can use the timeout function on the notifier to note whether a new notification has been received and if it has not, then detect that and rerun the true case structure again if true.
07-24-2012 02:57 PM - edited 07-24-2012 02:59 PM
use abort "notifier" to stop lower level processes(loop) and to time the process...
07-24-2012 04:15 PM
Many thanks guys - I have a nice solution now (attached), using the timout function on the get notifier.
Jon.
07-24-2012 05:11 PM - edited 07-24-2012 05:18 PM
looking at your vi...it is not properly shutting down, why your vi is doing what you want is because you are inducing an error to the bottom loop by not handling the user stop interface.
btw, my vi should have had the error tunnels merged outside the loops and the input error on the "dequeue element" connected.MY BAD!
07-24-2012 11:22 PM - edited 07-24-2012 11:24 PM
Apok,
Please don't use a 1 MB .gif image as your user icon. I'm sure that people who are trying to read the threads on their smart phones are probably hating you for that.
It also doesn't need to be 96 x 96 pixels. You should resize it to 36 x 36 pixels.
07-25-2012 11:41 AM
Hi Apok,
No, look at my vi again. By pressing Test you can turn the generation on and off. The Stop condition is also handled fine I think - it's OK to use an error, as long as it's handled properly.
Thanks for taking the time though - apprecated.
Jon.