LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Kill Waiting Task

No, there's no way to kill an arbitrary piece of code (I've never seen that in any programming language).  If you were to run a VI dynamically you could abort it.  The Stop primitive will abort a running VI as well, but will also terminate any calling VIs (ie, your entire hierarchy).  Notifiers and Queues will return an error if they are waiting and their refnum becomes invalid because the queue or notifier was released/destroyed elsewhere in the code.

Message 11 of 12
(295 Views)

Outside of opening a Vi reference, invoking Run to start it and the invoking Abort to stop it, I don't think so. Though my feeling is, while not totally understanding your problem, that is should be possible to avoid such an issue in your code.

 

Can't you set the timeout for the Visa Read so that you can check your "Disable" condition? You won't miss data by timing out (or the trigger) while dealing with the timeout. The serial port will still hold all the data in the buffer.

0 Kudos
Message 12 of 12
(288 Views)