LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using global variable

Solved!
Go to solution

@govindsankar wrote:

No, I am talking about different VIs in a project, one VI acquiring the data and another VI needs to work on it. So the first VI should have data in some kind of memory for the second VI to access.


Perhaps you should add a little more detail here.

Do you need to process every data point?  If so, we call this a "Stream" and you should be using a queue.  If not and you only care about the latest data point, then use a Global Variable, DVR, or Notifier.


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 11 of 17
(819 Views)

Yes, I am aware of the producer-consumer loop, but for sending data between loops is how I know producer-consumer. Also, I explained earlier that what I need to do is between two sub-VIs of a single project, one gathers or generates the data and the other one manipulates the data. But this is just meant for learning. The actual project I have to do has multiple VIs, all using data of each other to perform different functions. So to start with the basics I need help with just two VIs. Thanking You.

 

0 Kudos
Message 12 of 17
(814 Views)

I am trying an example program where there are two VIs. The first VI generates 10 random numbers in an array and the second VI finds the mean of these 10 random numbers. I know we can do this in 1 single VI, but for learning purposes, I am doing 2 VIs. So how can I achieve the same by the most efficient way of programming? Thanking You. 

 

0 Kudos
Message 13 of 17
(812 Views)

@govindsankar wrote:

So how can I achieve the same by the most efficient way of programming?


Again, it depends on the requirements of the communications.  Do you want to stream the data (high-speed, lossless, single data type)?  Send the data as a message (intermittent, different data depending on the message being sent, lossless or lossy)?  Or just read the tag (single value, last update, not synchronized)?


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 14 of 17
(797 Views)

Sent data as a message. 

0 Kudos
Message 15 of 17
(790 Views)
Solution
Accepted by topic author govindsankar

@govindsankar wrote:

Sent data as a message. 


Ok, now do you want every message to be processed or only the latest?  If every message, then use a Queue or an User Event.  If you only care about the latest message, then use a Notifier.


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 16 of 17
(775 Views)

HI,

 

Thank You. I need to send every message.

0 Kudos
Message 17 of 17
(747 Views)