Custom Status Message in Batch Results Dialog Using TestStand Batch Process Model

Updated May 12, 2023

Reported In

Software

  • TestStand

Issue Details

I am using TestStand built-in Batch Process Model.
After my MainSequence is executed on a batch, a Batch Results dialog is displayed, showing a Status Message for each UUTs, indicating whether the test sequence has passed or failed.



How can I customize the Status Message string that is displayed? I am generating a custom string explaining the cause of the sequence failure and I would like this string to be displayed.
 

Solution

The Batch Results dialog is displayed by Batch process model callback PostBatch. Here, a function in modelsupport2.dll is called to format and display results.
The Status Message string in the dialog is generated based on MainSequence status, which could be customized directly in the PostBatch callback by adding a statement step to execute the following expression (which will set a custom MainSequence status for Socket 0):

Parameters.ModelData.TestSockets[0].MainSequenceResults->Status="custom" 

where "custom" should be replaced with any custom status you would like to display for Socket 0.
You can set a custom status for the other sockets by changing the numeric index between the square brackets in the expression.

You can either override the PostBatch callback in your particular sequence file or make the changes directly in PostBatch sequence in the process model.
 

Additional Information

It is also possible to modify the source code of the modelsupport2 project and rebuild modelsupport2.dll to enable custom messages.

Generally speaking, if you need to understand in which property TestStand stores a particular data you need to modify (for example, MainSequenceResults property indicated before), you should:
  1. Place a breakpoint at any step of the sequence you are interested on (for example, your client Sequence File's MainSequence or the Batch Model PostBatch callback)
  2. Click Execute » TestUUTs or Execute » Single Pass to launch execution
  3. When the breakpoint is reached, execution is paused: at this time, you can explore and navigate the TestStand variables tree in Variable pane or click Edit » Find/Replace (CTRL+F) to search for the expected property name or expected property value
  4. In the Find Results window, right-click the property you found, which corresponds to your needs, and select Goto Location option to highlight the property in Variables pane
  5. Right-click the property in Variable pane and select Copy to copy the property name to the clipboard
  6. After execution ends and you return to edit mode, you can paste the property name to an expression, for example to programmatically set it