Quickstart Guide
Introduction RIO Academic RIO Application examples Your first RT app Your first FPGA app
Basic procedures System admin File system I/O monitor System controller architecture Timed loops Inter-process communication RT/Host communication RT/FPGA communication FPGA personalities Interrupts Datalogger (file I/O)
Design flow Simulation Inter-process communication RT/host communication Derived clock domain IP blocks FPGA personality
Get connected Email Web services UDP TCP IP addresses
Site Map
Guides Code examples Procedures Tags LabVIEW block diagram elements Targets Communications All pages
Glossary How to use About
RIO Developer Essentials Guide for Academia
RT code example

Functional global variable (FGV)

Use a functional global variable (FGV) to communicate between two parallel process loops contained within different VIs under the same target, and use a FGV to stop parallel loops with one "stop" button. The "functional" nature of the FGV means that you can create additional functionality beyond that of a basic global variable, e.g., counting and calculations that operate on the stored value.

LabVIEW RT block diagram snippet: Functional global variable subVI with unitialized while-loop shift register and case structure

Use cases


Keep in mind

LabVIEW block diagram elements

The functional global variable is a design pattern as opposed to a set of built-in VIs. Refer to the example code below for details.

Example code

Expected results

https://youtu.be/hu_x28978hY (1:51)

Developer walk-through

https://youtu.be/RwH3hwp8vaw (5:16)


For more information

  1. Effective LabVIEW Programming (http://www.ntspress.com/publications/effective-labview-programming/)
    An excellent textbook by Dr. Thomas J. Bress covering all aspects of system design; Chapter 5 ("Action Engines" describes functional global variables in detail. Download all of the code examples from this textbook: follow the link above, select "User Resources", and then "All VIs".
  2. The LabVIEW Style Book (https://www.pearson.com/us/higher-education/program/Blume-Lab-VIEW-Style-Book-The/PGM219404.html)
    A comprehensive textbook by Peter A. Blume that lays out everything you need to know about best practices for LabVIEW system design; Chapter 8 describes functional global variables.