02-24-2014 09:46 AM
Hi,
I was wondering if this would be the correct syntax to allow sampling a channel twice in a scan list:
for (row = 1; row < numrows; row++)
{
strRow = getstring(row);
DAQmxCreateAIVoltageChan(task, phychan, strRow, .......);
}
DAQmxAddGlobalChansToTask(task, "1"); // adding row=1 channel to end of scan list
Note that we only need to add one virtual 'row' to task.
Thank you.
02-25-2014 08:12 PM
Hi jharris66
If you want to sample a channel twice I think it's better to configure a continuous aquisiton task and run it just twice.
for (i=1;i<2;i++) {
DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,nSamples,10.0,DAQmx_Val_GroupByScanNumber,gData,nSamples*gNumChannels,&numRead,NULL));
Error:
if( DAQmxFailed(error) ) {
DAQmxGetExtendedErrorInfo(errBuff,2048);
}
This will run twice the analog read intead of re configure the whole task.