Termination Monitor - LabWindows/CVI

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)


This example demonstrates the use of the Termination Monitor function in LabWindows/CVI. The Termination Monitor allows a code module to stop executing if TestStand attempts to terminate or abort the execution.

Example File Location

Open Example

<TestStand Public>\Examples\Fundamentals\Termination Monitor\CVI\Termination Monitor.seq

Highlighted Features

Major API




How to Use This Example

This example uses a CVI Action step to call a function in a C DLL that runs indefinitely. Since it uses the Termination Monitor functionality, the function is able to stop when TestStand attempts to terminate or abort the execution. If the function did not call the Termination Monitor method, TestStand would be unable to terminate or abort the execution.

To review the functions used in this example, open Termination Monitor Example.c located at <TestStand Public>\Examples\Fundamentals\Termination Monitor\CVI\Termination Monitor Example.c.

The TS_CancelDialogIfExecutionStops method is used to search for a request from TestStand to stop the execution. This method automatically initiates a timer callback, which will call the QuitUserInterface method if TestStand is attempting to terminate or abort the execution.

Note that the TS_CancelDialogIfExecutionStops method requires the panel handle of the onscreen dialog and the SequenceContext of the calling sequence as parameters. This method also assumes that the calling code has control of the dialog through a call to the RunUserInterface method.

Complete the following steps to run the example:

  1. In TestStand, select Execute»Single Pass to run the sequence.
  2. When the TerminationMonitorExample dialog appears, the sequence will execute indefinitely.
  3. On the Debug toolbar in TestStand, click the red Terminate button to terminate the execution. Observe that the execution terminates successfully.


Not Helpful