Programming instructions
©
National Instruments Corporation 25-1 LabVIEW Data Acquisition Basics Manual
25
Measuring Pulse Width
This chapter describes how you can use a counter to measure pulse width.
There are several reasons you may need to determine pulse width. For
example, if you need to determine the duration of an event, you would want
your application to measure the width of a pulse that occurs during that
event. Another example is determining the interval between two events. In
this case, you would measure the pulse width between the two events. An
example of when you might use this type of application is determining the
time interval between two boxes on a conveyor belt or the time it takes one
box to be processed through an operation. The event would be an edge
every time a box goes by a point, which prompts a digital signal to change
in value.
Measuring a Pulse Width
You can measure an unknown pulse width by counting the number of
pulses of a faster known frequency that occur during the pulse to be
measured. Connect the pulse you want to measure to the GATE input pin
and a signal of known frequency to the SOURCE (CLK) input pin, as
shown in Figure 25-1. The pulse of unknown width (
T
pw
) gates the counter
configured to count a timebase clock of known period (
T
s
). The pulse width
equals the timebase period times the count, or:
T
pw
= T
s
× count
. The
SOURCE (CLK) input can be an external or internal signal.
Figure 25-1.
Counting Input Signals to Determine Pulse Width
GATE
SOURCE
(CLK)
OUT
Count Register
T
s
T
pw
frequency
source










