Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform complete event?

Is there any sort of Waveform Complete event for a continuous waveform generation? That is, an event that would fire at the beginning or end of every repeat of a waveform?

NI-DAQmx 7.4, Win XP, M-series DAQ device, writing in C++.

Thanks!
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 1 of 4
(3,141 Views)
Hello John,

The beginning and the end of the waveform is what you set it to be. The driver has no way of knowing that it is acquiring say, a sine wave or a square wave. It just acquire samples that can be interpreted as waveform with the timing information (sampling rate). To know where the end of the waveform is, you will need to analyse the acquired samples and determine that within the software. This said, if you have a way to externally specify places in the waveform, say like a digital signal, then you may use the corelated DIO capability of the M series to divide your acquired samples into chunks that you call waveforms.
Hope this helps.

SergesL
0 Kudos
Message 2 of 4
(3,129 Views)
Thank you, Serges, but I think you have misunderstood what I'm asking. There are no acquired samples involved- I'm talking about analog output.

I'm generating a repeating waveform from the analog outputs. To start, I give it a buffer of data and specify that it be a continuous generation, but I don't write any further data to the task after the initial buffer. That way, I get a repeating waveform.

What I want is an event or a function call that I can use to know when the waveform generation has recycled to the beginning of the buffer.
John Weeks

WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com
0 Kudos
Message 3 of 4
(3,127 Views)
You can use the timed loop and the DAQmx Create Timing Source (Digital Edge using Counter).vi. Set the source control to your ao/SampleClock and set the edge count control to the number of samples in your waveform. The timed loop will execute whenever that many ao sample clocks have been generated.
0 Kudos
Message 4 of 4
(3,118 Views)