LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning Global Variable Values To VI Controls

That makes perfect sense Dennis.  I wasn't clear enough on my application.  I need to display this prompt once and then run other testing with other VIs and the display the prompt VI a second time afterwards.

0 Kudos
Message 11 of 14
(726 Views)
You already said that. It doesn't change my answer at all.
Message 12 of 14
(717 Views)

Back before Global Variables appeared in LabVIEW (meaning at least 15 years ago), LabVIEW coders wrote little VIs, with Error In, Error Out, a Shift Register, an Input, an Output, and sometimes a Boolean (to distinguish Read from Write).  The purpose of this VI was to save and recall a particular quantity.  It got the name "VI Global" (or VIG), or "Functional Global Variable" (FGV).

 

Many of us prefer using such VIs to using Global Variables for several reasons.  Mine include:

  • Error line allows me to determine precisely when the variable is read or written.
  • A VIG is small and compact, easily fitting in a 16-by-32 pixel icon.
  • It is easy to find with the LabVIEW Find command, and behaves like any other LabVIEW VI or function (Globals have their own syntax and idiosyncracies).
  • It is easier to avoid race conditions (due primarily to the Error Line serialization ability).

This may be what some earlier posters were suggesting (I'm not sure).  Anyway, here is an example.  Note that "Choices" is a cluster of 4 integers (similar to your Data 1, Data 2, etc.), but it could be almost anything.  Also, the "default behavior" (if the Write input is unwired) is "Read", a "safe" thing to do (as it doesn't overwrite the saved data).

Simple VIG.png

Bob Schor

Message 13 of 14
(715 Views)

Thanks guys for your help.  This works for me. Smiley Happy

0 Kudos
Message 14 of 14
(702 Views)