01-05-2023 10:35 AM
Some time ago, thanks to help from this discussion forum and elsewhere, I was able to successfully create a task where an incoming pulse train can trigger a finite AO waveform that changes upon each subsequent trigger. The trick, to get an output waveform of N samples per incoming trigger, which may change M times, is to create an output buffer of N x M samples and set the AO task length to M, e.g.:
DAQmxCfgSampClkTiming(taskHandle, "", samplingRateHz, DAQmx_Val_FiniteSamps, N);
DAQmxCfgDigEdgeStartTrig(taskHandle, "PFI1", DAQmx_Val_Rising);
DAQmxSetStartTrigRetriggerable(taskHandle, 1);
and set the buffer length to N x M:
DAQmxSetBufOutputBufSize(taskHandle, N * M);
This very nicely sets up an analog output task where the first N samples are drawn from values 1 through N in the output buffer, the second N samples are drawn from values N + 1 through 2N, etc.
However, at the moment the task asks as a circular buffer and while the N sample waveform output is finite (leaving the output at the Nth value at the end of the task), if I get more than M input triggers, then the task loops back to the beginning of the buffer. The behavior I'd like is for only M finite waveforms to be generated and for any further triggers to be ignored.
I'm not sure if this is beyond the capabilities of a PCIe-6343, but if anyone has ideas (even in LabView), I would very much appreciate them!
01-05-2023 10:54 AM
AFAIK - I believe that is beyond the capabilities of all NI DAQs
There could be some workaround with counters and gating, I will let experts comment on that approach.