Showing results for 
Search instead for 
Did you mean: 

Varying analog output with DAQmx write

I am using a cDAQ-9178 with LabVIEW 2009. 


I am trying to output an array of waveforms to multiple channels that varies with time. The generation of the data is induced by a start trigger of unknown frequency.  Every say 100ms I want the waveform I am outputting to change. So for the first 100ms a certain waveform will be output for each trigger, second 100ms a different one and so on...


As I have my program I am using the sample clock, allowing regeneration, and enabling retriggerable. I have my write operation in a loop that takes the current time and calculates which waveform to use then writes it using DAQmx Write(1D analog wvfm Nchan Nsamp).  The problem is that the amount of time that the write takes varies with the trigger frequency, if the frequency is low, the write takes a very long time(about 2x the trigger frequency), and this means that my timing is wrong and the wrong waveform is being generated for the time. I assume that it is blocking for some reason.


So my question is:


Is there any way to get DAQmx write to execute immediately?



0 Kudos
Message 1 of 2

There are several examples you can modify e.g. the multiple channel analog output with dynamically updated waveform attributes example, output waveforms with varying delays and amplitudes example, update multiple channels of analog output on-the-fly example. Test with one of these and check if it works out correctly.



0 Kudos
Message 2 of 2