Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is my counter counting twice ?

I have just recently purchased a NI 6601, and am trying to resolve the following issue.

I am using the NI-DAQ C API to program the card. I set up one timer for pulse generation to output a 5Hz signal, and send the output of that timer into both the source and gate inputs of a counter (using it an an external timing source as well). Basically, I want this second timer to simply count the number of pulses it receives. But when I read the points from it, instead of getting the expected

1
2
3
4
5

I get
1
3
5
7

It seems as though it is counting on both the rising and falling edge of the gate input. What am I doing wrong or overlooking?
0 Kudos
Message 1 of 3
(3,333 Views)
i had this problem once and found that it was because my pulse signal was not properly terminated. you can check for this by taking the pulse output and looking at the quality of the pulse on a fast oscilloscope. adding a 50 ohm terminator solved the problem for me.

hope this helps.
0 Kudos
Message 2 of 3
(3,330 Views)
I would guess that one of two things is happening. Typically when you connect the output of a counter to the SOURCE pin, you connect the TC signal, which would give a pulse on every edge (rising and falling) of the pulse you are generating. If that's the case, then it makes sense that you'd be getting two counts on each measurement. Another possibility is that there is a slight race condition with the pulses arriving on the source and gate pins in which case you could possibly be missing every other GATE. I'm not so sure about the second one. What version of NI-DAQ are you using?

I hope this helps!
gus....
0 Kudos
Message 3 of 3
(3,315 Views)