Example Code

Programmatically Pause and Resume a Subpanel VI Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI uses VI Server to add a subVI to a subpanel and then to abort and run the subVI on demand.

 
Description

One use case for this VI may be (as in this example) if your subVI contains an Event Structure. When an Event Structure is loaded, it registers for each event, and will not unregister for those events until the VI finishes execution. This method would allow you to use an Event Structure for a portion of your program, and then to discontinue use for a second portion.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run the VI. Press the Pause button above to 'pause' the SubPanel control.
  2. Observe how the subpanel is reloaded into memory when the subpanel is 'Paused' and then 'Unpaused.' Note: The 'Paused' subpanel doesn't disappear, but is aborted and should be removed from memory.
  3. Click 'STOP' when needed.

Additional Information or References
VI Snippet

006.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

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

Contributors