Programmatically Disable Test Sockets in the Batch Process Model

Updated Mar 12, 2026

Environment

Software

  • TestStand

This knowledge base article explains how to disable specific test sockets at the beginning of your test sequence running with the Batch Process Model. Following the steps in this article will allow you to conditionally disable test sockets to save time when running your test sequence.

 

Please note that the default behavior of the Batch Process Model in TestStand is to display a dialog window prior to executing a test sequence that allows you to disable individual test sockets by simply checking a box. However, if you are using a custom dialog window or if there are different conditions that will determine whether a test socket should be disabled, this article is for you.

 

The following approaches will be described in this article:

  1. Modifying the Process Model
  2. Overriding a Model Callback

 

Modifying the Process Model

 

Should you need this feature to be consistently available in every test sequence file, use this way to configure your process model.

  1. Create a new Batch Process Model file so that you can customize the Process Model.

    Note: Before modifying any process models, first create a copy of the entire Models directory — located at <TestStand>/Components/Models — and place it in the corresponding location under the TestStand public directory at <TestStand Public>/Components/Models. All modifications should be made only to the files in the TestStand public directory.

  2. Open the Batch Process Model sequence file.

    Tip:
    You can double-click the model name at the bottom of the Teststand Window.

     

  3. Select the PreBatch sequence in the Sequences pane.

  4. Insert a Statement Step into the PreBatch sequence using one of the following options:
    1. Right click an empty space in the Steps pane, then select Insert Step >> Statement.
    2. Drag and drop a Statement step from the Insertion Palette.

      Important Note: You must add it after the dialog steps, otherwise they'll overwrite your custom statement action.

  5. Select the new statement step with a left-click.

    Optional: Press F2 to rename it. Enter a meaningful name (e.g. Disable Socket 2)

  6. Open the Expression tab in the Step Settings pane.

  7. Add a Teststand expression to the Expression field to set the disabled state for a specific test socket.
    • The expression to use is: 

      Parameters.ModelData.TestSockets[SOCK#].Disabled = [boolean expression]

      Where:
      • SOCK# represents the specific socket you wish to set the disabled state for.
      • The boolean expression will determine whether the socket is disabled. If the boolean expression is evaluated as True, then the test socket will be disabled. If the boolean expression evaluates as False the test socket will be enabled.

 

Your code should look like this:

 

 

 

Overriding a Model Callback

 

To apply this functionality to one specific test sequence file, follow these instructions.

 

  1. Open your test sequence file.
  2. Right-click an empty space on the Sequences pane and select Sequence File Callbacks...
  3. Check the PreBatch Model Callback and click ok.

     

    Note: The PreBatch model callback only appears if the active process model is the Batch Process Model.

  4. Perform steps 4 to 8 from the Modifying the Process Model section.

If you execute the sequence through Test UUTs, the Serial Number Dialog won't show sockets as disabled. This occurs because the dialog runs prior to our statement step. Moreover, the dialog ignores the Disabled flag anyway, as its typical role is to establish that flag itself.

 

However, when the test effectively starts, you'll notice that the disabled sockets won't execute. In the example below, socket 2 shows up as disabled.

 

 

At the end of the execution, the Batch Results dialog will finally show the disabled status for the sockets.