LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hardware triggered analog input with averaging using Multifunction DAQ

hi,
 
I am trying to develop a code to acquire data using DAQcard-6062E. I have to acquire a fixed number of samples upon a hardware analog trigger and then check for the trigger again and if there is a trigger then start acquisition again. i also have to do averaging of the data. I tried to modify some of the example codes to do the averaging but the averaging doen't seem to work. i am attaching the code i am using for reference. can some one please suggest me how to do it...and if there is a problem with the code can some one suggest any modifications i have to do. I am using DAQmx for the code.
 
thanks
jithendra
 
 
0 Kudos
Message 1 of 7
(3,658 Views)

Hello jithendra,

Are you trying to average each of the sets of data you acquire?  Or, are you averaging all of the data?  If the first is what you are doing (I think this is the case), then it would be easier to use the array size and sum functions to perform your averaging instead of using a For Loop.  Try this out.  If you are still seeing problems with the averaging, can you please explain what the problem is?  

Thanks!

Laura 

0 Kudos
Message 2 of 7
(3,638 Views)
Try using the Waveform Measurement VIs located under Signal Processing on the funcions pallete.  There are a number of VIs mad ealready that will average, rms, dc average, etc.

that way you wont have to seperate the signal like you were and make mistakes in the algebra.

Kenny
Kenny

0 Kudos
Message 3 of 7
(3,634 Views)

hello Laura

thanks for the reply. what i am trying to do is, if i specify the number of averages as 10, then it has to acquire  and add 10 1-D arrays of data (the length of each would be equal to the number of samples) and then divide the resultant array by 10. i have to do the averaging because the raw data is noisy and the waveform oscillates, so if i do averaging then i would get stable waveform.

My application is to acquire an analog signal from an Electromagnetic Induction Sensor, as the sensor is moved over a lane of around 100 m long.  The acquisition should start on a analog trigger and continuously acquire data until i reach the end of the lane, and store the data in a file. I also want to do averaging to reduce the noise and stor the averaged data as well.

The trigger signal is a square wave, and the repetition rate of the signal is around 20 Hz (50 % duty cycle). I need to sample at around 50 kHz.

can u suggest me if the method i am using is correct or there is any other way of doin it.

thanks

jithendra

0 Kudos
Message 4 of 7
(3,632 Views)
hi....
 
I need to do acquire an analog input with averaging. An example VI from Labview seems to be doing the job i need. But it doesn't have any averaging in it.
can someone suggest me how to do it.
i have tried some tricks but it is not working
i am attaching the VI that's working for me without averaging.
 
 
thanks
jithendra
 
0 Kudos
Message 5 of 7
(3,625 Views)
hi Kenny,
 
thanks for your suggestion. I tried the Advanced DC-RMS VI to get the averaged data and it seems to work.
 
thank you
jithendra
0 Kudos
Message 6 of 7
(3,618 Views)

Hi jithendra,

I am glad to hear that the VI Kenny suggested worked out for you.  Let us know if you run into any other problems.

Regards,

Laura

0 Kudos
Message 7 of 7
(3,606 Views)