Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

6601 Perform Quadrature Encoder Buffered Position Measurement with debouncing filter on trigger signal

1. How can I perform a debouncing filter on trigger signal ?
6601 Quadrature Encoder Buffered Position Measurement  Win XP, Visual Studio 2005 C++, DAQmx 8.3

DAQmxCreateTask(

"Position",&NI_taskHandle);

DAQmxCreateCIAngEncoderChan(NI_taskHandle,

"Dev1/ctr0","",DAQmx_Val_X4,TRUE,0.0,DAQmx_Val_AHighBHigh,DAQmx_Val_Ticks,1024,fTicks,"");

DAQmxCfgSampClkTiming(NI_taskHandle,"/Dev1/PFI34",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1);

2. What is the reason for the Error Code -200141

(Data was overwritten before it could be read by the system.  If Data Transfer Mechanism is Interrupts, try using DMA. Otherwise, divide the input signal before taking the measurement)

Thank you for our help!

0 Kudos
Message 1 of 2
(3,857 Views)
Hello NITester,

There are functions to enable or disable the digital filters for counter/timer devices in NI-DAQmx see the NI-DAQmx C Reference Help at Start » Programs » National Instruments » NI-DAQ (DAQmxSetCI*).
Look at the following link:
Enabling the Digital Filters for Counter/Timer Devices in NI-DAQmx

The error that you are receiving indicates that the software circular buffer of the counter task is full and therefore previous samples were overwritten causing a loss of data. The software buffer size is directly dependant on the mode of operation as well as the acquisition rate. The actual buffer size can be found on page 2-8 of the NI 660x User Manual, which can be found here:
User Manual NI 660x

So, part of the troubleshooting process is to find out what rate you are sampling at and if you are doing finite or continuous sampling on the counter task. This will help us determine what size buffer you currently have and thus if it is likely that we are overflowing this buffer.

Let us know your findings and we will be happy to help you further.

Have a great day!

Applications Engineer
Benjamin
0 Kudos
Message 2 of 2
(3,832 Views)