Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
LabVIEW-Measurements.pdf
Скачиваний:
61
Добавлен:
29.05.2015
Размер:
3.37 Mб
Скачать

Chapter 10 High-Precision Timing (Counters/Timers)

Counting Signal Highs and Lows

This section describes the various ways you can count TTL signals using the counters on your DAQ device. Counters can count external events such as rising and falling edges on the SOURCE (CLK) input pin. They also can count elapsed time using the rising and falling edges of an internal timebase. An example of counting events is calculating the output of a production line. An example of counting time is calculating how long it takes to produce one item on a production line.

Connecting Counters to Count Events and Time

Figure 10-25 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 10-25. External Connections for Counting Events

Figure 10-26 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 10-26. External Connections for Counting Elapsed Time

Am9513

With the Am9513, you can extend the counting range of a counter by connecting the OUT of one counter to the SOURCE of the next higher order counter (counter+1). This is called cascading counters. By cascading counters you can increase your counting range from a 16-bit counting range of 65,535 to a 32-bit counting range of 4,294,967,295. The Am9513 chip has a set of five counters where higher-order counters can be cascaded. The TIO-10 device has two Am9513 chips for a total of 10 counters. Table 10-2

LabVIEW Measurements Manual

10-30

www.ni.com

Chapter 10 High-Precision Timing (Counters/Timers)

identifies adjacent counters on the Am9513 (one and two chips). This information is useful when cascading counters.

Table 10-2. Adjacent Counters for Counter Chips

Next Lower Counter

Counter

Next Higher Counter

 

 

 

 

 

 

5

1

2

 

 

 

1

2

3

 

 

 

2

3

4

 

 

 

3

4

5

 

 

 

4

5

1

 

 

 

10

6

7

 

 

 

6

7

8

 

 

 

7

8

9

 

 

 

8

9

10

 

 

 

9

10

6

 

 

 

Figure 10-27 shows typical external connections for cascading counters when counting events. Notice that the OUT of counter is connected to the SOURCE of counter+1.

Figure 10-27. External Connections to Cascade Counters for Counting Events

Figure 10-28 shows typical external connections for cascading counters when counting elapsed time. Notice that the OUT of counter is connected to the SOURCE of counter+1.

Figure 10-28. External Connections to Cascade Counters for Counting Elapsed Time

© National Instruments Corporation

10-31

LabVIEW Measurements Manual

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]