Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

buffered position measurement

Hi I'm using a NI6602 to perform buffered measurements of a position encoder triggered by an external clock signal (I generate it with another counter).

 

The code is at the end.

I'm using /dev1/ctr4 for the position task and /Dev1/ctr6InternalOutput (that I'm generating elsewhere) to trigger the buffered acquisition.

My problem is that when I run the code I get the error below, as if it was pretending to use the internal timebase instead of the A signal of the encoder (the A signal coming through the RTSI1 that I already connected to the Ctr4Source before)

 

 

 

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
Source Device: Dev1
Source Terminal: 80MHzTimebase
Destination Device: Dev1
Destination Terminal: Ctr4Source

Required Resources in Use by
Source Device: Dev1
Source Terminal: RTSI1
Destination Device: Dev1
Destination Terminal: Ctr4Source

Task Name: posTask

Status Code: -89137


Can anyone explain me why is it trying to use the 80MHz signal and put it in the source?

 

Thank you very much in advance.

 

Here is the code snippet:

 

 

posTask = TaskHandle()
positionZidxEnable = bool32(0)
positionZidxVal = float64(0.0)
positionPulsesPerDist = float64(1.0)
positionInitialPos = float64(0.0)     
sampling_freq = 1000  
positionSamplingRate = float64(sampling_freq)
positionSampsPerChanToAcquire = uInt64(detectorTaskPulses)
positionSampsPerChanToRead = int32(10)
positionSampsPerChanRead = int32()
positionReadTimeout = float64(1)

 

self.DAQmxErrChk(nidaqmx.DAQmxCreateTask("posTask",byref(posTask)))

self.DAQmxErrChk(nidaqmx.DAQmxCreateCILinEncoderChan(posTask, '/dev1/ctr4', "PositionChannel", DAQmx_Val_X4, positionZidxEnable, positionZidxVal, DAQmx_Val_AHighBHigh, DAQmx_Val_Ticks, positionPulsesPerDist, positionInitialPos, None))
self.DAQmxErrChk(nidaqmx.DAQmxCfgSampClkTiming(posTask, "/Dev1/ctr6InternalOutput", positionSamplingRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, self.positionSampsPerChanToAcquire))
         

0 Kudos
Message 1 of 1
(5,555 Views)