LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Analog Voltage Output - Specific Number of Pulses

I am trying to output a specific number of pulses using the analog output.    I am using a USB-6001, which has a maximum sample rate of 5000 Hz.  The pulses I am outputting would have a maximum frequency of 1000 Hz.  For now, I am testing with 100 Hz.

 

I want to accomplish the same output as the Counter - Finite Output.vi Example, where I can specify the actual number of pulses being output (this is different than the number of samples in the AO timing vis).  The pulse needs to be from +/- 5VDC, which is why I am using the analog output and not a DIO output.

 

So far, I am able to configure the Analog output waveform, and determine how many pulses will be output each time the finite output is run.   So lets say I calculate that the number of pulses output would be 10 pulses for each run of the finite output, I would need to run the task 10 times to get 100 pulses.

 

However, when I run the vi and use a counter to read the pulses output, I am only getting a fraction of the expected pulses.  I have also used an oscilloscope to confirm the edge counter, and the AO Output is not putting out the expected (theoretical) output.

 

Am I configuring the task incorrect?

 

 

 

 

 

Kenny

0 Kudos
Message 1 of 3
(2,057 Views)

Your little loop is not waiting for the task to complete.  Therefore, you are likely cutting off your waveform.

 

What you should probably do is turn off the regeneration, start your task before the loop, and write your waveform inside of the loop.  Do not close the task until all of the data has been outputted.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(2,052 Views)

All I had to do was replace the Is task Done.vi with the Wait until Done.vi and it worked.

 

Thanks for the hint.

Kenny

0 Kudos
Message 3 of 3
(2,050 Views)