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

Continuous Buffered Counter Input Period Measurement using DAQmx

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview:
Demonstrates on using NI-DAQmx API to measure the period of buffered counter input.

Description:
The counter will measure period on the input terminal of the counter specified in the Physical Channel I/O control.  To determine the default counter pins of a device or to set a different source (or gate) pin, refer to the Connecting Counter Signals topic in the NI-DAQmx Help (search for "Connecting Counter Signals").

Requirements:
LabVIEW 2012 or compatible.
NI-DAQmx 15.5.1 or compatible.

Steps to Implement or Execute Code:
1. Select the Physical Channel which corresponds to the counter you want to measure period on the DAQ device.
2. Enter the Maximum and Minimum Value to specify the range or your unknown periods. Additionally, you can change the input terminal where the period is measured using the channel property node.
Note: It is important to set the Maximum and Minimum Values of your unknown period as accurately as possible so the best internal timebase can be chosen to minimize measurement error.
3. Run this VI and monitor the period readings on the Data indicator.  

2017-05-15_11-00-49.jpg

 

2017-05-15_11-00-27.jpg

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

John Passiak

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