Example Code

Counter Input Synchronization with 660x Timing and Digital I/O Device

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 VI provides an example of how to synchronize two counter input tasks on a single 660x Timing and Digital I/O Device.

Description:
The VI would executes in the orders. The VI internally routes a Dummy CO Pulse Frequency Task and uses the Internal Output as a source for the sample clock and the digital trigger.The orders of the execution would be :

  1. Create a Dummy Counter Output Task by reserving one of the counters. This will be used to share the Sample Clock and     Trigger.
  2. Create a Counter Input channel to Count Events.  The Edge parameter is used to determine if the counter will increment    on rising or falling edges.
  3. Call the DAQmx Timing VI (Sample Clock) to configure the sample clock timing parameters .The Sample Clock Source    determines when a sample will be inserted into the buffer.
  4. Create a DAQmx Trigger property node to setup the ArmStart Trigger parameters.
  5. The counter will be continually polled until the Stop button is pressed on the front panel.
  6. Call the Clear Task VI to clear the Task.
  7. Use the popup dialog box to display an error if any.


Steps to Implement or Execute Code:
To implement this example:

  1. Set the Channel 0 and Channel 1 Counter Parameters
  2. (Optional) Set the rest of the parameters as needed
  3. Run the VI
  4. (Optional) Turn on the Highlight Execution to see the flow of the VI

To execute this example:

  1. Install the required software.
  2. Connect the DAQ hardware that supports the Counter features
  3. Confirm the connection with the MAX with TestPanel
  4. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 9.0 or compatible

Hardware
cDAQ with C series Counter Module

 

fp.JPG

 

bd.JPG

 

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

Jason M.
Applications Engineer
National Instruments

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