07-21-2014 03:22 PM
hello,
i am new to labview and would appreciate help with a sampling rate issue.
I am using two different daqs to obtain data. in the program, i need to read data out at a rate of 1 sample a second, and then the data is written to a file every minute. right now, no matter how i set the sample clock, it reads at slightly slower than one sample a second, and it gets progressively slower and slower as the program runs. Is there a way to time the read vi to read data once a second? or is this an issue with needing to synchronize the two different daqs i am using onto the same clock?
attached is the program
thanks!
07-21-2014 03:55 PM
Hi,
One sample per second is pretty low, so you have lots of options. You could replace the inner "for" loop which executes 60 times with a "timed while loop" with a period of one second. If the loop is already slower than one second, something inside may be taking too long. In general, with DAQmx, best practice is to setup the task outside the loop and only call read or write inside it. The multiple places you setup a task inside the loop may be reducing the overall loop rate below 1 hz. In your case, I think you can setup all your tasks, including AI/AO, Sample Clock, Start at the beginning and move Stop and Clear to the end when the whole program is ending.
Good luck!
07-21-2014 05:03 PM