Unloading All TestStand Modules Programmatically

Updated Dec 7, 2017

Reported In

Software

  • TestStand

Issue Details

I want to unload all TestStand modules programmatically instead of going to File> Unload All Modules, how can I do this?

Solution

For TestStand 4.0 and later:
  • Add a new Statement step to your sequence.
  • Insert the following code into the Expression text box: RunState.Engine.UnloadAllModules()

For TestStand 3.5 and earlier:
  • Select the ActiveX Module Adapter and add a new Action Step to your sequence.
  • Right click on the new step and select Specify Module.
  • In the Edit ActiveX/COM Adapter window, set the following fields to the following values:
  1. Object Reference: RunState.Engine
  2. Automation Server: NI TestStand API <Your TestStand Version> (Ver 1.0)
  3. Object Class: Engine (IEngine)
  4. Action: Call Method
  5. Method: UnloadAllModules
  6. Click OK to save your changes.
You can also call this method by sending the Sequence Context into a code module and using the programming language's ActiveX functionality to call the Engine's UnloadAllModules method.

WAS THIS ARTICLE HELPFUL?

Not Helpful