Roz,
Calling the WFM_Load() function multiple times for multiple channels is useful only if you are not doing double buffering. When you do double buffering, the WFM_DB_Transfer() function requires that the two waveforms be interleaved. The KnowledgeBase linked below discusses this in more detail:
Waveform Generation on Multiple Channels Using PCI E Series BoardsFurthermore, I have included a code snippet that illustrates the process of interleaving the waveforms, etc.
------------------------------------------------------
iStatus = NIDAQMakeBuffer(pdBuffer0, ulCount, WFM_DATA_F64);
iStatus = NIDAQMakeBuffer(pdBuffer1, ulCount, WFM_DATA_I16);
if (iStatus == 0) {
/* If buffer was made correctly, then output it. */
iStatus = WFM_DB_Config(iDevice, iNumChans, piChanVect,
iDBmodeON, iOldDataStop, iPartialTransferStop);
iRetVal = NIDAQErrorHandler(iStatus, "WFM_DB_Config",
iIgnoreWarning);
iStatus = WFM_Group_Setup(iDevice, iNumChans, piChanVect,iGroup);
iRetVal = NIDAQErrorHandler(iStatus, "WFM_Group_Setup",
iIgnoreWarning);
iStatus = WFM_Scale(iDevice, piChanVect[0], ulCount, 1.0, pdBuffer0,piBuffer0);
iRetVal = NIDAQErrorHandler(iStatus, "WFM_Scale",
iIgnoreWarning);
/****************INTERLEAVING OPERATION**************************/
/*For analog output on multiple channels, the data should be interleavedbefore outputting.*/
for (i=0;i
{
piBuffer[2*i]=piBuffer0[i];
piBuffer[2*i+1]=piBuffer1[i];
}
/****************INTERLEAVING OPERATION**************************/
iStatus = WFM_Load(iDevice, iNumChans, piChanVect, piBuffer,ulCountTotal, ulIterations, iFIFOMode);
iRetVal = NIDAQErrorHandler(iStatus, "WFM_Load",
iIgnoreWarning);
iStatus = WFM_Rate(dUpdateRate, iUnits, &iUpdateTB,
&ulUpdateInt);
iRetVal = NIDAQErrorHandler(iStatus, "WFM_Rate",
iIgnoreWarning);
iStatus = WFM_ClockRate(iDevice, iGroup, iWhichClock,
iUpdateTB, ulUpdateInt, iDelayMode);
iRetVal = NIDAQErrorHandler(iStatus, "WFM_ClockRate",
iIgnoreWarning);
printf(" The waveform should be output at a rate of %lf updates/sec.\n", dUpdateRate);
iStatus = WFM_Group_Control(iDevice, iGroup, iOpSTART);
iRetVal = NIDAQErrorHandler(iStatus,
"WFM_Group_Control/START", iIgnoreWarning);
------------------------------------------------------
Good luck with your application.
Spencer S.