Overview
This VI allows you to use a counter in order to measure the frequency of an analog signal.
Description
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 VI performs the following:
- Creates an analog input task and utilizes an analog trigger in order to create a digital pulse every time the analog signal crosses a threshold.
- Reads in the analog signal and also routes the generated digital pulse to the source of the counter.
- Reads the number of digital edges that have been generated by the analog comparison event.
- Clears both tasks and displays any errors that have occurred.
Requirements to Run
Software
LabVIEW 8.6 or compatible
DAQmx 8.8 or compatible
Hardware
NI Multifunction DAQ Device with at least two counters that also supports analog triggering.
Steps to Implement or Execute Code
- Download and Unzip the Files Below
- Select an applicable counter and analog input channel on your device
- Select the trigger threshold and hysteresis level
- Run the VI
Additional Images
Block Diagram
Additional Information or References
Measuring the Frequency of an Analog Signal in Hardware
Analog Input Period Counts Using Analog Comparison Event
**This document has been updated to meet the current required format for the NI Code Exchange.**