LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to stop a running vi and still keep its vi reference valid

Solved!
Go to solution

Hi all,

 

I open a vi reference and need to dynamically run it and stop this vi. Problem is, after I use "Abort Vi" method to stop it, its reference becomes invalid and I need to reopen it next time I want to run it.

 

Is there a way to stop the running vi and still keep its vi reference valid?  so that next time I can use the "RunVI" method to run it and  don't need to reopen it.

 

Thanks.

 

Anne 

0 Kudos
Message 1 of 4
(3,598 Views)

ergwser wrote:

Hi all,

 

I open a vi reference and need to dynamically run it and stop this vi. Problem is, after I use "Abort Vi" method to stop it, its reference becomes invalid and I need to reopen it next time I want to run it.

 

Is there a way to stop the running vi and still keep its vi reference valid?  so that next time I can use the "RunVI" method to run it and  don't need to reopen it.

 

Thanks.

 

Anne 


Quoting from the LabVIEW Champion Ed Dicken's signature "Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences."

 

I generally will include a stop command as part of the messsages scheme I send to background process.

 

Before i go off and start talking about stuff that is "too far out there" do you interact with the target VI somehow now?

 

If so add a shutdown or Pause to the target VI that will force it to go idle waiting for you to use it again.

 

Post some pictures or code to show us what you have so-far.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(3,592 Views)
Solution
Accepted by ergwser

Ben wrote:

Quoting from the LabVIEW Champion Ed Dicken's signature "Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences."

 


Ben, I think he was talking about the Abort VI METHOD, not the Abort button.  I wrote a small example using Run VI, wait, Abort VI, then Run VI again, and it worked.  The reference did not become invalid.  You have to make sure to wire a false constant to the Auto Dispose input of the Run VI method.

 

AbortTest.png

 

- tbob

Inventor of the WORM Global
Message 3 of 4
(3,579 Views)

Tbob is right.  Problem sloved.

 

 

I forgot to change the boolean to Auto Dispose input. 

 

 

So Silly.  🙂

 

 

Thanks a lot, Ben and Tbob.

 

 

Have a nice day.

 

Anne

0 Kudos
Message 4 of 4
(3,570 Views)