Example Code

Counting Analog Rising Edges when Passing Threshold in 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.

    Software

  • LabVIEW

Code and Documents

Attachment

 Overview

This example shows how to count how many times a signal crosses a threshold while increasing only

 

Description

This example shows how to count how many times a signal passes a threshold while increasing only. This means that if the signal crosses the threshold while it is decreasing, this will not be counted.

 

Requirements

LabVIEW Base Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Enter the Threshold value
  2. Enter the Input Signal values
  3. Run the VI
  4. Notice that Counter shows the number of times the signal rises above the Threshold 

 Additional Information or References

VI Block Diagram

10882.PNG

 

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

 
Regards,
Efrain G.
National Instruments
Visit http://www.ni.com/gettingstarted/ for step-by-step help in setting up your system.

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

Comments
JohnCaipa
Member
Member
on

Thanks for the example helped me a lot.

glskinner
Member
Member
on

Thank You greatly for this code...it helped me a lot. But, in order for you to get rising edges you need to switch the two values shown. They're backwards. snip1.png