09-05-2018 09:30 AM
@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.
09-05-2018 10:15 AM
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.
09-05-2018 10:19 AM
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.
09-05-2018 01:38 PM
@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)?
09-05-2018 02:15 PM
Sent data as a message.
09-06-2018 06:26 AM
@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.
09-07-2018 02:14 AM
HI,
Thank You. I need to send every message.