Dear All,
I am generating a pulse train using a 6602 card on Ctr0. I use Ctr1 to read the number of counts from the 80MHz source gated by this Ctr0.
I get an error when starting the Counting process on Ctr1 when calling the DAQmxStartTask function:
error -89120 Source terminal to be routed could not be found on the device.
I start Ctr0 without any problem, by using the StartPulseGeneration (see below), but I get into trouble for the second stage, when reading counter1.
Here is my code. Thank you in advance for your help.
*******************************************************************************************************************
Private Sub StartPulseGeneration ()
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask("", taskHandle)
'Create Counter Channel for pulse generation
DAQmxCreateCOPulseChanFreq(taskHandle, “Dev1/ctr0”, "coChannel", DAQmx_Val_FrequencyUnits2_Hz, DAQmx_Val_Level1_Low, 0#, 200, (dutyCycle / 100))
'Specify continuous timing
DAQmxCfgImplicitTiming(taskHandle, DAQmx_Val_AcquisitionType_ContSamps, 100)
'Start generating the pulse train
DAQmxStartTask (taskHandle)
End Sub
Private Sub StartCounting()
DAQmxCreateTask("", taskHandleTS)
DAQmxCreateCICountEdgesChan(taskHandleTS, "Dev1/ctr1", "mychan", _
DAQmx_Val_Edge1_Rising, 0, DAQmx_Val_CountDirection1_CountUp)
DAQmxCfgSampClkTiming(taskHandleTS, "/Dev1/Ctr0InternalOutput", 1, DAQmx_Val_Rising, _DAQmx_Val_AcquisitionType_ContSamps, 10000)
DAQmxSetCICountEdgesTerm(taskHandleTS, "Dev1/ctr1", "/Dev1/80MHz Timebase")
DAQmxStartTask(taskHandleTS)
End Sub
*******************************************************************************************************************