LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run two VI's simulateously?

Hi,
 
I was wondering is anyone has atip how I run two VI's simultaneously. The first VI is collecting data (through an instrument from HP) and I would like the second Vi to dislay the data while it is collected. I have seen some old VI's in a different program that use "Occurences", is that a solution? Or is there ab easier way?
 
Thanks!
0 Kudos
Message 1 of 8
(3,026 Views)

One option is to use Queues.  Enqueue your collected data in one VI.  And dequeue that data and display in the other VI. 

You may want to study the examples on Queues.  And also the producer-consumer design pattern.

Regards,

-Khalid

0 Kudos
Message 2 of 8
(3,016 Views)
And the other would be to use notifiers and globals.
Look at relevant VI's in labview Examples.
Just go to Examples>> search and type 'queues' or 'Notifiers' to find relevant examples.

regards

Dev

Message Edited by devchander on 04-24-2006 03:55 AM

0 Kudos
Message 3 of 8
(3,012 Views)
Hi Dev,
I wonder why are notifier the better choice, if you have only one direction for data- delivery. I think, this would be more complicated to implement than queues.I used notifier just once and are not very experienced with it. What would you say?
Dave
Greets, Dave
0 Kudos
Message 4 of 8
(3,005 Views)

Hi Dave,

I would not say notifiers are better than queues, both have their own applications

In a notifiers, the block diagram recieving the information in notifier completely stops execution and starts again only when new data becomes available.

This cuts down on computer time wasted on polling.

0 Kudos
Message 5 of 8
(2,973 Views)
OK, got the point. Thanks, Dev
Greets, Dave
0 Kudos
Message 6 of 8
(2,947 Views)

Just adding a tidbit or two to devchandler's reply...

Another key distinction is that a queue is best for lossless buffered transfer of data to exactly 1 reader from 1 or more writers.  A notifier is best for lossy unbuffered transfer of data to 1 or more readers from 1 or more writers.

Notifiers let multiple independent parts of the code react quickly to read data immediately after it gets updated by some other part of the code.  If there are 2 writes between any reads, the data from the older write is displaced and unrecoverable.

I've begun making a habit of basing my "global abort" status flags on Notifiers.  Anyone can write an abort condition and everyone can read it.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 7 of 8
(2,940 Views)

hi,

one way of solving is to declare a shared variable. use this variable to in write mode to collect the data. use the same variable as input to the second vi. this resovles the problem.

 

with regards

krishna

0 Kudos
Message 8 of 8
(2,934 Views)