Figure 3-14, Re 3-14 sh – National Instruments PCI-1200 User Manual

Page 46

Advertising
background image

Chapter 3

Signal Connections

PCI-1200 User Manual

3-24

© National Instruments Corporation

Figure 3-14. Event-Counting Application with External Switch Gating

Pulse-width measurement is performed by level gating. The pulse you want
to measure is applied to the counter GATE input. The counter is loaded with
the known count and is programmed to count down while the signal at the
GATE input is high. The pulse width equals the counter difference (loaded
value minus read value) multiplied by the CLK period.

Perform time-lapse measurement by programming a counter to be edge
gated. An edge is applied to the counter GATE input to start the counter.
Program the counter to start counting after receiving a low-to-high edge.
The time lapse since receiving the edge equals the counter value difference
(loaded value minus read value) multiplied by the CLK period.

To perform frequency measurement, program a counter to be level gated
and count the number of falling edges in a signal applied to a CLK input.
The gate signal applied to the counter GATE input is of known duration. In
this case, program the counter to count falling edges at the CLK input while
the gate is applied. The frequency of the input signal then equals the count
value divided by the gate period. Figure 3-15 shows the connections for a
frequency measurement application. You can also use a second counter to

+5 V

I/O Connector

CLK

GATE

OUT

DGND

PCI-1200

Counter (from Group B)

100 k

13

Signal

Source

Switch

Advertising