How to Enable Discard Unused Results Using TestStand Expressions

Updated Oct 30, 2026

Environment

Software

  • TestStand

When executing long test sequences or parallel executions in NI TestStand, accumulating step result objects can increase memory usage over time. While this setting is commonly configured through the Model Options dialog box, you can also programmatically enable the option to discard unused results directly within your sequence file callbacks using an expression.

 This tutorial explains how you can override the Model Options callback in your sequence file and set the property. 

 

  1. In the NI TestStand Sequence Editor, open your sequence file.
  2. Add or open the Model Options sequence callback:
    • Right Click and select Sequence File Callbacks...
       
    • Select Model Options from the list of available callbacks.
       
    • Click OK.
  3. Open the Model Options sequence from the Sequences pane.
  4. Insert a Statement step into the Main step group.
  5. In the Step Settings pane, enter the following expression: Parameters.ModelOptions.DiscardUnusedResults = True

     
  6. Save the sequence file and run the test sequence.