Example Code

Synchronized Two Counter Input Tasks with Sample Clock Sharing Using LabVIEW with 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

Description

Overview
The example VIs show two possible ways to synchronize counters on the same DAQ device.

 

Description
The counter synch-analog task VI creates a dummy Analog Input task, and use the AI Sample Clock as the clock source for both counters.

The arm start trigger VI is used an Arm Start Trigger for both counters. The Arm Start Trigger is set using a DAQmx Trigger Property node.


Requirements

  • LabVIEW 2012 (or compatible)
  • NI DAQmx 12.0 (or compatible)


Steps to Implement or Execute Code

 

The counter synch-analog task VI:

 

1.Select the channel of Analog Channel Properties control, Counter 0 Channel Properties control and Counter 1 Channel Properties control .

2.Run the VI

 

 The arm start trigger VI:

 

  1. Select the Physical Channel which corresponds to the counter you want to count edges on the DAQ device.
  2. Enter the Initial Count, Count Direction, and measurement Edge to specify how you want the counter to count. Additionally, you can change the input terminal where events are counted using the channel property node.
  3. Run the VI.

 

Additional Information or References

VI Snippet

00.png01.png

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

Regards,

Sara Lewandroski
Applications Engineer | National Instruments

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

Comments
DomenRupnik
Member
Member
on

Can anyone give me reason for error -201314, regards with link bellow: 

http://forums.ni.com/t5/LabVIEW/Why-get-Error-201314-when-measure-two-counters-simultaneously/m-p/32...