Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Debounce filter for counter input

Hello! 

 

I'm using USB-6221 with the ANSI C library, and want to use debounce filters for the two counter inputs.

As I understand, I should use the functions DAQmxGetCIFreqDigFltrEnable() and DAQmxSetCIFreqDigFltrTimebaseRate().
But I jusst get the error -200452 as result (DAQmxErrorAttributeNotSupportedInTaskContext).

 

I initiate a counter with this, and it works fine:

DAQmxCreateTask("", &Ctr0_Handle);
DAQmxCreateCICountEdgesChan(Ctr0_Handle, "/Dev1/ctr0", "", DAQmx_Val_Rising, 0, DAQmx_Val_CountUp);
DAQmxSetCICountEdgesTerm(Ctr0_Handle, "/Dev1/ctr0", "/TestRigg/PFI12");
DAQmxStartTask(Ctr0_Handle);

Both of these function calls returns error -200452:


DAQmxSetCIFreqDigFltrEnable(Ctr0_Handle, "/Dev1/ctr0", true);
DAQmxSetCIFreqDigFltrTimebaseRate(Ctr0_Handle, "/Dev1/ctr0", 0.00256);

 

 

What am I doing wrong?


Thanks

 

0 Kudos
Message 1 of 2
(4,388 Views)
Hi Halvar,

You actually need to use DAQmxSetDIDigFltrMinPulseWidth and DAQmxSetDIDigFltrEnable functions as shown in the last reply of http://forums.ni.com/ni/board/message?board.id=180&message.id=26267.

Regards, Kate
0 Kudos
Message 2 of 2
(4,204 Views)