PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

double buffering in an analog output task in labview ?

Hi,

 

Here is what I need to do:

 

When a signal on an analog input channel rises above a threshold, two waveforms (say Wave1 and Wave2) have to be started (one on each D/A channel).

 

Wave1 is not periodic and is a single pulse of a specific pulsewidth.

Wave 2 is a periodic square wave signal with a specific amplitude, duty-cycle and frequency. This waveform should continue to output until user stops the generation.

 

One way I can get the above results (mainly the analog output), is to use a double buffering scheme (if someone can tell me how it can be done in labview 2012) together with a continuous analog output task.

 

For Wave1, first buffer would contain the pulse  and the second buffer would contain zeros. Then once the generation would have finished with the first buffer (there has to be a way to monitor progress of the analog output), I would fill that buffer with zeros.

 

For Wave2, both buffer would contain square wave pulses and I would not touch these buffers after the start of the task

 

Presently, I start a single analog output task with one channel's buffer containing the pulse and 2nd channel's buffer containg the square wave signal and then once the task is done, setup a new continuous analog output task with first channel's buffer set to zeros and keeping the 2nd channel's buffer the same. The problem is that there is a break in the supposed to be periodic squarewave signal, and this is unacceptable for our experiments where frequency is the main controlling variable.

 

Any inputs are very welcome and highly appreciated.

0 Kudos
Message 1 of 1
(4,919 Views)