Hi,
I have a NI-SCXI-1600 USB DAQ with some analog inputs, but I think the question is independent from the HW.
I want to sample a set of channels continuously (some hours) at 1000Hz and take the mean for every 50 values, so that I have a effective sample rate of 20Hz per channel. Therefor I set the "DAQmx Sample Clock" to the corresponding inputs and start reading in a infinite loop.
The Problem: I do not want to set the "DAQmx Read" control "Num of Samples ..." to "-1" because I can not guarantee that I get equidistant values (the mean is not taken over the same portion of data).
So I set this input to "50", to disbelieve that the "DAQmx Read" blockade and waits until 50 samples are ready (with 1000Hz sample rate should be ervery 50ms one set ready). To know from experience, that windows xp is not a realtime system, this approach is cool, because the device and the driver buffers the samples (for me it is important that I don't miss data)
BUT: "DAQmx Read" does NOT blockade and wait. The loop is executed as fast as possible and I get more values as I measure (if I slow down the loop e.g. 20ms I get 40Hz data)
How should I solve this? Where is my fault?
thx
M.Tiedje