05-28-2013 08:41 AM
05-28-2013 09:01 AM
You're closing the reference to the Notifier when you close the top loop and the bottom loop tries to use it. It's how you're closing your bottom loop, which isn't the best way to do it (but, NI uses it in their examples).
05-28-2013 09:02 AM
This is expected behaviour: after pressing Stop, the Wait on Notification in the lower loop fails because is trying to wait on a released notifier.
The error properly terminates the lower loop and is propagated to the Simpler Error Handler, where it causes the error message to appear.
As the lower loop is stopped only if an error occurs, either your vi doesn't stop at all, either you get an error message box.
05-28-2013 11:24 AM
Thank you all. I locate a local variable stop button and it solves the problem. No matter to loose data when closing that's why I close them at the same time. But of course when it is important to collect all data, this cannot be a solution.
05-28-2013 12:26 PM - edited 05-28-2013 12:27 PM
What I like to do instead is send a command to stop the consumer loop. In your case, you could have the "time" be "Stop" or something like that. When this command is received by the consumer, it can stop the loop on its own. Then after both loops have stopped (after the merge error), close the notifier.
If you were using a queue, this method would also make sure all of your data is properly written.