From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Continuous Analog Acquisition That Logs Data After Receiving Digital Pulse

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 sends a digital trigger to a counter line that will trigger your VI to begin logging data from your continuous analog acquisition task. 

  

Description

  1. Create one analog input task and one counter input task.
  2. Configures the sample clock for the analog input task.
  3. Begin the acquisition of the counter then the analog input.
  4. Continually reads the data until the counter sees a rising edge then the analog input data is logged to file.
  5. Clears the task, merges errors, and reports any errors that occurred.

Requirements

Software

  • LabVIEW 2012 or compatible
  • NI-DAQmx 9.5.5 or compatible

Hardware

  • NI Multifunction DAQ Device with at least one counter

Steps to Implement or Execute Code

  1. Download the VI
  2. Select the following controls on the front panel
    • Physical channel of analog input
    • Counter channel
    • Sample rate
    • Maximum value
    • Minimum value
  3. Run the VI
  4. See log file for data after running VI

Additional Information or References

搜狗截图17年01月07日1337_1.png

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

Adam
Academic Product Manager
National Intruments

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