LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-9208 Data Acquistion with steady intervals.

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?

 

Capture.JPG

 

 

0 Kudos
Message 1 of 3
(2,893 Views)

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.

0 Kudos
Message 2 of 3
(2,885 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 3
(2,872 Views)