3-20
|
ni.com
Chapter 3
Counter Input
Channel Settings
By default, the counter:
•
measures pulses on a default PFI terminal. Refer to Chapter 5,
more information.
•
measures a high pulse. That is, the counter begins measuring the time from a rising edge to
the next falling edge.
•
teturns the measurement in the unit of seconds.
You can change these behaviors by configuring DAQmx Channel properties:
•
CI.PulseWidth.Term—The signal-to-measure comes from an input terminal. To change the
signal-to-measure, set this property to a different terminal.
•
CI.PulseWidth.StartingEdge—Specifies on which edge, rising or falling, to begin the
measurement.
•
CI.PulseWidth.Units—Specifies the units of the measurement.
Timing Settings
The timing settings determine when the device measures the signal. Figure 3-20 shows an
example of On-Demand timing.
On-Demand (No sample clock)
By default, the counter uses On-Demand timing. The following sequence of events describe On
Demand timing:
1.
Software calls DAQmx Start Task.
2.
The device measures the first full pulse on the signal-to-measure.
3.
The device waits until you call DAQmx Read. The device ignores the signal-to-measure
while waiting.
4.
The device returns the measurement.
5.
The device then measures the next full pulse on the signal-to-measure.
6.
Steps 3,4, and 5 are repeated.
Implicit
With Implicit timing, the device measures the time of every pulse on the signal-to-measure. The
measurements are stored in a buffer. Each call to DAQmx Read returns values from this buffer.
Figure 3-21 shows an example of Implicit timing.