To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This example increments a counter when an edge is detected.
Description
The two loops in the provided code demonstrate two functionally identical ways to store the counter value. The top loop demonstrates how to store the counter value in a shift register and the bottom loop demonstrates how to store the counter in a feedback node. The two loops also demonstrate that the use of an inverted input on a compound AND function allows a developer to easily switch between detecting a rising or falling edge.
Requirements to Run
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**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.