Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Trigger Problem

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));
#########################################################################
0 Kudos
Message 1 of 2
(2,776 Views)
Hi Satish Nair,

Thank you for posting this issue on the Discussion Forums!

Task errors when configuring a task from an analog start trigger to no trigger is a known issue and it will be fixed in the next version of DAQmx. As far as workarounds go, you would have to clear and recreate the entire task for this sequence to work.

Best regards,

Chad AE
National Instruments
0 Kudos
Message 2 of 2
(2,747 Views)