Open zougloub opened 2 months ago
There's another issue in AInRead, but since according to this issue AInRead is inappropriate, that issue is kind of moot:
>>> list(range(1,6))
[1, 2, 3, 4, 5]
The range of endpoints is incorrect, so the raw data contains a streak of 31 zeros.
At least on this DAQ, the received packets are 64 bytes of which 31 values, yes, and then there's one 16-bit packet counter.
And two things can happen (they do happen on mine, at least):
So obviously things may not be very reliable if switching channels or looking at a dynamic signal.
Examples:
The way I'm managing to properly acquire (not very portable) is to use this packet counter, and to perform a short dummy acquisition before the real one. This will ensure that the residual packet indices will be in an expected range of values. Doing 5 dummy cycles, which results in remaining packet indices certainly >= 18. Then when doing the real acquisition, for the first 3 cycles, watch for packet index >= 18 and discard those (it's impossible to normally get values >= 18 because best case we have 0..17).