Signal Connections
Chapter 3
AT-MIO-16 User Manual
3-22
© National Instruments Corporation
Figure 3-16 shows connections for a typical event-counting operation in which a switch gates the
counter on and off.
4.7 k
Ω
Signal
Source
Switch
33
DIGGND
Counter
OUT
SOURCE
GATE
+5 V
I/O Connector
AT-MIO-16 Board
Figure 3-16. Event-Counting Application with External Switch Gating
To perform pulse-width measurement, program a counter to be level gated. Apply the pulse to
be measured to the counter GATE input. Program the counter to count while the signal at the
GATE input is either high or low. If the counter is programmed to count an internal timebase,
the pulse width is equal to the counter value multiplied by the timebase period.
For time-lapse measurement, program a counter to be edge gated. Apply an edge to the counter
GATE input to start the counter. You can program the counter to start counting after receiving
either a high-to-low edge or a low-to-high edge. If the counter is programmed to count an
internal timebase, the time lapse since receiving the edge is equal to the counter value multiplied
by the timebase period.
To measure frequency, program a counter to be level gated and to count the rising or falling
edges of a signal applied to a SOURCE input. The gate signal applied to the counter GATE
input is of some known duration. In this case, program the counter to count either rising or
falling edges at the SOURCE input while the gate is applied. The frequency of the input signal is
equal to the count value divided by the known gate period. Figure 3-17 shows the connections
for a frequency measurement application. You could also use a second counter to generate the
gate signal in this application.