07-07-2005 08:54 AM
07-07-2005 09:00 AM
07-08-2005 12:09 PM
07-11-2005 07:25 AM
07-13-2005 12:49 PM
07-14-2005 09:46 AM
07-15-2005 11:04 AM
joubiyann,
I would recommend using the Producer/consumer (data) architecture rather than the parallel loops architecture for what you are trying to do. The way this would work is that the data you acquire would be queued in the producer loop and then the consumer loop (in parallel) would obtain that data from the queue and process it. This way each loop can run at it's own speed but the data is still processed in the order that it's acquired. The template for this architecture is located under VI from Template>>Frameworks>>Design Patterns in the template dialog window. There are two versions, data and events, but I recommend using the data version.
Have a good one!
07-15-2005 11:47 AM
07-15-2005 01:02 PM
This scheme is a great way to avoid buffer overflow because the reads are more deterministic and can be scheduled to prevent buffer overflow. However it should probably be noted that this scheme may add complexity to the processing. The queue acts like a flexible array of data. This data can be anything. Most likely if you are reading from your soundcard (a guess), you’ll want a queue of 1D or 2D arrays. So the queue acts like a 2D or 3D array of sorts. In that rather than one long continuous stream of 1D or 2D data, the queue contains array elements that are <number of values read> long. This is not a big deal if you are treating each read as a separate entity; like taking the mean or RMS of each reading. But if you want to treat your data as a continuous stream; like you want to take 2048 point running fft’s and are reading 10,000 points at a time. Then you have to de-queue your data into a ring buffer or at the very least grab your data in the appropriate sized chunks.
For your sample rates and real-time nature of your processing, you really want to use a ring buffer if you want to reconstruct the data stream, “insert into array” and “delete from array” will kill you.
I’d love to hear that I’m wrong about queues, but that’s the way I’ve always used them (as “hold anything” arrays of sorts).