Skip to content Skip to navigation

Connexions

You are here: Home » Content » Global Variables in LabVIEW

Navigation

Content Actions

Global Variables in LabVIEW

Module by: Felix Annan

Summary: This module discusses the Global Variable component as an instrument for data transfer between virtual instruments within a LabVIEW application

Global Variables as their name suggests are variables that can be observed from any VI within the shared memory space of an application. All global variables can be grouped unto a single front panel which then serves as a global variable holder. By placing controls and indicators on it the programmer is basically placing variables in memory that can be referred to in each VI in the application in order to transfer data. Global variables, like all variables in LabVIEW must be set to either be read from or written to in order to be used. They are the closest in description to that found in most procedural/event programming models with forms and their variables

The Advantage:

  1. They are easy to set up

The Disadvantage:

  1. Since they store only one value at a time they are best used for non continuous data for which the loss of some values is not a threat to the successful run of the whole program.
  2. The user will have to set up loops that will keep checking the value of the global variable in order to determine if and when its value changes.

The global variables are best used for simple information that generally does not change too often.

Implementation:

The global variable component is available from the structures sub-section of the programming functions. Once placed on the block diagram, double clicking on the component allows one to access the global variable holder(front panel).

Comments, questions, feedback, criticisms?

Send feedback