From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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

Retrigger Analog Input with Analog Trigger Using LabVIEW

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 example VI shows how to retrigger a counter task by using the analog comparison event. 


Description
This VI uses the analog comparison event to retrigger a counter task.  The counter output is used as the analog input sample clock.  This allows you to have a retrigger analog input task with an analog edge trigger.


Requirements

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


Steps to Implement or Execute Code

 

  1. Choose the correct resource name for your device.
  2. Select the number of samples and sampling frequency.
  3. Set the counter output to use as the sample clock. Verify that the sample clock source is the PFI line corresponding to the counter used. This can be found in the device pinouts.
  4. Select the analog trigger level and slope that is desired for the trigger.
  5. Run the VI

 

Additional Information or References

NI Snippet

1.png

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

Regards,
Jordan F
National Instruments

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

Comments
pflores
NI Employee (retired)
on

The title says Analog Trigger, but the screenshot looks like the counter task has a Digital Trigger.

hmmmmm...

---

Peter Flores
Applications Engineer
D*
Member
Member
on

The Analog Trigger is configured in the bottom task.  The Analog Trigger circuitry inputs an analog signal and outputs a digital signal based on the Analog Trigger configuration (level, hystersis, etc). That digital output signal can then be used to start any task.  In this example it is routed to trigger the counter in the top task.