LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initial transient

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

Message Edited by tnek on 08-29-2008 09:46 PM
Message 11 of 15
(931 Views)
Thanks for the reply. If I use producer consumer loop pattern, I have to use a queue to buffer data . I am acquiring data from 4 channels. If I use a queue I can't retrieve data from the queue at once right because queue is FIFO (first in first out). Can I use 4 queues for those four channels of data. Because I want process data in a separate loop (like multiply with gain adding each other) simultaneously. Then use another loop to generate data. And another loop to write to a file.
0 Kudos
Message 12 of 15
(905 Views)

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

Message 13 of 15
(886 Views)

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?

0 Kudos
Message 14 of 15
(856 Views)

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

0 Kudos
Message 15 of 15
(830 Views)