From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Bufffered event counting - how to debounce external sample clock?

Hi

I am using buffered event counting with a NI-DAQ USB 6211. My count clock is the onboard square wave generator (freqout, PFI6 pin,that I have connected to PFI0.) I have an external clock coming from an encoder that I use as sample clock, connected to PFI1. The objective is to get count readings at each encoder pulse.

I get sporadic sets of tens of samples where the count value has not changed, as if there were spikes in my encoder signal. But I already observed the encoder signal at these situations and it is clean.

I enabled the digital filters for the counter task, but I get the impression that the filters only filter the count clock and not the sample clock. My sample clock signal has a width of about 40 microseconds, but I still get samples when setting the filter to 2.56 ms minimum pulse width. These samples are with zero count, beacuse it is filtering the count clock signal, but the sample clock is not filtered. Although I am not able to see any spikes in this signal, I would like to filter it to try if that solves something.

 

So...how do I enable filtering for the sample clock?

 

I can't use the other counter, because I am using that one to do exactly the same with another encoder...with the same problems.

Thank you very much in advance

Regards

0 Kudos
Message 1 of 5
(3,233 Views)

Hi Helder,

 

I just want to reiterate what you need :

 

You want to pick the counter value on each pulse of an external clock (here, your encoder) wired to the PFI 1, OK.

 

But, what frequency do you need ? 250kHz ?

Is your signal from this encoder noisy ? Why do yo have to filter it ?

 

Regards,

 

 

 

0 Kudos
Message 2 of 5
(3,219 Views)

Each input terminal should have a separate property to enable or disable digital filtering.

 

You'll want to set the following DAQmx Timing Property to enable the digital filter for your sample clock:

2012-04-10_143817.png

 

 

You probably do not need to use the digital filter for the signal you are counting coming from freqout.  You can actually route this internally if you want by specifying the counter's source with yet another property node:

 

2012-04-10_144013.png

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 5
(3,213 Views)

Dear Mathieu

 

Thank you for your reply.

 

You are right, I want to take a counter value at each pulse. The encoder siognal seems not to be noisy, but in fact once in a while I get multiple samples which are not triggered by the encoder (the encopder frequency is much lower). That's why i would like to try to deboun de the encoder signal to see if this solves something.

 

I think the next reply I got is what I need

 

Regards

Helder

 

0 Kudos
Message 4 of 5
(3,200 Views)

Dear John

 

I have to see when i get the time to try this out, but I think this is EXACTLY the information I was looking for.

 

Thank you very very much.

 

Regards

Helder

0 Kudos
Message 5 of 5
(3,199 Views)