Example Code

Period Length Measurements using Zero Crossing Method

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
To take period estimates for data using a zero crossing method

Description:
This code allows the user to take period estimates for data using a zero crossing method. It measures the time gap between rising edges which cross a trigger value. It will function with any wave, but due to lack of hysteresis, noisy signals can false trigger. Signal Conditioning (software or hardware based) smoothing beforehand can minimize this issue.

Steps to implement or execute code
To implement this example:

  1. Run the VI
  2. (Optional) Turn on the Highlight Execution to see the flow of the VI

To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

 

bd.JPGfp.JPG

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

Regards,

Kyle M.
Applications Engineering
National Instruments

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

Comments
shb
Active Participant
Active Participant
on

The shift register of the array is not initialized! When running a 2nd time you will get the new array appended to the previous one.

And there is room for optimisation.