From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Archived: Approximate Frequency Measurement with USB-600X Simple Edge Counter

Code and Documents

Attachment

Download All

Overview


This document has been archived and is no longer updated by National Instruments.

This application written in LabVIEW 7.1 shows how to use the simple event counter functionality of the USB-600X devices and the computer's timer to calculate an approximate average frequency measurement of the signal on the counter channel. This functionality is not inherently available for the devices.

The operation is as follows:
Steps:
1. Create empty task
2. Create a Counter Input channel to Count Events. The Edge parameter must be set to increment on falling edges.
3. Call the Start VI to arm the counter and begin counting. The counter will be preloaded with the Initial Count.
4. The counter will be continually polled until the Stop button is pressed on the front panel. This will give both counter readings as well as approximate frequency readings.
5. Stop the task
6. Call the Clear Task VI to clear the Task.
7. Use the popup dialog box to display an error if any.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors