To download NI software, including the products shown below, visit ni.com/downloads.
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
Steps to Implement or Execute Code
Additional Information or References
Front Panel
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.