LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop VI that was called by reference

Hi,
 
I have the following problem: I have a main-VI that is starting a sub-VI using the "Open VI Reference" and an invoke node to start a VI. The option "Wait for end of VI" is set to false. Is there a possibility to automatically stop the sub-VI, when the main-VI is stopped? Or do I have to give the sub-VI a reference to a boolean variable, that shows, if the main-VI is running.
 
Regards,
 
Frank
0 Kudos
Message 1 of 3
(2,397 Views)
Hi Frank,
 
you can use the AbortVI Invoke node to stop the execution of a VI. Be aware this will be an immediate stop and the VI has no chance to do any cleanup tasks. Otherwise you need any synchronisation mechanism (occurence, notifier, queue) to inform your Sub-VI to stop.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 3
(2,391 Views)
A good way to do this is through a synchronization mechanism like queue, here you can pass messages to the subvi.  Also a using a reference to the calling vi you can check its run state.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 3
(2,383 Views)