Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQ Multiple Waveform Generation

I am trying to output different waveforms on different channels of my NIDAQ 6713. To do this, I am loading a waveform from 5 unique buffers onto each channel (1-5) separately using WFM_Load. However, when I call WFM_Group_Control to start the output, only the channel that I loaded last (channel 5) outputs its waveform. Any ideas? My code is as follows:

for (i = 0; i < 5; i++) {
iStatus = WFM_Scale(1, (i16)i, 3000, iGain, iVolts[i], iVoltsBin[i]);
iStatus = WFM_Load(1, 1, indiv_channels[i], iVoltsBin[i], 3000, iIterations, 1);
}

iStatus = WFM_Rate(iRate, 0, &iTimeBase, &iUpdateInterval);
iStatus = WFM_ClockRate(1, 1, 0, iTimeBase, iUpdateInterval, 0);

iStatus = WFM_Group_Control(1, 1, 1);

Thanks,

Adit Koolwal
0 Kudos
Message 1 of 2
(2,654 Views)
You can only load up one buffer to the card. You need to interleave all 5 buffers into 1 big buffer (hence they all need to be the same length) and just pass one buffer. The buffer should therefore contain

ch0_s0, ch1_s0, ch2_s0, ch3_s0, ch4_s0, ch0_s1, ch1_s1, ch2_s1, ch3_s1, ch4_s1, ...... ch0_sn-1, ch1_sn-1, ch2_sn-1, ch3_sn-1, ch4_sn-1

(where chX_sY is channel X sample Y and n is the number of samples in each individual buffer, they must all be the same size))

And then you only call WFM_Load once. The channels array passed to it should contain all the channels you want to run.

The only odity I've found with this is it appears that both channels (on my 6052E anyway) run at the rate specified in WFM_ClockRate whereas during acquisition, if you
collect on 2 channels, the specified rate is effectively halfed for each channel. This doesn't seem to be documented for analog outputs.

Russell
0 Kudos
Message 2 of 2
(2,654 Views)