If you open LabVIEW, click File, New ... (the three dots are important), then choose the From Template, Framework, Design Patterns, Producer/Consumer Design Pattern (Data).
This will show you a Producer, where data are Generated (think a DAQmx structure with a Start DAQ function to the left of the While Loop, a Read DAQ inside, with the data wired to the Queue (make the Queue type the same as the DAQmx output, e.g. 2D Array of Dbl, 1D Array of Waveform, etc.), and Stop DAQ function when the loop exits.
There is a slightly "bad" aspect to this Template. You should (probably) not stop a Producer/Consumer Design by having the Producer kill the Queue, thereby causing an Error to be generated in the Consumer (because there's no Queue and you are trying to do a Dequeue). Yes, this can be used to mean "The Producer has quit", but means you can't meaningfully use the Error line in the Consumer "downstream", such as doing something "inappropriate" in processing the data.
A "better" way is to pass a "Stop" signal from the Producer to the Consumer. For example, if you are sending data from DAQmx, and your Queue element is an Array, you could send an empty Array to the Consumer when the Producer exited (replacing the Release Queue). The Consumer, when it dequeued the data, would add a test for an Empty Array (which takes essentially 0 time) and use the "True" case to mean "Time to Exit", and "False" to mean "Process the data". Now, when the Consumer exits, it knows (a) that the Producer has finished, and no more elements are coming from it, and therefore (b) it is safe, once it exits its While loop, for the Consumer to Release the Queue.
Bob Schor