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
- LabVIEW 2012 (or compatible)
- LabVIEW FPGA Module
Steps to Implement or Execute Code
- Download the VI
- Run the VI
- Click the "Digital Input" And "Digital Input 2" buttons and see the counts increasing(Optional)
- Replace the digital input control with the source of the digital signal being monitored for an edge.
- Modify the data type used to to initialize the counter so that it is approriately sized to prevent a roll over
Additional Information or References
VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**