LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stream data from a subvi to the main vi

Hi

I’m wondering if someone can help me. I’m trying to stream data from a sub vi to the main vi without opening and closing the sub vi continuously. The data also needs to be extracted from a while loop within the sub vi.  background info: The sub vi controls a photomultipler tube, which once it is on it is best kept on. The PMT signal is generated in while loop of the sub vi. Attached are some basic vis showing what I’m trying to do.

Thanks

Download All
0 Kudos
Message 1 of 8
(4,859 Views)

Hi Diatom

 

Queues would be good for such as scenario.

0 Kudos
Message 2 of 8
(4,856 Views)

If you are streaming measurements continously I would consider using a circular buffer instead of the queued producer/consumer approach.

 

Check out this implementataion of such a buffer, use only this if your DAQ device does not have an internal circular buffer.

 

https://decibel.ni.com/content/docs/DOC-20403

 

Alternatively if you are using a DAQmx device, consider using the device buffer for sharing DAQ data between loops.

DAQmxBuffer.JPG

 

Br,

 

/Roger

 

0 Kudos
Message 3 of 8
(4,852 Views)

you could use references and refnum controls ....main.png

Message 4 of 8
(4,844 Views)

Thanks to all that replied, your help is appreciated!  I will try using references and property nodes as suggested.

Regards

 

0 Kudos
Message 5 of 8
(4,787 Views)

Do you need to act on all the data? Or are you just concerned with current values?

Certified LabVIEW Architect
Certified Professional Instructor
0 Kudos
Message 6 of 8
(4,784 Views)

Hi

The data will be collected from the PMT for about 3 to 5 minutes, massaged (averaged etc) and then saved for analysis. So the answer is yes all the data will be acted upon.

 

 

0 Kudos
Message 7 of 8
(4,775 Views)

The only reason why I ask is if you use control references that will give you current data and there is a chance you might miss a datapoint.  If acting on every piece of data is important, then queues would be a better approach.  

Certified LabVIEW Architect
Certified Professional Instructor
0 Kudos
Message 8 of 8
(4,764 Views)