NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I call a VI passed in as a parameter to a subsequence?

I'm writing a subsequence that I want to use as a generic retry function. I want to call a pass/fail VI within this subsequence, but I want the caller to pass in the desired VI (or a reference to it). I don't see a straightforward way to do this in TestStand 2.0.1 - is there any way?
0 Kudos
Message 1 of 3
(2,947 Views)
Hey Gizmogal,

You could pass in the path to the VI and then change the path the pass/fail VI references using hidden properties. Please see the link below for more details on this approach.

Assigning a Code Module Programmatically at Run-Time

There are several major downsides to this method as discussed in the link.

Another options would be to call the VI through the LabVIEW activeX interface. You could also create a wrapper VI you call through a pass/fail step and pass the path in. Next have the wrapper VI call the VI you want to call.

If you have a fixed number of VIs you could have a step that calls each of them and then through preconditions
choose which one executes. This will cause all steps to show up in the report. To get around this take a look at the SequenceBuilderTool example.

I hope this helps!!

Regards,

Sarah Miracle
National Instruments
Message 2 of 3
(2,947 Views)
Hey Sarah,
Thanks, I tried this method and it worked!
I ended up using a different method, though, because of all the warnings about the hidden properties not being supported. For each pass/fail VI that I wanted to call, I created a sequence to call it and return the status. That worked just as well and settling on this approach even gives me the option of using only a sequence for really simple pass/fail situations. Of course the name of the sequence I want to call CAN be passed in as an argument, so everything is above-board and self-documenting.
It's still sweet to know how to call a VI this way if I need to though.
Best regards,
Gizmogal
0 Kudos
Message 3 of 3
(2,947 Views)