08-29-2011 04:26 AM
Hi,
I am using a USB 6008 as a simple counter.
I am using a relay to pull the counter input to gnd.
However I cant seem to get it to count just one time, ie sometimes it increases the count by one sometimes by 100.
What am I doing wrong, I am using the VI from the example folder and I have attached it below.
Thanks
Tony
08-29-2011 10:55 AM
Tony,
Relay contacts bounce. That bounce may result in multiple openings and closings of the contacts over a few milliseconds for each operation of the relay. The counter can count 100 ns wide pulses at up to 5 MHz so it may see all of the bounces as extra counts. I think the 6008 counter circuit does not include any internal debounce options. So you will need to debounce with external circuits. A simple resistor/capacitor low pass fitler might work, although the counter input circuit may not like the slow rise time. A multivibrator configured as a pulse stretcher is another option. There are many others. Search the web for contact debounce circuits.
Lynn
08-30-2011 05:21 AM
Thanks Johnsold,
I think I have solved it by taking the signal from my daqassist and putting it through a index array to trigger a case structure.
Within the case structure I have placed a delay, which allow time for the contacts to settle before incrementing the counter.
Thanks again.
Tony.
08-30-2011 07:09 AM
Tony,
That is an interesting idea! Always good to have multiple ways to solve a problem.
Lynn
11-03-2011 01:53 PM
Could you please attach example of your solution. How did you manage to make a delay for counter? You used ordinary DI and increment instead of counter input PFI0?