I am trying to synchronize analog input with timestamps for all edges produced by an encoder.
In the DAQ M Series that I was using before, this was nicely achieved as follows:
A counter input task is set to do an implicitly buffered semi-period measurement, and it's Arm Start Trigger
is connected with the analog in sample clock. The cumulative sum of the semi-pulse widths then is directly
the timestamp in timebase ticks of each edge of the encoder, referenced to the start of the AI acquisition.
However, in the DAQ X Series, that method does not work. When doing semi-period measurements, the
counter does not start counting upon the HW Arm Start Trigger, but only on the first edge on the gate signal.
In fact, the documentation says it does start counting, but the count at the first edge is not stored, contrary to
the M Series. Of course, that first edge count does not correspond to a proper semi period measurement
(and the M Series manual correctly states that in most applications it should be discarded), but it is essential
to establish an absolute reference to start of the analog in acquisition.
Is there any way to make the DAQ X series produce that first sample, or achieve the same effect in some other way?
One could of course switch to buffered edge counting with explicit timing (the AI sample clock), but this has two
disadvantages: Since the encoder edges happen much less often than the sample clock, this would be a waste of
data bandwith. Furthermore, using the previously outlined approach, I get sub-sample accurracy, which is
important particularly because the the encoder frequency is low.
Another idea that I was unable to completely work out is to try to trigger the analog in task instead onto that
first encoder edge. I can live with loosing the analog input up to that first encoder edge. However, the problem
here is that I cannot gate the encoder edges. As both the analog input and the counter input tasks effectively
start on "the first encoder edge" (after they have been armed), I need a way to arm them simultanesously to
be sure to start on the same edge for both. Unfortunately, the analog input does not seem to have an arm start trigger.
I am looking forward to hear any suggestion on how to implement this on DAQ X Series.
Thank you in advance,
Yves Delley