Example Code

Pulse Width Measurement Using An Express VI

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.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview:
Demonstrates on measuring the pulse width of square wave using Timing and Transition Measurements Express VI.

Description:
In this example, Simulate Signal Express VI is used to generate simulated signal which is then will be measured using Timing and Transition Measurements Express VI.
The Express VI is helpful to perform timing and transition measurements, such as frequency, period or duty cycle using a device that does not have a counter.

Requirements:
LabVIEW 2012 or compatible.
NI-DAQmx 15.5.1 or compatible.

Steps to Implement or Execute Code:
  1. To simulate a signal to be measured, double click on the Simulate Signal Express VI and configure the options available.
  2. Run this VI.
  3. Verify the signal generated on the Waveform Graph and the Pulse Width measurement from the indicators.
  4. Should you wish to change the type of measurement, click on the Timing and Transition Measurements Express VI to configure.


Block Diagram Steps:

  1. Drop a Simulate Signal Express VI on the block diagram. Configure the simulated signal to be measured. You may redefine the configuration by double-clicking on the VI. To check the settings, simply hover the cursor to the VI and press Ctrl +H.
    In this example, the type of signal to be generated is a square wave.
  2. Performs timing measurements using Timing and Transition Measurements. In this example, measurement taken is the Pulse Duration.
  3. Displays any error occurs.
     
    2017-05-23_10-12-16.jpg

 
2017-05-23_10-12-00.jpg
**This document has been updated to meet the current required format for the NI Code Exchange.**
Adri Kruger
National Instruments
LabVIEW Product Marketing

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

Comments
Todd S.
NI Employee (retired)
on

Great stuff!!!

Todd S.
LabVIEW Community Manager
National Instruments