My project has a voltage signal repeating at 4 KHz, which is a group of 4 succeeding signals. The group repeat at 1 KHz (a b c d a b c d a b c d....).
The sampling clock will be a few MHz so that I can take n samples per trigger and average them.
If I just use a retriggerable AI task at 4 KHz, I won't be able to tell those four apart.
I also have a 1 KHz trigger that marks the beginning of each group, which can be read by a DI task (rising edge).
Is there a way to somehow sync the AI and DI task so that I can tell the four signals apart ?
Thanks in advance !
What is 4 kHz? The a-b-c-d pattern repetition rate, or the frequency of the indivudal signals? Why should the samples be averaged? What kind of signals are we talking? Please be more specific.
It'll also help to know what DAQ hardware you have for this app.
I'd normally *want* to approach this with a retriggerable AI task, but I'm not sure that's gonna be able to work out here. The problem will be the fast turnaround time you'd need after capturing one trigger's worth of data. Ideally, you'd want to capture nearly a full msec worth of data but the closer you get to that full msec, the less time you have to retrieve one trigger's data before the next trigger arrives. You're always gonna be trying to do this in a fairly small fraction of a msec, and I wouldn't be confident that this would work reliably under Windows.
Instead, I'd probably capture the trigger signal as an additional AI channel in the same task. Then I'd collect many triggers worth of data all at once and post-process to find the trigger instants and split up the data correspondingly.
P.S. Nothing in the original description made it sound like a DI task would be of any particular benefit, hence no discussion of syncing AI and DI tasks.