NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do 'Unload all models' programatically?

Hi,
 
I wish to perform 'Unload all models' upon the completion of my sequence. 
 
Is there a way to do it programatically?
 
Thanks
Rafi
0 Kudos
Message 1 of 7
(3,192 Views)

Yes, you can call the method Engine.UnloadAllModules.  One way this call could be added would be to add the postUUT callback to your sequence file and then add an ActiveX/COM action using this method to the postUUT sequence.

The TestStand API Reference Guide located in the TestStand help has information on this method and many others.  Searching within the TestStand help for "unload modules" will also return more information about this method.

Feel free to ask if you need help creating a callback or doing a method call.

Message Edited by Dillon G on 07-30-2007 04:08 PM

0 Kudos
Message 2 of 7
(3,180 Views)

So what Object Reference should be used when using this method (Engine.UnloadAllModules)?

0 Kudos
Message 3 of 7
(2,736 Views)

You can use a Statement step in TestStand and simply use RunState.Engine.UnloadAllModules().

Daniel E.
TestStand Staff Product Support Engineer
National Instruments
CTA/CLD
0 Kudos
Message 4 of 7
(2,733 Views)

Daniel,

 

The problem I am having is I am getting an error when I close TestStand (see attachment), but when I use the File pull-down menu to Unload All Modules, the problem goes away???

 

 

0 Kudos
Message 5 of 7
(2,731 Views)

This would suggest that you are not deallocating memory / closing references in one or more of your code modules (vi, dll may be?)

I would skip some sections of the code to narrow it down.


CLA CTAChampionI'm attending the GLA Summit!
Subscribe to our Test Automation user group: UK Test Automation Group
0 Kudos
Message 6 of 7
(2,713 Views)

That can sometimes happen if you have code that is attempting to call into a dll after it has already been unloaded. That should normally not ever happen. But perhaps you have code that calls into a dll when something gets cleaned up for shutdown that doesn't own a strong reference to a dll or appdomain thus not keeping it loaded.

 

-Doug

0 Kudos
Message 7 of 7
(2,476 Views)