Example Code

Using Digital Trigger to Start Digital Tasks

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:

Demonstrates on using a digital trigger to start digital task with an imported or external sample clock.
 
Descriptions:
This VI allows the user to use a digital trigger to start a digital acquisition and also to import a clock using a PFI line.

Requirements:
  1. LabVIEW 2012 or compatible.
  2. NI-DAQmx 15.5.1 or compatible.


Steps to Implement or Execute Code:

  1. Set all the control values on the tab control corresponding to the physical channel at which digital signal is measured, the terminal where the digital signal is used as the source of the trigger and the timing settings.
  2. Run this VI.
  3. Observe the data measured from the indicator on the front panel.


Block Diagram Steps:

  1. Creates Digital Input task to measure digital signal.
  2. Specifies the source of the Sample Clock and other timing configurations.
  3. Specifies the trigger source and its edge.
  4. Displays the data from the digital line in an array.
  5. Stops and clears the task.
  6. Displays any error occurs.

Front Panel.PNG

 

Block Diagram.PNG

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

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