LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter source for semi period measurement

Hello,
 
I'm quite new to DAQmx in CVI, and I've got a problem with counters programming.
I use an USB6259 board and CVI 8.0.
I use the DAQmxCreateCISemiPeriodChan function to create a task to measure semi periods. I would like to connect an external signal to the counter source, but then I've got this error :
 
 NON-FATAL RUN-TIME ERROR:   "BuffSemi-Period-Finite.c", line 157, col 9, thread id 0x00000AB8:   Function DAQmxStartTask: (return value == -89137 [0xfffea3cf]). Specified route cannot be satisfied, because it requires resources that are currently in use by another route. Property: DAQmx_CI_CtrTimebaseActiveEdge Source Device: Dev1 Source Terminal: 80MHzTimebase Destination Device: Dev1 Destination Terminal: Ctr0Source  Required Resources in Use by Source Device: Dev1 Source Terminal: PFI1 Destination Device: Dev1 Destination Terminal: Ctr0Source  Task Name: _unnamedTask<0>  Status Code: -89137
 
Here is my code :
 
/*********************************************/
  // DAQmx Configure Code
  /*********************************************/
  SetWaitCursor(1);
  
  DAQmxErrChk (DAQmxDisconnectTerms ("/Dev1/80MHzTimebase", "/Dev1/Ctr0Source"));
  DAQmxErrChk (DAQmxConnectTerms ("/Dev1/PFI1", "/Dev1/Ctr0Source", DAQmx_Val_DoNotInvertPolarity));
    
  DAQmxErrChk (DAQmxCreateTask("",&taskHandle));

  DAQmxErrChk (DAQmxCreateCISemiPeriodChan(taskHandle,chan,"",min,max,DAQmx_Val_Ticks,""));
  //DAQmxErrChk (DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_FiniteSamps,samplesToRead)); 
  
  /*********************************************/
  // DAQmx Start Code
  /*********************************************/
  DAQmxErrChk (DAQmxStartTask(taskHandle)); 
 
Is it possible to assign an external signal to counter source when using this function ?
 
Thank you.
0 Kudos
Message 1 of 2
(3,206 Views)
Hello,
Here there is the description of your error:
Regards.
0 Kudos
Message 2 of 2
(3,179 Views)