Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Error 89137 When trying to make a high frequency measurement.

I am using a PCI-6602 Timer/Counter for multiple measurements on a serial interface...
I have the clock line connected to Gate0, the enable line to Aux0 because I need to make a two-Edge seperation measurement between the two later...
But I also want to make a "Period/Frequency Measurement (High Frequency with Two Counters)" measurement...
This requires that the signal to be measured is on Source0...
I implimented the following Code:
 

void

meas_FP_Freq(float64 *Freq0, float64 *Freq1)

{

TaskHandle CLK0_Freq, CLK1_Freq;

DAQmxCreateTask ("FP_CLK0_Freq", &CLK0_Freq);

DAQmxCreateTask ("FP_CLK1_Freq", &CLK1_Freq);

DAQmxConnectTerms ("/Dev3/PFI38", "/Dev3/Ctr0Source", DAQmx_Val_DoNotInvertPolarity); // Gate0 to Source0, No Error....

DAQmxConnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr1Source", DAQmx_Val_DoNotInvertPolarity);

DAQmxCreateCIFreqChan (CLK0_Freq, "Dev3/ctr0", "", 6000000, 6500000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_HighFreq2Ctr, 0.001, 4, "");  // High freq measurement

DAQmxCreateCIFreqChan (CLK1_Freq, "Dev3/ctr1", "", 6000000, 6500000, DAQmx_Val_Hz, DAQmx_Val_Rising, DAQmx_Val_LowFreq1Ctr, 0.001, 4, "");

DAQmxReadCounterScalarF64 (CLK0_Freq, 3.0, Freq0, 0); // Run-Time Error -89137 Specified Route cannot be satisfied..etc

DAQmxReadCounterScalarF64 (CLK1_Freq, 3.0, Freq1, 0);

DAQmxDisconnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr0Source");

DAQmxDisconnectTerms ("/Dev3/80MHzTimebase", "/Dev3/Ctr1Source");

DAQmxClearTask (CLK0_Freq);

DAQmxClearTask (CLK1_Freq);

}

The "Low Frequency" method works fine, but the resolution is too low...
Every help file I've read indicates I can use different PFI inputs for measurements... What am I missing?
0 Kudos
Message 1 of 2
(3,569 Views)
Hi,
 
The reason that you are getting the error is the PFI lines are being reserved twice. You don't need the DAQmx Connect Terms functions in your code because the DAQmx driver does this for you automatically. If you still receive an error after doing this, try to changing the low frequency counter number.  I hope this helps you with your application.
 
Regards,
Hal L.
0 Kudos
Message 2 of 2
(3,553 Views)