Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

data in "write to file" does not match sample rate

I have set the sample rate to 2000 Hz.  I am writing the analog input to a file.  Let's say that I take data for 5 seconds...I should have 5x2000 = 10,000 lines of data in my output file, but the output file only has about 63 lines of data.  I want to be able to set the sample rate and get the number of lines of output data based on this sample rate and the time of acquisition.
0 Kudos
Message 1 of 2
(2,759 Views)

Well you have put the 'write to measurement file' outside the loop

Hence, only values read of the last iteration of the while loop, are getting saved to the file ( you are also not stroing each iteration's value to an array and writing it finally)

The best thing to do would be to take your 'write to measurement file' inside the while loop and keep appending the read values to the opened/created file

0 Kudos
Message 2 of 2
(2,743 Views)