Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting a Leaf switch to a counter

I am a newbie to LabVIEW so bear with me, please.

I connected a switch ( a leaf switch similar to the Power and Reset switch on the front of a Dell OptiPlex GX-110 PC) to the source pin of a counter on my PCI-MIO 16E4 card.

I am using the switch to count events.

Whenever I click (press and release) the switch, it counts more than one, and counts unpredictably (10-100 counts instead of one).

I dont want to use a 555 monostable to output a single pulse and feed that into the counter's source pin.

Is there a way to make the counter ignore the bounces from the switch, so that I can use is in some real and useful applications?

Any help is greatly appreciated. Otherwise I will have to abandon it and switch to my ABB AC31
PLC and use the MOK function....
0 Kudos
Message 1 of 2
(3,116 Views)
Hi Tanveer,

The NI-660x counter/timer cards have programmable debounce filters to prevent this type of behaviour.

However, the E Series cards don't have this debounce filter. I assume that the behaviour of a leaf switch is to switch an output high while the button is pressed and switch an output low while the button is released. If this is correct, then we can use the E Series counters (PCI-MIO-16E-4) to emulate a debounce of sorts. If you set the counter application to be retriggerable pulse generation and set the pulse width to be generated greater than the typical duration of a push button but less than the period before the next push of the button, the we will have created a clean single pulse. You can then route the output of this counter to the
input of the second counter's source and count that. I'm not sure if this will work as I'm not too sure how the leaf switch operates but hopefully it gives you some ideas.

Ron
0 Kudos
Message 2 of 2
(3,116 Views)