NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass VI reference in and out of TestStand using SetPropertyValue

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?

 

Thanks,

Mick

0 Kudos
Message 1 of 6
(1,553 Views)

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,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(1,532 Views)
Message 3 of 6
(1,529 Views)

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.

 

Thanks,

Mick

 

0 Kudos
Message 4 of 6
(1,513 Views)

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?

 

Thanks,

Mick 

0 Kudos
Message 5 of 6
(1,499 Views)

You can do it in one step if you use the Run VI Asynchronously step in TestStand.

 

https://zone.ni.com/reference/en-XX/help/370052R-01/tsref/infotopics/lv_utility_step_types_run_vi_as...

 

It's down on the bottom in your palette in the LabVIEW Utility folder.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 6
(1,494 Views)