Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

measure a 20Hz TTL signal frequently

Hello,
I need to calculate the frequency of a TTL signal (0 to 100Hz) very often, in order to record it. I'm looking for a way to obtain this frequency as often as possible, with a 2 digit precision. I've not find out how to do from the NI examples.
Any idea will be welcome.
Thanks.
0 Kudos
Message 1 of 2
(3,169 Views)
Hi C.R.,

You can use any example program that uses buffered period measurement with 1 counter. What happens is that every time your TTL signal goes through 1 period, that value is latched into the buffer. If you have a small buffer, your program will be reading this buffer in quite often. You can then take the inverse of the period measurements to get the frequecy. The advantage of using a buffered period measurement with a counter is that it is continuously getting the instantaneous frequency of each period. By latching into the buffer, you can take an average of the buffer to get a more normalized value. Check the shipping examples of your software package for these examples or go to ni.com/support and click on Example Code link to search for examp
les. Anyway, hope that helps.

Ron
Message 2 of 2
(3,169 Views)