Download 660x Register-Level Programmer Manual

Transcript
Chapter 2
General-Purpose Counter/Timers
Event Counting
In event-counting functions, the counter counts events on the Selected
Source input following the software arm. The software arm occurs when
software sets the counter arm bit in the command register. The following
actions are available in event counting:
•
The Selected Source increments or decrements the counter.
•
The Selected Gate indicates when to start and stop counting intervals
or when to save the counter contents to the save register.
•
The software either reads the counter value asynchronously from the
Gi Save register, or it reads the HW Save or SW Save register each time
the hardware latches the counter value. In the latter case, interrupts
notify the software that a save has occurred.
•
AUX_LINE/UP_DOWN controls the direction of the counting.
Simple Event Counting
In simple event counting, the counter counts the number of pulses
occurring on the Selected Source signal after the software arm. Software
can read the counter contents at any time without disturbing the counting
process. Figure 2-1 shows an example of simple event counting in which
the counter counts five events on the Selected Source. The counter
configuration is as follows:
•
Source: external signal
•
Gate: disabled
•
Read from: SW Save register
•
Direction: up
Software Arm
Selected Source
Counter Value
0
1
2
3
4
5
Figure 2-1. Simple Event Counting
© National Instruments Corporation
2-3
660x Register-Level Programmer Manual