09-20-2011 04:39 PM
So I have a DAQmx Read in a while loop waiting to acquire 1600 samples at 16,000 KS/s.
So it loops on the order of 100ms.
There are no timers in the while loop, I'm just depending on the continuous Read to keep things going.
I want to time tag the first sample in the data every time the loop executes.
I put a subroutine right before and then right after the Read.
When I chart out the difference between the current and previous reading I get variations on the order of +-100ms peak.
I would have expected to have variations of less than +-1ms.
I think put the Read in timed loop. While the time looks great there appears to be a couple of second lag after changes to the input signal source frequency or amplitude. Not sure what going on there either.
So I need an accurate +-1ms time stamp for this data.
Any ideas?
Thanks,
Mark
09-21-2011 07:03 AM
Just to qualify this. The DAQ is an Ethernet NI-9234.
09-21-2011 09:07 AM
Those peaks can have many different reasons:
- Parallel running threads preemting the CPU
- "Clock uncertainty": Drift between OCX on DAQ device vs. "system time"
- Depending on the way you acquire the "time stamp": Possibly you jitter within the loops iteration so in iteration N, you take it as the first action done in N, in N+1 as last action. This results to somewhere about 200ms (+100). N+2 is again first action, resulting in about 0 ms (-100).
You should consider to read the data as waveform which contains a t0 and delta t.
hope this helps,
Norbert
09-21-2011 09:42 AM
@Norbert B wrote:
Those peaks can have many different reasons:
- Parallel running threads preemting the CPU
- "Clock uncertainty": Drift between OCX on DAQ device vs. "system time"
- Depending on the way you acquire the "time stamp": Possibly you jitter within the loops iteration so in iteration N, you take it as the first action done in N, in N+1 as last action. This results to somewhere about 200ms (+100). N+2 is again first action, resulting in about 0 ms (-100).
You should consider to read the data as waveform which contains a t0 and delta t.
hope this helps,
Norbert
Ditto that!
It is rare that i do not use the Waveform data type.
Ben