05-07-2010 12:39 PM
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
Solved! Go to Solution.
05-07-2010 12:49 PM
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
05-07-2010 01:07 PM
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.
05-07-2010 01:24 PM
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