Hello Kenstern,
The data is always interleaved because each card only has a single timing engine for each subsystem.
For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
@kenstern wrote:
For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave. What does the DMA buffer look like ?
With the same frequency for each channel, the data is interleaved, e.g. (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
Update Frequency: 150 KHz
Channels: 2
Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate.