LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dumb question? Can't pass globals between 2 VI"S

Solved!
Go to solution

I have been asked to make three VIS from 1 VI. I can't pass globals between 3 seperate VIS? Maybe going back to 101 in lab view may help.

 

Philip

0 Kudos
Message 1 of 4
(2,539 Views)

Global variables can be read by any VI.  Locals cannot be shared.  Of course, there's also the Functional Global Variable that is popular as well.

 

But, yes, global variables can be used by all of your VIs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,534 Views)

You can also adopt more of a messaging system and use queues/notifiers/user events to pass data between the VIs.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 3 of 4
(2,527 Views)
Solution
Accepted by topic author pnielsen@gplains.com

Your solution should depend upon what sort of data passing you need.  Some of the types of data you may need to pass around and some ways to do it are as follows:

 

  1. If the VIs execute sequentially, simply use wires between them and set up the connector panes appropriately.  No need for anything advanced.  This will be the case more often than you might believe.
  2. Local state information should be kept in a shift register of the loop the data is used in.  This, also, is very common.
  3. "Global" data can be kept in a data value reference (DVR) or functional global, with preference to the former.  DVRs tend to be more scalable and have higher performance than functional globals.
  4. Sending data between VIs at run-time is usually best done with queues, user events, or notifiers, depending on the application.  Queues are the normal method.  User events are a lossless broadcast mechanism (one writer, multiple readers).  Notifiers are a lossy broadcast mechanism.

If you give us more details of what you are trying to accomplish, we can be a bit more specific.

 

Please note that globals are not on the above list.  They are fast, easy, and I think they cause more trouble than they are worth.  If you want more details, search these forums for huge amounts of debate on the subject.

Message 4 of 4
(2,486 Views)