LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to abort a SubVI while its running

Hi There. I have a SubVI that actually writes data to the DAQ board. The DIO wait.vi waits until all the data in the buffer is written and this is where I have a problem. I am trying to implement a timeout where after a predetermined amount of time, the writing of data to the DAQ needs to be terminated and the main VI must return back to its idle state. Being a newbie to labview, I thought aborting the subvi dealing with the data write to the DAQ board would be a plan. But this does not happen since the subVi never gets aborted. Thus I end up having to abort the whole vi and have the user restart the application (terrible).
Any ideas or tips?
Thanks in advance.
Message 1 of 4
(3,011 Views)
You could pass a reference to a boolean switch on the main panel vi, then check the value of this boolean inside the sub-vi.
See the attached example.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 4
(2,982 Views)
Hello Qubit,

I noticed that you are using traditional NI-DAQ. I am not sure how evolved your program is already, but I would suggest you use DAQmx. The same VI in DAQmx already has a timeout input that you can use. See the image below for the location of the VI on the DAQmx pallette.
0 Kudos
Message 3 of 4
(2,945 Views)
sorry, forgot to attach..
0 Kudos
Message 4 of 4
(2,943 Views)