08-29-2008 09:45 PM - edited 08-29-2008 09:46 PM
Hi suni,
Thanks for clarifying what you need to do. There are a few ways to accomplish this. The first is by using parallel loops which will allow you to decouple the acquisition from the generation. One structure which will work is the producer-consumer loop structure. This article demonstrates how to utilize this design pattern. The producer loop can acquire the data and filter it (or you can use another loop just for the processing) then this filtered data can be passed to the consumer loop which will generate the data.
A second way to work on this problem is to use the lower level DAQmx VIs. You can get a good head start by right clicking on the DAQ Assistant and generating the code within the express VI. All of the configurations will be set already if you do this. There are also many good DAQmx examples in the Example Finder within LabVIEW. Using the DAQmx functions, you can set the first DAQmx Read function to read additional data to compensate for the samples that you will remove from the filtered signal. This can be accomplished by using the Is First Call? function and a case structure around the DAQmx Read VI. Additional information about how to generate code from the DAQ Assistant and basic DAQmx functions can be found here. Hopefully this gives you a few more ideas on how to continue with your application.
Regards,
Kent
Applications Engineer
09-02-2008 11:14 AM
09-03-2008 11:11 AM
Hi suni,
You are correct that this method will not result in simultaneous operations since the data will have to transfered through the queues. However, if you were doing this without queues, you would have to wait for your data to be transferred from function to function according to normal dataflow. The result should be fairly similar to what you were getting before. This is just an idea, you do not have to use it but you could try it to make sure everything works. In addition, you can add all 4 channels to the same queue by either bundling your data into a cluster or building into an array. You can just unbundle it or index it when you retrieve your data.
Regards,
Kent
Applications Engineer
09-09-2008 01:43 PM
Hi
When i used a queue to get the data to the while loop which i have my daqmx write vi and to process with the data that is coming from data aquisition, system responded very slowly ( as the time went by). Is there reson for this?
09-10-2008 02:47 PM
Hi suni,
Depending on how long you are running your program for and how much your processor is working, you may develop a buffer of data. After a period of time this buffer may be large enough for you to notice a slight lag. Depending on your needs, you could retireve all of the data or dump the queue using the other queue functions to reset it. You may also want to consider real time systems.
Regards,
Kent
Applications Engineer