I would like to start a VI from TestStand by calling it asynchronously as the screenshot "Start UI" below but I can not stop that VI at the last step in TestStand with VI "Stop UI". The reason is that the refnum is no longer valid.
So now how can I stop the VI within a step in TestStand?
Thank you all
Use the "Store an Object Reference to the New Thread(optional)" control in the Step Settings for the Run VI Asynchronously.
Thank you. but I did not use the sequence Call. I used the Action like this. Any other solutions?
Why didn't you use the 'Run VI Asynchronously' StepType, which is what I thought you had used?
Sorry. I am quite new with TestStand.
So, how about the VI to abort the VI called asynchronously? could you help me to program it? I try but failed.
You could use a TestStand Boolean which you set in your Cleanup of your Sequence.
You monitor this TestStand Boolean in your VI to exit any loops and hence close your VI.
How about the object reference I have stored in the first step which called VI asynchronously? Will I need to use it for aborting that VI? and how to use it?
Forget that idea.
Create yourself a simple FGV which outputs a Boolean. Input to the FGV is an enum control; Initialise, Read and Stop.
Initialise set your Boolean to False
Read, returns the value of your Boolean.
Stop sets the Boolean True.
In your Parallel running VI, use the FGV set to Read to return the Boolean which will close your loop and hence close your VI.
In your Sequence (in Setup). Call your FGV set to Initialise (you could do this in your main VI).
In your Sequence (In the Cleanup). Call your FGV set to Stop. This should stop your VI.