LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxAddGlobalChansToTask to allow scanning channel twice

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.

0 Kudos
Message 1 of 2
(3,773 Views)

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.

 

Chris S.
0 Kudos
Message 2 of 2
(3,741 Views)