Hi,
I am facing problem in Resetting/Disabling the Trigger type.
The problem is like - I am doing a Continuous mode Aquisition using DAQmx.
I created a Task and I'm setting an Analog Edge Trigger on one of the
channels of a PCI-4472 card.
After acquirng few samples I STOP the task & I change the Trigger mechanism
to "None" using "DAQmxDisableStartTrig()" function call.
Now when I start the task again to aquire samples with the Start Trigger
Disabled, it gives me an error message as shown below.
Please help me to resolve this bug.
Satish Nair.
****************************************************************
DAQmx Error: Specified route cannot be satisfied, because it requires
resources that are currently in use by another route.
Property: DAQmx_DigEdge_StartTrig_Src
Property: DAQmx_DigEdge_StartTrig_Edge
Source Device: Dev1
Source Terminal: Software
Status Code: -89137
****************************************************************
Below given is the sequence of function calls I'm using:
#################################################################
DAQmxErrChk (DAQmxCreateTask("",taskHandle));
DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,sampsPerChan));
/*** Setting Analog Edge Trigger on one of the channel ****/
DAQmxErrChk(DAQmxCfgAnlgEdgeStartTrig(taskHandle,"Dev1/ai0",DAQmx_Val_Rising,1.0));
/*** Starting the Task ****/
DAQmxErrChk (DAQmxStartTask(taskHandle));
while( !_kbhit() ) {
DAQmxErrChk(DAQmxReadAnalogF64(taskHandle,-1,5.0,0,data,bufferSize,read,NULL));
if( read>0 ) {
totalRead += read;
printf("Acquired %d samples. Total %d\r",read,totalRead);
}
}
printf("\nAcquired %d total samples.\n",totalRead);
/*** Stopping the Task ****/
DAQmxStopTask(taskHandle);
/***** Disable the Start Trigger ******/
DAQmxErrChk(DAQmxDisableStartTrig(taskHandle));
/***** Starting the Task again with no Trigger ****/
DAQmxStartTask(taskHandle);
while( !_kbhit() ) {
DAQmxErrChk
(DAQmxReadAnalogF64(taskHandle,-1,5.0,0,data,bufferSize,read,NULL));
if( read>0 ) {
totalRead += read;
printf("Acquired %d samples. Total %d\r",read,totalRead);
}
}
printf("\nAcquired %d total samples.\n",totalRead);
/***** Stopping the Task ****/
DAQmxErrChk (DAQmxStopTask(taskHandle));
#########################################################################