I plan to use DAQmxWriteAnalogF64() to output AO to my device. This is part of the code that generate the AO:
// DAQmx Configure Code
DAQmxErrChk (DAQmxCreateTask ("",&taskHandle) );
DAQmxErrChk (DAQmxCreateAOVoltageChan (taskHandle,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL) );
DAQmxErrChk (DAQmxCfgSampClkTiming (taskHandle,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000) );
DAQmxErrChk (DAQmxRegisterDoneEvent (taskHandle,0,DoneCallback,NULL) );
// DAQmx Write Code
DAQmxErrChk (DAQmxWriteAnalogF64 (taskHandle,1000,0,10.0,DAQmx_Val_GroupByChannel,data,NULL,NULL) );
// DAQmx Start Code
DAQmxErrChk (DAQmxStartTask(taskHandle));
Questions:
1. DAQmxCfgSampClkTiming() specifies a number of 1000 samples with a rate of 1000 samples/second. dataLayout is DAQmx_Val_ContSamps, which is generate samples until task is stopped. Does this mean that the input array that I pass into DAQmxWriteAnalogF64() must have a size of 1000? This is single channel.
2. Say if I use a total of 4 channels, each has 1000 samples, then my input array must have a size of 4000, while my sampling rate remains at 1000 samples/second, correct?