Use Counters with NI myDAQ

Updated Jul 15, 2020

Reported In

Hardware

  • myDAQ Student Kit

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

How do I use counters on the NI myDAQ?

Solution

In order to use Counters on your myDAQ device, you will need to install a compatible version of NI-DAQmx Driver (review the version readme) as well as review the information under the Digital I/O (DIO) and Counters/Timers in the NI mDAQ User Guide and Specifications.

Use an NI mDAQ Counter Shipping Example: 
  1. Open LabVIEW and navigate to Help >> Find Examples..., this will open the NI Example Finder
  2. Navigate to the Hardware section at the bottom left of the window
  3. Exapand the drop-down and either click on NI myDAQ and skip to step 8. If NI myDAQ is not available, click Add device...
  4. Once the Configure Example Finder window is open, confirm you are in the Hardware tab
  5. Navigate the left list until you find NI-myDAQ. Highlight this device and click the arrow pointing right. This will populate the section for Devices to find examples for:
  1. Click OK
  2. Once again, navigate to the Hardware section on the bottom left of the NI Example Finder. Expand the drop-down and click NI myDAQ.
  3. Check the box next to Limit result to hardware. This will limit the Browse tab's options to everything that can be used with the NI myDAQ.
  4. Expand Hardware Input and Output >> DAQmx by double clicking on the respective folders
  5. You can expand either the Counter Input or Counter Output folder depending on your needs.
  6. Double click on the VI you want to use. This will open up a completed VI Front Panel to use with your NI myDAQ.

Additional Information

The NI myDAQ counter can be used for nine different counter tasks. These tasks include:
  • Taking an edge count 
  • Measuring frequency 
  • Measuring period
  • Measuring pulse width
  • Measuring two-edge seperation
  • Measuring position from a linear encoder
  • Measuring position from an angular encoder
  • Generating a pulse output
Each of these different tasks will require different inputs to be connected to the three counter terminals of the NI myDAQ.