NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my VI still running after my teststand sequence has completed?

Hello all,

Disclosure: I have not played with TestStand in a long while...

 

This is what I've done so far:

1. Successfully have put together a simple test sequence comprised of 5 steps

- Initialize Power Supply.vi

- Initialize Instrument B.vi

- Display Hello World.vi

- Close Power Supply.vi

- Close Instrument B.vi

2. I'm able to successfully run this test sequence (BTW, I'm actually talking to real instruments)

 

The issue I'm having is that once my test sequence has completed its execution, if I try to open either of the VIs from above it shows that "The SubVI is wating to Run"

 

May I ask, why that is?

 

In advance, thank you for the feedback.

Cheers,

edp

 

 

0 Kudos
Message 1 of 5
(5,575 Views)

I found the setting I was looking for!

 

Comments are still welcome... in case that there are other solutions out there

0 Kudos
Message 2 of 5
(5,573 Views)

That setting may not be what you really want to do.  I use the Unload All Modules.  See here for more details:http://digital.ni.com/public.nsf/allkb/B4FD0FA9B31DB1148625712B0006C0FB


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(5,563 Views)

I just want to point some things out for clearification:

 

When TestStand requires a code module, it will load and lock the module. The "Load Option" defines, when this will take place. Possible settings are:

- Preload when opening sequence file

- Preload when execution begins (default)

- Load dynamically (meaning: when step will be executed)

 

The "Unload Option" defines, when TestStand will relieve the lock, leaving the runtime environment of the code module to unload or leave the module open (depending on adapter settings and other things). Possible settings are:

- When precondition fails (step is executed, but code module will not be called due to "skip")

- After step executes

- After sequence executes 

- When sequence file is unloaded  (default)

 

There are two places where you can define Load/Unload Options:

 

a) Step Properties: This setting refers to the very step it is configured in. The associated "Load Option" (also step setting) defines, when the code module will be loaded into memory. Once TestStand releases the module using the Unload Option of the step. Note: If the very same code module is used in another step, the unload option with the longest lock period defines when TestStand actually relieves the lock.

b) Sequence File Properties: Load/Unload options are set to "Use step settings" as default. You can modify them to use certain settings. Doing so, "overrides" the step settings for ALL steps in the sequence file.

 

Disclaimer on using Load/Unload options:

If set to "stupid" settings, all you're going to do is to impact performance in a negative way, possibly also messing up with data storage within code modules (e.g. USR, unitialized shift register, as data storage). So it is recommended, to alter those settings only for certain setups. They are no tool to ease development effort (unloading modules manually) in the first instance. 

 

So for development purpose, there are also three possible ways:

a) As crossrulz stated: Put a statement step as last step in your sequence which calls UnloadAllModules from the TestStand API. DO NOT FORGET TO DELETE THIS STEP ONCE YOU ARE DONE WITH DEBUGGING.

b) As stated above, you could alter the default Unload Option in the Sequence File Properties to "Unload after Sequence executes". DO NOT FORGET TO REVERT IT BACK TO "USE STEP SETTINGS" ONCE YOU ARE DONE WITH DEBUGGING. 

c) In the TestStand menu, you find the Unload All Modules option in the "File" Area. It is recommended to use this option. But since it could become a little cumbersome to do so everytime after a test execution, you might switch to a) or b).

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 5
(5,551 Views)

To Do Programatically Unload all modules:

Put "RunState.Engine.UnloadAllModules( )" in "post expression" of last step which you are executing or Insert step statement & inside of the statement step put "RunState.Engine.UnloadAllModules( )"

 

To Do Manually Unload all modules:

Just go to File and Unload All Modules after Teststand finishes the execution.

Message 5 of 5
(5,525 Views)