Example Code

FGV Stops Multiple Loops

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 example shows how to stop multiple loops in separate VIs using the same FGV subVI.

 

Description

This VI was written to stop multiple loops in separate VIs with the same FGV subVI. To do this, the FGV subVI first searches for the corresponding test ID (VI name) in a cluster array (composed with a string as VI name and a boolean as test status). Then the FGV reads/writes the boolean value (stop or error) from/into the array with a specific index (determinated by the VI name input). My intention is just to control the boolean status from one particular VI (process).

In my case the VIs names are composed with 3 numbers (i.e. "110".vi), that corresponding to some specific test parameters, but you can put any string/name you want.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Codeth

  1. Download the attached ZIP file(you can select one version to download).
  2. The FGV Stop with Test ID VI is used as a subVI in other main VIs. For demonstration, there are 3 VIs (110.vi; 120.vi; 111.vi)
  3. Open the 3 main VIs(110.vi,120.vi,111.vi) and run them together
  4. Play to stop the VIs by clicking stop button and/or inject an error by enable the Inject?(False) control (with the debugging VI from the excellent tutorial (see link) ).
  5. When running/stopping VIs, observe the array indicator in the FGV Stop with Test ID subVI.

 

Additional Information or References

VI Snippet

1.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.