Example Code

LabVIEW / Measurement I/O / NI-DAQmx / VI / NI USB-6002 / DAQ / Multifunction Device / Counter

Code and Documents

Attachment

Overview

In the counter, the user has the option to select the input port through DAQmx Global Channel, start/stop and reset the count. The input i.e. square wave of 1 Hz is given by function generator for performance testing.

Description

 Counter in data acquisition devices is used to measure the number of pulses received at the given port. Port <P2.0> and <P1.1> are multiplexed as PFI0 and PFI1, respectively. This can be used as 32-bit counter input or as trigger and clock input.

Hardware and Software Requirements

 NI USB-6002, LabVIEW

Steps to Implement or Execute Code

 1. Connect USB-6002 through USB port.

 2. The input i.e. square wave of 1 Hz is given by function generator for performance testing.

 3. Download NI-DAQmx 18.0.0, Execute sample code "USB6002-counter" and run it.

 4. Press Start button of the counter.

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

Contributors