Yuri33,
Unfortunately, DAQmx does not yet support change detection on the M-series boards, despite what the M-series datasheets say. This can be confirmed by looking at the online help file for the M-series boards. Otherwise, your idea sounded feasible. Change detection *is* available on the high-speed digital boards such as the 6533 or 6534 though, if you can add a board to your system.
Setting up a timed loop using the change detection pulse sounds like a good idea. However, having never tried it myself, I can't comment on how to do it or whether it's possible. Hopefully someone else can chime in.
As for knowing which digital bit was responsible for the change detection pulse -- you'll need to track that in software by comparing the bit pattern to the previous one, probably using a shift register for storage. If you do your DI Read as a U8, a simple XOR will reveal which bit(s) changed.
I agree that it shouldn't be much problem to synchronize the Analog Input to the counter "timestamping" task. The simplest would be to use the change detection pulse as an external sampling clock to give you a single sample of each analog value whenever a digital bit changes. If you need more analog data than that, then you should be able to let the change detection pulse be a digital trigger. Fortunately you can use the M-series internal timebase for both the counters and the analog input so you can count on them staying in sync.
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.