From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Run a LabVIEW VI Asynchronously from TestStand

Code and Documents

Attachment

Description

Overview

 This example program demonstrates how to call a VI asynchronously using TestStand and make sure it finishes executing when the sequence ends.

 

Description

Some tests require of a background process to be happening while the DUT is being checked. These background tasks can include an interface that is logging serial commands, to an engine that is making sure the system has no faults, etc.
TestStand makes it easy for us to create call a VI asynchronously to run while our sequence is being run, without having to wait for it as a regular step.

 

Hardware and Software Requirements

  • TestStand 2016 or a newer version.
  • LabVIEW 2016 or a newer version.

 

Steps to Implement or Execute Code

You will find two versions of this example:

  • Single Instance: This example works well with the Sequential model. It calls one VI instance and stops it using an FGV.
  • Multiple Instances: This example works well with Sequential, Batch and Parallel processes. It uses a name to identify each asynchronous VI and allows you to have multiple instances running at the same time, and stop them individually. The name for each VI is stores as a Local variable in the sequence file.

 

To run them, follow the next steps:

  1. Extract the ZIP folder contents in a meaningful location.
  2. Open the file TerminationMonitorImplementation.seq in the TestStand Sequence Editor.
  3. Run the Sequence in Single Pass.
  4. See how the VI runs asynchronously while your test is executing another step.

 

Additional Information or References

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.