Programming instructions
Chapter 27 Counting Signal Highs and Lows
©
National Instruments Corporation 27-7 LabVIEW Data Acquisition Basics Manual
This VI initiates the counter to count the number of rising edges of a
TTL signal at the CLK of
counter
. Looking at the diagram, the first call to
ICTR Control loads the count register and sets up
counter
to count down.
The second call to ICTR Control reads the count register. Inside the first
while loop, the count is read until it changes. While the count register has
been previously loaded, the new value is not active until the first edge is
counted on the CLK pin. Once the first edge comes in, the second while
loop takes over and continually reads the count until the
STOP
button is
pressed or an error occurs. Remember that you must externally wire your
signal to be counted to the CLK of counter. For a complete description of
this example, refer to the information found in
Windows»Show VI Info…
.
Counting Elapsed Time
How you count elapsed time depends upon which counter chip is on your
DAQ device. If you are unsure of which chip your DAQ device has, refer
to your hardware documentation.
DAQ-STC
Figure 27-10 shows the Count Time-Easy (DAQ-STC) VI located in
labview\examples\daq\DAQ-STC.llb
. This example uses the
Count Events or Time-Easy VI, which can be found in
Functions»
Data Acquisition»Counter
.
Figure 27-10.
Diagram of Count Time-Easy (DAQ-STC) VI
This VI initiates the counter to count the number of rising edges of a known
internal timebase at the SOURCE of
counter
. The Count Events or Time
VI takes care of dividing the count by the timebase frequency to determine
the
elapsed time
. The counter continues timing until the
STOP
button is










