Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering a finite number of finite AO waveforms using a PCIe-6343

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!

 

 

 

0 Kudos
Message 1 of 2
(1,113 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 2
(1,106 Views)