Example Code

Count Digital Events with Option to Reset Counter 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

This example demonstrate how to reset counter manually using boolean control.

 

Description

The attached VI will allow the user to count digital events with the added feature of resetting the counter.  In order to reset the counter, the task must be stopped and then re-started.  This is accomplished with a boolean control and a case structure, which will programmatically stop and start the task when the boolean control is enabled. The attached code is for both LabVIEW and C#.

 

Requirement

LabVIEW 8.0 or compatible
NI-DAQmx 8.9 or compatible

 

Steps
1. Configure the physical channel and other parameter.
2. Run the VI.
3. To reset counter, press boolean control Reset Counter

 

scfp-6576.jpg

 

Additional Information or References

VI Snippet

snippet.png

 

 

 

Regards,

Sara Lewandroski
Applications Engineer | National Instruments

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