Programming instructions

©
National Instruments Corporation 27-1 LabVIEW Data Acquisition Basics Manual
27
Counting Signal Highs and Lows
This chapter describes the various ways you can count TTL signals using
the counters on your data acquisition (DAQ) device. Counters can count
external events such as rising and falling edges on the SOURCE (CLK)
input pin. They can also count elapsed time using the rising and falling
edges of an internal timebase. A useful example of counting events would
be if you wanted to calculate the output of a production line. A useful
example of counting time would be if you wanted to calculate how long it
takes to produce one item on a production line.
Connecting Counters to Count Events and Time
Figure 27-1 shows typical external connections for counting events. In the
figure,
your device
provides the TTL signal to be counted, and it is
connected to the SOURCE (CLK) of
counter
. The number of events
counted is determined by reading the count register of
counter
.
Figure 27-1.
External Connections for Counting Events
Figure 27-2 shows typical external connections for counting elapsed
time. In the figure, your device provides a pulse to the GATE of counter.
While the gate pulse is high, counter counts a known internal timebase.
Dividing the count by the internal timebase determines the elapsed time.
Figure 27-2.
External Connections for Counting Elapsed Time