Shutting Down the Engine

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

You shut down the engine just before you exit the application and when you log out the current user. Shutting down the engine is a two-pass process in which you release sequence files and wait for their unload callbacks to complete.

Notes Notes
  • National Instruments recommends that you call the ApplicationMgr.Shutdown method to shut down the engine for an application you develop with the TestStand User Interface (UI) Controls.
  • For a .NET user interface, refer to the Additional Considerations for .NET Application to Properly Shutdown TestStand section of the Starting and Shutting Down TestStand from a .NET User Interface topic for more information about properly starting and shutting down TestStand from .NET applications.

First Pass

Complete the following tasks in the first pass of this process.

  • Unload all sequence files and close all completed executions. The application must release all references to sequence files and executions so TestStand can unload all associated sequence files and run any unload callbacks they include.
  • Call the Engine.ShutDown method and pass False for the final parameter.

The first pass ends when you receive the UIMsg_ShutDownComplete or UIMsg_ShutDownCancelled UIMessage. If you receive the UIMsg_ShutDownComplete event, continue with pass two. If you receive the UIMsg_ShutDownCancelled event instead, resume the normal operation of the application. The user can cancel shutdown by clicking Cancel in the Waiting for Execution to Complete Timeout dialog box, which TestStand launches for executions that do not end within their allotted time.

Second Pass

Complete the following tasks in the second pass of this process.

  • Close all executions TestStand created as a result of the first pass. Release references to all executions and close the windows you used to display them.
  • Call the LoginLogout Front-End callback sequence and pass True for the logoutOnly argument.
  • When the LoginLogout callback completes and you receive the UIMsg_EndExecution event, call the Engine.ShutDown method again but pass True for the final parameter.

The second pass ends when you receive the UIMsg_ShutDownComplete event. When you receive this event and you are shutting down in preparation to exit the application, the application can safely exit. If you are shutting down because the current user logged out, you can resume normal operation.

Note Note  For a LabVIEW user interface, if the TestStand Engine attempts to launch a dialog box during shutdown and the main application window no longer exists, the user interface hangs. To prevent this hang, ensure that the engine is closed before you close the front panel of the user interface.

WAS THIS ARTICLE HELPFUL?

Not Helpful