I want to open a VI with one call from a TestStand step and close the vi from another TestStand Step. I want to store the vi reference back in a TestStand FileGlobal using the SetPropertyValue vi and retrieve the vi reference with the GetPropertyValue vi.
I've found that if I simply pass the vi reference that the prototype in TS makes it a U32 type and it works perfect. I don't want the user of my step type to have to manage the storage of the vi reference so I want to save it away with the SetPropertyValue. If I try to make the SetPropertyValue instance be of type U32 the VI breaks and won't attach. I found that casting the vi reference to a U32 works and the value passes. But when I pass it back into the close vi the value is incorrect and the close vi errors.
How can I pass a vi reference in and out of TS using the Get/SetPropertyValue vi?
Why not run it in a new thread and then close it by setting a variable? This is typically how it's done.
There are hundreds of examples out there if you google: Run VI in New Thread TestStand
Maybe I don't understand your purpose? If you explain why then maybe I could give a better answer.
Thanks for the advice. I think with a little code rewrite I can use the method of launching the vi in a new thread and monitoring/writing TS variables.
I'm still not sure why I cannot pass the VI reference but the method you recommended is just as good a solution.
After some trial and error I've found that the new thread technique is not going to work for me. The issue is that to create a new thread requires calling a seq call. I need to create a step type that calls a vi. I don't believe there is any way to call a step type in a new thread.
How can I pass the VI reference from/to TS using Get/SetPropertyValue in LV?
You can do it in one step if you use the Run VI Asynchronously step in TestStand.
It's down on the bottom in your palette in the LabVIEW Utility folder.