03-18-2015 09:19 AM - edited 03-18-2015 09:20 AM
Hi guys,
Currently my DAQ program (inside a while loop) runs at every second. However, there is a problem whereby the fluctuation of values is very big. I used the Mean.vi block to average out the dynamic values. I am not sure the problem is due to my 1s timing or it's due to the mean.vi.
Does anybody knows what is the mistake?
Very much appreciated! :')
Vanessa
03-18-2015 09:28 AM
Hello,
You have configured the DAQ Assistant to acquire data at a sample rate of 1KS/s. You are asking the function to return 100 samples each time you are calling it, so the loop should execute every 100ms, BUT for this you must remove the "Time delay" that you have put in the loop. In this case you will perform an average over 100ms worth of data.
If you want to perform an average each second, configure the DAQ assistant to acquire at 1KS/s and set the "Samples to read" to 1000. Remove the "Time delay" from your code.
Michel
03-18-2015 09:36 AM
You also might want to change the acquisition mode to Continuous Samples. This way the DAQ can be taking data for the next average while you are calculating the current average and logging it. It doesn't seem like much, but it does help the entire system.
03-18-2015 10:31 AM - edited 03-18-2015 10:32 AM
Hi Michel,
I had tried to make the DAQ to obtain 1k samples at 1kHz. However, I never removed the record time at 1s as I wish show show the data in front panel at every second.
The fluctution still present. 😞
Vanessa
03-18-2015 10:33 AM
Hi crossrultz,
I will try the method that you mentioned at get back to you again.
Thanks!
Vanessa
03-19-2015 09:34 AM
Hi Michel,
Is there a way to get an average value (1000 samples at 1000Hz) without removing the 1s time delay? This is because I need the program to run at 1s.
Vanessa
03-19-2015 09:44 AM
03-19-2015 09:45 AM
@VanessaWen wrote:
Hi Michel,
Is there a way to get an average value (1000 samples at 1000Hz) without removing the 1s time delay? This is because I need the program to run at 1s.
Vanessa
The DAQ Assistant will keep your 1 second timing. If you are reading 1 second worth of data, the DAQ Assistant will have to wait for that 1 second for the data to come in.
03-19-2015 06:42 PM
You will get a loop executing each second and performing an average over 1000 samples if:
Michel