NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to keep a VI open during an entire seqeunce run in order to store globals

I am looking to keep a object reference open during a test sequence.  My thought was to open a VI where the reference is created, keep the VI open and allow any calls to that VI later in the sequence to use the reference to get the function calls.  Does this seem possible?  I am using TestStand 4.2 and LabView 2009.

0 Kudos
Message 1 of 16
(3,504 Views)

Why don't you pass the reference back to TestStand and then pass it around to other VIs?  That way TestStand will have the handle to the reference as it is a live execution.

 

If you absolutely need to keep the VI open for the entirety of the test then there are two options:

Run VI Asynchronously is a step type in the LabVIEW Utility folder on your palette.  It will run the VI in a new thread.

 

Or you can call a subsequence in a new thread and inside of it call your VI using an Action step.

 

In the examples look for the ParallelExecution.seq in the ExecutingCodeModulesInParallel folder.  It is CVI but demonstrates the same thing you want.

 

Cheers,

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

If I save the object created as a "object reference" in the TestStand variables, can I then reference that back as a "Automation Refnum" control in other VIs?

0 Kudos
Message 3 of 16
(3,499 Views)

What kind of object is it? You can pass most variable types back and forth.

 

For example, in several projects I've used the NI Internet Toolkit to open a telnet session to a UUT. By passing the telnet reference back to a TestStand local, it can then be passed around to other sequences and other VIs in order to perform other telnet actions later in the sequence without the session closing (caveat: some devices need a keep-alive in order for the session to be kept open).

 

Edit: Late reply 😉 My tentative answer RE: an automation reference is yes, but some ActiveX controls might get finicky. Try it and see.

0 Kudos
Message 4 of 16
(3,498 Views)

The problem that I have is when I call back the reference in later VIs, the "Invoke Node" does not know which class to find and choose methods.  What can I do to remedy this?

0 Kudos
Message 5 of 16
(3,491 Views)

You have to create controls and indicators of that type and connect them to the connector pane.  Then you can pass it into and out of TestStand.

 

So let's say you have something like this:

Step A (creates the object reference) needs to have an indicator connected to the connector pane that is of the type you created.  Now in TestStand save it to Locals.MyObj (or whatever).

Step B (calls a property node) needs to have a control and indicator, both connected to the connector pane, that is of the same type as in Step A.  Now assign Locals.MyObj to both.  Make sure both are wired to the property node.

Step C (closes the reference) needs to have a control connected to the connector pane of that same type before.  Pass Locals.MyObj to it and then us LV to close it.

 

Hopefully this makes sense.

 

Cheers,

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

When you are saying of the "same type" are you stating that I use "create" indicators and controls from nodes for this type?

0 Kudos
Message 7 of 16
(3,485 Views)

If the VI can't figure out what class to use, you can use a Type Cast to force it to see the correct type.

0 Kudos
Message 8 of 16
(3,481 Views)

At some point you have created that object wire that goes into the property nodes correct?  Just take that wire and create a control or indicator and then copy them to other VIs and use that.  Then wire the controls and indicators to the nodes.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 9 of 16
(3,478 Views)

And at the end of the sequence, you must make sure to close it?

0 Kudos
Message 10 of 16
(3,475 Views)