Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Output waveform n-times with DAQmx VIs

Solved!
Go to solution

Hi,

 

I want to output a 1D analogue waveform a specified number of times.

 

The problem is I am converting a program from Labview 7.1 to Labview 9.  In order to do so, the legacy DAQ vis need to be replaced with the modern DAQmx versions.

 

The old 'AO Start' VI allowed the user to wire in the "number of buffer iterations" and it would simply output the given waveform that many times.

There doesn't appear to be any way to do that with the new DAQmx VIs?

 

Other people have said:

 

        "To output a waveform n-times, simply call the 'DAQmx Start Task' VI that many times."

 

This will work, providing the task is stopped before you attempt to start it again - HOWEVER, this does not achieve the function I require for the following reason:

   - There is a delay between the end of the waveform output and the start of the next iteration of that waveform, to the order of 15ms.  This is unacceptable, there should be no delay.

 

        "To output a continuous waveform, just wire the entire desired waveform to the 'DAQmx Write' VI."

 

This is also unacceptable as I am outputting on four channels at 1MHz, with waveform iterations over 100.

 

Does anybody know of a way to output a 1D waveform n-times without the problems mentioned above?

 

Thanks in advance,

Chris.

0 Kudos
Message 1 of 3
(2,986 Views)
Solution
Accepted by topic author ~Chris.>>

Hi Chris,

 

The best way to achieve the functionality you are looking for is to first look at the size of your waveform.  Lets say for example it is 1000 samples.  If you wish to generate this waveform a N amount of cycles, we would need to perform a simple calculation of taking size of waveform array times number of iterations, and set up a finite output task to output that many samples.  So lets say we wish to output 20 cycles of our 1000 sample waveform, we would set up a DAQmx Timing VI for Finite Samples, and the Samples Per Channel to output for the task should be 20,000 samples.  Thus, you will continuously generate 20 cycles of your waveform before exiting and clearing the task. 

 

A good base example to start from can be found here, make the task finite, change the waveform VI to your actual array, and set the Samples Per Channel terminal to the amount calculated in the manner I did above.

Kyle A.
National Instruments
Senior Applications Engineer
0 Kudos
Message 2 of 3
(2,953 Views)

Hey Kyle,

 

That worked a treat, cheers!

 

Kinda obvious now that you've mentioned it, but not very explicit in the documentation.

 

Thanks.

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