Example Code

Two-Edge Separation Measurement

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 FPGA Module
  • LabVIEW

Code and Documents

Attachment

Overview

The example demonstrates how to performs a two edge separation measurement between two boolean controls.

 

Description

A two-edge separation measurement measures the time between the rising or falling edge of a signal and the rising or falling edge of another signal.

The example implements a two-edge separation measurement that can be used either in a Single-Cycle Timed Loop (SCTL) or a While Loop on any FPGA with at least two digital inputs.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • LabVIEW 2012 FPGA Module (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Run the VI
  3. Push the Input0 and then Input1 button to calculate the edge-separation in ticks

 

Additional Information or References

Two-Edge Separation - Front Panel.png

 

Two-Edge Separation - Block Diagram.png

 

SubVI:

Two-Edge Separation SubVI - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Dan
Applications Engineering
National Instruments

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