Example Code

Detect Edge Analog Waveform

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.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This example illustrates a very simple threshold technique.

 

Description

This simple VI displays how to detect when the analog waveform passes a certain threshold.  It has three options, a rising edge detection, a falling edge detection and then anytime the value passes through the threshold.  The important part of this VI is that the true value only occurs only for the iteration that the threshold is passed.  This is valuable if you are controlling cases that you only want to occur at the moment the threshold is passed, without worrying about what happens after that.

An interesting challenge would be to add hysteresis to this to help avoid false detections due to noise.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download and run.
  2. Exercise the Detection Type and Threshold controls.

 

Additional Information or References

 

Front Panel

undefined
VI Snippet
undefined

 

 

**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.

Tariff Impact Update Learn more