LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generation of Pulses using Analog Output

Hi All,
 
I need a clarification on how the generation of 2 synchronized pulses with a frequency ranging between 10-200 Hz can be done using an AO Card (6722)
 
The no. of Pulses to be generated should be user-Selectable and generation pulses should stop once it reaches the user-Specified Count.
 
As a start point I’m using Basic Function generator.vi.So any suggestions for implementing this in efficient way will be helpful.
 
 Note-The Number pulses is different for each channel but frequency is same (for example like 100 and 50 are the number of pulses to be generated from 1 and 2nd channel, the 2nd channel pulse should stop half the way of 1st channel pulse).
 
Regards,
-Baskar
0 Kudos
Message 1 of 2
(3,045 Views)
Hi Baskar,

First off, what you are trying to do would probably be best accomplished by using counters to create a finite pulse train (Help > Find Examples > Browse > Hardware Input and Output > DAQmx > Generating Digital Pulses).  Each finite pulse train will require the use of 2 counters (one to create the train, one to gate it), so that means ideally you should have 4 counters available, but you don't have that many on the 6722, so you might be able to use a square wave on the AO channels, but it will not have quite the accuracy that you could attain from the counters.

There are already existing examples that can show you how to generate a typical waveform from an analog output.  You can find those examples here: Help > Find Examples > Browse > Hardware Input and Output > DAQmx > Analog Generation > Voltage > Cont Gen Voltage Wfm-Int Clk.vi .   This example can show you how to properly create an Analog Output on one channel.  Since you are trying to use multiple channels you will need to use two of the Waveform Generation VIs and build those two waveforms into one waveform and then write that waveform to your board. 

The buffer that you create will automatically regenerate.  Therefore you can have it stop by using the iteration count in the while loop and stopping the signal after x number of seconds. 

Ideally you should use the counters to generate digital pulse trains, but this technique should help you to get something approaching what you are looking for. 

Regards,
0 Kudos
Message 2 of 2
(3,025 Views)