Controlling The Direction Of Counting; Pulse-Width Measurement - National Instruments cRIO-904 Series User Manual

Embedded compactrio controller with real-time processor and reconfigurable fpga
Table of Contents

Advertisement

The count values returned are the cumulative counts since the counter armed event. That is,
the sample clock does not reset the counter. You can configure the counter to sample on the
rising or falling edge of the sample clock.
The following figure shows an example of buffered edge counting. Notice that counting begins
when the counter is armed, which occurs before the first active edge on Sample Clock.
(Sample on Rising Edge)

Controlling the Direction of Counting

In edge counting applications, the counter can count up or down. You can configure the
counter to do the following:
Always count up
Always count down
Count up when the Counter 0 B input is high; count down when it is low
For information about connecting counter signals, refer to the
section.

Pulse-Width Measurement

In pulse-width measurements, the counter measures the width of a pulse on its Gate input
signal. You can configure the counter to measure the width of high pulses or low pulses on the
Gate signal.
You can route an internal or external periodic clock signal (with a known period) to the Source
input of the counter. The counter counts the number of rising (or falling) edges on the Source
signal while the pulse on the Gate signal is active.
You can calculate the pulse width by multiplying the period of the Source signal by the
number of edges returned by the counter.
A pulse-width measurement will be accurate even if the counter is armed while a pulse train is
in progress. If a counter is armed while the pulse is in the active state, it will wait for the next
transition to the active state to begin the measurement.
Figure 52. Buffered (Sample Clock) Edge Counting
Counter Armed
Sample Clock
SOURCE
Counter Value
Buffer
0
1
2
3
cRIO-904x User Manual | © National Instruments | 79
4
5
6
7
3
3
6
Default Counter/Timer Routing

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents