LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a queue of datatype "Waveform" that contains five channels?

 Hi!

I need to sample five channel data at 2.5 MHz, do some processing and store the processed results in a file. I have created a "Producer-Consumer" loop to do this. The "Producer" produces the data and the "Consumer" does the processing and storing. I am trying to reduce the execution time of the "Producer" loop so that the DAQ buffer does not get overwritten.

I have arrived at the conclusion after lot of experiments that I need to enqueue the five channel data  with the sample size = 41750 samples/channel in the "Producer" loop queue in the format of a "Waveform"/ "2D Double Array"/ "Dynamic Datatype". I can not use "2D Double Array" as I need to extract the time information from one of the channels of the signal. Therefore, my choice seems to be limited to queuing the incoming data either in "Waveform" format or in "Dynamic Datatype" format. I do not want to use "Dynamic Datatype" as it invloves conversions to double that will slow down my loops.

The problem is I am failing to create a queue where the datatype is a "Waveform" of five channels with each channel containing 41750 samples. Can anybody help me out? I would appreciate if you can post the image of a small VI showing just the procedure to obtain the queue.

Thanks a lot in advance for the help.

Regards,
Aninda
0 Kudos
Message 1 of 3
(3,808 Views)
When you use the Obtain Queue function, you need to wire a constant of the correct data type into it that matches the data that will be passed through it.  Rather than trying to guess the exact format of the data (since you aren't certain of whether you are doing waveforms or dynamic data, or will it be an array of waveforms? ....) do this.
 
Run your code once the way you are doing now.  On the output wire out of the DAQ functions, do a right click and create constant.  Now you will have datatype that matches what it is putting out.  Move that constant and wire it into your obtain queue and set up your queue architecture accordingly.
 
Now that constant will contain real data which will take up some memory space.  Once you've got things working, you could go in and edit that constant to clear out some data without changing the underlying structure of the datatype.
Message 2 of 3
(3,786 Views)
Thanks a lot Raven's fan. How stupid of me to not think like that? Let me implement this and run the code.

Regards,
Aninda
0 Kudos
Message 3 of 3
(3,773 Views)