LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output data from subVI to main program

Hello,

 

I am trying to output data from subVI to the main program in real time. But I found the the value can be only trasferred when the subVI is finished.

I make some research and I think using queue is the best, but global variable.Can you any give me some tip on using queue to transfer data from subVI to the main program in real time?

 

Thank you!

0 Kudos
Message 1 of 5
(3,368 Views)

Look at the Simple Queue.vi example that is installed with LabVIEW.  If Loop 1 were in a subVI it would generate data that the main VI could consume in a parallel loop (either in another subVI or on the main VI block diagram).  And yes, a queue is the way to do it if you want to make sure all the data gets transferred, and in order.  If all you care about is the current value (and are ok with lossy communication), then look at using a notifier.

0 Kudos
Message 2 of 5
(3,345 Views)

You might also want to checkout the two producer/consumer design patterns. One uses queues and the other event. They might give you some ideas also.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(3,334 Views)
This thread is a duplicate - http://forums.ni.com/t5/LabVIEW/Output-data-from-subVI-to-main-program/m-p/2529222 where a reference is used.
0 Kudos
Message 4 of 5
(3,328 Views)

Yes,sorry I cliked the post twice.

0 Kudos
Message 5 of 5
(3,306 Views)