How Can I Display a Message if the TestStand Execution was Aborted?

Updated Jun 5, 2020

Reported In


  • TestStand
  • LabVIEW


  • TestStand
  • LabVIEW

Issue Details

I want to modify the TestStand Simple UI - LabVIEW code and display a custom message if the execution was aborted.


Note: modifying the default TestStand Simple UI - LabVIEW code may result in unexpected behaviors. Save a copy of the original code before performing any change.


You can use the UIMessageEvent event callback to capture the abort message. The message code you should be interested in is the UIMsg_AbortingExecution (value: 6).


  1. Open the LabVIEW Project file located in %TestStandPublic%\UserInterfaces\Simple\LabVIEW\Source Code.
  2. In LabVIEW, open the Top-Level VI file and go to the Block Diagram.
  3. Expand the Reg Event Callback node to include an additional event.
  4. Wire the Application Manager reference to the first input. This specifies that we are handling an event of the Application Manager.
  5. Left-click the first input to select the UIMessageEvent event from the list.
  6. Right-click the VI Ref node and select Create Callback VI from the context menu. This creates a new callback VI which rung whenever a UI message is received.


You now need to implement the code within the callback VI that should execute when the UI message is received.


  1. Open the callback VI and note that the parameters of the VI are created for you based on the event.
  2. To access the UI message data, unbundle the Event Data parameter to access the uiMsg object.
  3. Right-click the uiMsg object and select Create > Property for TS.UIMessage Class > Event.
  4. Insert a new case structure and use the Event property as the case selector.
  5. Create a case for the ID of the UIMsg_AbortingExecution message (6).
  6. Add your custom code there (i.e. one button dialog box).

Additional Information