User manual
Chapter 3 Software Overview
© National Instruments Corporation 3-87 NI-DAQ User Manual for PC Compatibles
Figure 3-32. Pulse-Width Measurement
For time-lapse measurement, configure a counter to count from the
occurrence of some event. For this application, you can use any timebase,
including an external clock connected to the counter SOURCE input. You
can use edge-triggered gating modes if a single counter performs the event
counting and if cont =0in
CTR_EvCount
. In this case, the starting event is
an edge applied to the GATE input of the counter. The time lapse from the
edge is then equal to (event count)
*
(timebase period). If counters are to be
concatenated for time-lapse measurement, use level gating where the
GATE input signal goes active at the starting event and stays active.
Frequency measurement is a special case of event counting; that is, you
can measure the frequency of an input signal by counting the number of
signal edges that occur during a fixed amount of time. For this application,
connect the signal to be measured to the SOURCE input of the counter and
select the appropriate timebase (if ctr = 1, connect the signal to SOURCE1
and use timebase = 6). Count either low-to-high or high-to-low edges (this
feature is selected by edgeMode in the
CTR_Config
function).
Using level gating and applying a gate pulse of a known, fixed duration to
the GATE input of the counter constrains event counting to a fixed amount
of time. The average frequency of the incoming signal is then equal to
(event count)/(gate-pulse width). Another counter can supply the gating
pulse for frequency measurement by connecting the OUT signal from the
counter producing the gating pulse to the GATE input of the counter doing
the counting (see the
CTR_Pulse
function description in the NI-DAQ
Function Reference Online Help file for more information). Figure 3-33
illustrates a frequency measurement.
SOURCE
Timebase
GATE
Pulse
CTR_EvRead
Count
Pulse Width
1
2
3
4
5
6
7
88
8*t1
t1










