Example Code

Stop Button Functional Global Variable

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

    Programming Language

  • LabVIEW G

Code and Documents

Attachment

Description

Overview
This VI shows how to use a Functional Global Variable to stop multiple parallel loops.

 
Description

Within a loop connect the loop's stop condition to stop in and the loop's error cluster to error in, reset remains unconnected (default: FALSE). When stop in is true or an error is present, the value is stored and then read by all instances to stop all loops.
To reset the FGV connect a reset constant to reset. In the reset case the status from error in is stored. If the FGV is reset while an error is present, stop out is TRUE, otherwise FALSE.

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached file to your computer.
  2. Open the VI "Global Stop FGV.vi"
  3. Add to a VI containing multiple while loops. Run the program.

 

Additional Information or References
VI Block Diagram

 

 

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

Miriam
Field Applications Engineer
NI Colombia
CLD

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