09-09-2015 09:41 AM
I have a project that contains one main VI called Home Screen that calls many different sub vi's. I am monitering for a physical button press through a digital input with a DAQ Assistant on the main VI and when this is detected I want my program to abort all its running VI's and reset all the Digital outputs before closing Labview. Any idea how I would go about doing this?
I have attatched the basic model of what I am doing.
Solved! Go to Solution.
09-09-2015 09:59 AM
Use a Notifier, Event, or many Queues to send commands to your subVIs telling them to stop. Then you just reset your DIO as the last step of your cleanup and just close the front panels. There is no need for the Quit LabVIEW function.
09-09-2015 10:02 AM
Well first off I will say that the way you have your program set up, is not very good. for something like this you should be using a state machine arhitecture. With that being said, based on the picture that you show, all you would have to do is move the Quit LabVIEW function outside the while loop using dataflow for the order operation.
I do highly reccomend that you look at the training and examples.
09-09-2015 10:08 AM
The problem is more to do with some of my sub vi's running a DAQ Assistant using the same digital lines as the ones I am wanting to reset and causing it to throw up an error message. I thought that one solution would be to forcibly close the sub vi's that are running.
09-09-2015 10:23 AM
I should clarify that this is part of an emergency stop procedure. I require the program to stop everything it may be doing as soon as possible before resetting the DIO and quitting
09-09-2015 10:37 AM
@Joelspider33 wrote:
The problem is more to do with some of my sub vi's running a DAQ Assistant using the same digital lines as the ones I am wanting to reset and causing it to throw up an error message.
That is why you need to set the DIO AFTER all of the subVIs are stopped. And to do that, you need to send messages to those subVIs telling them to stop. When done properly, this is a very fast process.
09-10-2015 03:16 AM
Thankyou for your advice. I have used notifiers to shut down all current DIO operations and close the VI's. It is now working perfectly 🙂