03-07-2016 02:51 AM
Hello,
The desinging of my program is to control two analogue outputs, which range between postive and negative 10 that depend on the user from the input. After a google search the producer consumer architecture with events seemed like a great place to start. I then developed this program, with all requied functionality, however the problem I have is that the stop button will not work when entering the sub VIs within the program (see attached file). After another google search the use of a queued message handler was mentioned to be the best option due to the ability to be able to prioritise the tasks. However, I have swapped over the functionality, but seem to be stuck with the same issue regarding stopping the VIs when is operation (see attched file). Can anyone point me in the right direction using the priority functionality of a queued message handler?
Thank you!
03-07-2016 04:47 AM
When you press the Shutdown button, you need to send the Exit state, not whatever test is running.
03-07-2016 06:02 AM
Thanks for your reply!
The problem is not sending the exit state, it's interrupting the while loop within a sub vi during its operation, as therefore it won't shutdown untill the subvi has finished. Apologies for not making this clear. I have attached the full project so you can see what I mean.
Much appreciated!
03-07-2016 07:41 AM - edited 03-07-2016 07:41 AM
Ah, now I see it. The solution is actually quite simple. You should not have a loop in your subVI. Instead, you have the case enqueue itself. This way the same state will be called until another state gets put in the queue by the event loop.
03-07-2016 10:46 AM
Thanks for the help!
I am still not 100% as to what you mean regarding 'have the case enqueue itself'. I have made the additonal changes you attched in the image file. Also removing the while loops and replacing them with case structures. As for the next step I'm a little stumped.
Thanks again!