Configuring a Counter to Measure Frequency
- Updated2025-04-03
- 3 minute(s) read
You can configure a counter to measure the frequency of a signal connected to the channel. The counter counts the number of rising or falling signal edges during the length of the Frequency Timebase, divides that number by the Frequency Timebase in µs, and returns the frequency in kHz.
You can configure the following options for a frequency measurement counter.
Input Filter
You can add an input filter to all input channels of the module. A filter removes noise, glitches, and spikes on inputs by rejecting signals with periods shorter than the specified length. You can select one of the following options.
Measurement Edge
Frequency Timebase
Selecting a Frequency Timebase is a tradeoff between resolution and response speed. A shorter timebase provides lower resolution but the data it returns is more up to date. A longer timebase provides higher resolution but may lag behind or miss changes in signal frequency. The guidelines below for selecting a timebase for different frequency ranges will result in a maximum error of approximately 1%. If you require higher resolution and can tolerate less frequent updates, use a longer timebase than indicated.
Frequency Measurement Example
Refer to the Frequency Measurement (Host) VI in the labview\examples\CompactRIO\NI Scan Engine\Advanced\Specialty Digital Configuration - Counter Mode\Specialty Digital Configuration - Counter Mode.lvproj for an example of frequency measurement. The example uses an NI 9401, but you can modify it to use a different digital input module.