LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What happens to a queue if nothing is wired to it

Basically I want to record data only when I want to, so I placed my enqueue element block inside a true/false case and wired that to a switch. Switch is on, my clustered daq data enters the queue, switch is off data just passes on to the other side of the while loop. Is this wrong? As far as I can tell it is working, but I cant be sure if it is storing data in a buffer or something and I am not really recording in real time. If I don't enqueue any of my data where does it go after the bundle?

0 Kudos
Message 1 of 7
(2,554 Views)

Can you post your code or show an image of the block diagram?  I do not understand what bundle or buffer you are mentioning.

 

If you put the Enqueue inside a case structure, data is placed in queue only when the case containing the Equeue executes. The loop where the data is dequeued will wait until data is placed into the queue (assuming the default wait forever timeout setting).

 

Lynn

0 Kudos
Message 2 of 7
(2,546 Views)

Not at the moment no, I was just curious. basically I have a single enqueue element block in  my data( actually if you look at my other thread here http://forums.ni.com/t5/LabVIEW/consumer-loop-not-synced-with-producer-getting-less-data-than-I/td-p... I belive the vi attached a few comments up has the single enqueue version, the pictures attached are what I am talking about for sure.) production loop, which has a bundle to cluster wired to it that collects all of my daq streams into a single stream to queue.  I basically put a case structure around the enqueue element block in the first pic in that thread.

0 Kudos
Message 3 of 7
(2,538 Views)

The DAQ Recorder.vi in message 6 of that thread has one Enqueue for the data queue and 3 Enqueues for the strings in the lower loop. In the upper loop you have 2 Dequeues on the data queue and 3 Dequeues for the strings. 

 

Simple math: 1 <> 2 and  3 = 3. 

The first data Dequeue will get all the data from the first iteration of the lower loop. The second Dequeue will wait until the lower loop iterates again to put another cluster of data into the queue. The strings queue is Enqueued and Dequeued 3 times on each iteration of each loop. The data queue will slow down the upper loop. The upper loop will only run one time for each two iterations of the lower loop. The strings queue will eventually overflow because it has six elements enqueued for each three dequeued.

 

I would have only one queue. Put the strings in the cluster with the data. Enqueue one time (and only when the case structure is selected) in the lower loop. Dequeue one time in the upper loop. You may need to sort out the data and write it to the file in the deisred manner.

 

Lynn

0 Kudos
Message 4 of 7
(2,530 Views)

I did that here (see pics) and then to get the data to the tdms I had to chagne ti to concatenate array (which isn't in the pic but is in my new program.

Download All
0 Kudos
Message 5 of 7
(2,520 Views)

With that putting the Enqueue inside a case structure should work.

 

Lynn

Message 6 of 7
(2,515 Views)
Awesome. Thank you for all your help this past week your advice has been incredible.
0 Kudos
Message 7 of 7
(2,510 Views)