You are on page 1of 6

What are Global Variables?

What does a Global Variable do?


Shares data between multiple VIs that run simultaneously
Acts as a server from which multiple VIs can access data.
When a Global VI is created, LabVIEW automatically creates a global front
panel with no block diagram.
Controls and indicators can be added to this front panel to define data types
of the global variables.

How to Create a Global Variable


Select a global variable from the Functions pallete
Double clicking the icon will bring up the front panel of the Global
Variable
Place the desired controls and indicators on the front panel
Label the controls and indicators with descriptive owned labels

Multiple Global Variables can be created, each with one front panel
object; or a single Global Variable can be created with multiple front
panel objects.
Single Global Variable is more efficient because you can group related
variables together.

Creating a Global Variable Continued


After placing objects on the front panel, save it and return to block diagram.
By clicking the global variable node, and selecting a front panel object from the
shortcut menu, the user can select the object in the global VI that will be
accessed.
The Global Variable can be used in multiple VIs by selecting the first item in the
functions pallete with the owned label the user created when creating the Global
Variable.

Global Variable
example.
The Global Variable to the right shows a
numeric control, a string, and a cluster
containing a numeric control and a Boolean
control.
It should be noted that the toolbar does not
have the run icon, the abort icon and other
buttons that the standard VI front panel
contains.

Quiz Question
A global Variable is best used to:
A. Share data within a single VI between multiple loops.
B. Share data between multiple VIs operating simultaneously on the same
computer
C. Share data between multiple VIs operating simultaneously on multiple
computers
D. None of the Above

You might also like