Example Programs

Showing results for 
Search instead for 
Did you mean: 

Measure the Frequency of an Analog Signal using a Counter (LabVIEW)


This example demonstrates how to acquire frequency value of analog input



An analog signal can be acquired and analyzed in software to determine its frequency. However, in many situations it is desirable to measure the frequency of an analog signal in hardware. A counter cannot be used to directly measure the frequency of an analog signal. Using an analog comparison event, you can generate a digital trigger that can measure the frequency and period of an analog signal using a counter. This should work with any multifunction DAQ card that has an analog input and 2 counters or more. It builds off of the LabVIEW Example Finder example, Meas Dig Freq-Buffered-Cont-Large Range 2 Ctr.vi.


NI LabVIEW 2012 or compatible

NI-DAQmx 9.0 or compatible


Steps to Implement or Execute Code:

  1. Configure the analog input parameter and counter input parameter
  2. Run the VI





**This document has been updated to meet the current required format for the NI Code Exchange.**




Additional information:


Measuring the Frequency of an Analog Signal in Hardware


Analog Input Period Counts Using Analog Comparison Event


National Instruments
Member NicolasZ


There is a little thing I don't understand about this VI. I can understand the global algorithm, which is to generate an pulse which is trigerred by a certain level and slope (DAQmx Trigger Property Node) and then send it to the counter channel. What I don't understand is :

1 - why do you use a DAQmx Trigger Property Node instead of a normal DAQmx Trigger function ?

2- How the association of this DAQmx Trigger Property Node, the DAQmx Create Counter Frequency Channel  and the DAQmx Channel Property Node works (I mean here what is the role of each one and what is the kind of information transmitted between each-other) ?

3 - The DAQmx Read function is set to read only one DBL per iteration of the while loop, so how can it isolate a frequency ?

Some of those question maybe sound irrelevent, I apologize in advance in such a case.

Member kzamora

When I load this VI, it wants to load another VI by the name of

"Get Terminal Name with Device Prefix.vi"

but it can't find it.

Is this an omission?

Member WenR

Hi kzamora

I can see it has been a while since your comment, but here is a document that might help with that question.