LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to quit all sub vi's before resetting digital outputs then closing

Solved!
Go to solution

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.

0 Kudos
Message 1 of 7
(3,604 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(3,585 Views)

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.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 7
(3,581 Views)

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.

0 Kudos
Message 4 of 7
(3,572 Views)

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

0 Kudos
Message 5 of 7
(3,561 Views)
Solution
Accepted by topic author Joelspider33

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 7
(3,550 Views)

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 🙂

0 Kudos
Message 7 of 7
(3,497 Views)