02-23-2016 02:44 PM
I have a data acquisition VI that uses a subVI using DaqMX to take an averaged reading of 10 samples @ 500 S/sec (running approx 27-28ms per averaged sample set) but when my data is saved with the elapsed time between data points it is not consistent.
I only really want to record data at a steady 100ms (10Hz) interval. I've tried putting the sample size to 50 but i end up with 108-110 ms per sample set. I'd rather gather data (sub 50ms collection time) within the 100ms windows and record with the 100ms time stamps.
Any suggestions for achieving this?
02-23-2016 03:06 PM
Looks like I answered my own question.
I simply added a Wait Until Next ms Multiple to the loop and was able to get time stamps in equal intervals.
02-23-2016 03:16 PM
Hi ian,
it seems you (still !) create and delete the DAQmx task with each iteration of the loop, even when you hide the relevant code in the subVI.
Please create the task before the loop, do the DAQmxRead in the loop and clear the task after the loop!
When doing this it is really easy to maintain a constant loop rate as the DAQmxRead will do the timing job…