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

Chapter 10 High-Precision Timing (Counters/Timers)

Buffered Pulse and Period Measurement

With the TIO-ASIC and DAQ-STC chips, LabVIEW provides a buffer for counter operations. You typically use buffered counter operations when you have a gate signal to trigger a counter several times.

Open the Measure Buffered Pulse (DAQ-STC) and Measure Buffered Pulse (NI-TIO) examples in the examples\daq\counter library and study the block diagrams.

Note If you are using NI-DAQ 6.5 or higher, National Instruments recommends you use the new Advanced Counter VIs, such as Counter Group Config, Counter Get Attribute, Counter Set Attribute, Counter Buffer Read, and Counter Control.

Increasing Your Measurable Width Range

The maximum counting range of a counter and the chosen internal timebase determine how long of a pulse width can be measured. The internal timebase acts as the SOURCE. When measuring the pulse width of a signal, you count the number of source edges that occur during the pulse being measured. The counted number of SOURCE edges cannot exceed the counting range of the counter. Slower internal timebases allow you to measure longer pulse widths, but faster timebases give you a more accurate pulse-width measurement. If you need a slower timebase than is available on your counter as shown in Table 10-1, set up an additional counter for pulse-train generation and use the OUT of that counter as the SOURCE of the counter measuring pulse width.

Table 10-1. Internal Counter Timebases and Their Corresponding Maximum

Pulse Width, Period, or Time Measurements

 

Internal

Maximum

Counter Type

Timebases

Measurement

 

 

 

 

 

 

TIO-ASIC

80 MHz*

53.69 s

 

 

 

 

20 MHz

214.748 s

 

 

 

 

100 kHz

11 h 55 m 49.67 s

 

 

 

DAQ-STC

20 MHz

838 ms

 

 

 

 

100 kHz

167 s

 

 

 

© National Instruments Corporation

10-21

LabVIEW Measurements Manual

Chapter 10 High-Precision Timing (Counters/Timers)

Table 10-1. Internal Counter Timebases and Their Corresponding Maximum

Pulse Width, Period, or Time Measurements (Continued)

 

Internal

Maximum

Counter Type

Timebases

Measurement

 

 

 

 

 

 

Am9513

1 MHz

65 ms

 

 

 

 

100 kHz

655 ms

 

 

 

 

10 kHz

6.5 s

 

 

 

 

1 kHz

65 s

 

 

 

 

100 Hz

655 s

 

 

 

8253/54

2 MHz**

32 ms

 

 

 

 

1 MHz**

65 ms

 

 

 

* Some devices have a maximum timebase of 20 MHz.

** A DAQ device with an 8253/54 counter has one of these internal timebases available on counter 0, but not both.

Measuring Frequency and Period

This section describes the various ways you can measure frequencies and periods of TTL signals using the counters on your DAQ device. One cycle of a signal, known as the period, is measured in units of time, usually seconds. The inverse of period is frequency, which is measured in cycles per second or hertz (Hz). The rate of your signal and the type of counter on your DAQ device determine whether you use frequency or period measurement. An example of when you would want to know the frequency of a signal is if you need to monitor the shaft speed of a motor.

Knowing How and When to Measure Frequency and Period

A common way to measure the frequency of a signal is to measure the number of pulses that occur during a known time period. Figure 10-19 illustrates the measurement of a pulse train of an unknown frequency (fs) by using a pulse of a known width (TG). The frequency of the waveform equals the count divided by the known pulse width (frequency = count/TG). The period is the reciprocal of the measured frequency (period = 1/fs). You typically use frequency measurement for high-frequency signals where the signal to be measured is approaching or faster than the chosen internal timebase.

LabVIEW Measurements Manual

10-22

www.ni.com

Chapter 10 High-Precision Timing (Counters/Timers)

 

 

 

 

 

 

 

GATE

 

OUT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TG

 

 

pulse of known width

 

 

Count Register

 

 

 

 

 

 

 

 

 

 

SOURCE (CLK)

input of unknown frequency, fs

Figure 10-19. Measuring Square Wave Frequency

TIO-ASIC, DAQ-STC, Am9513

For period measurement, you count the number of pulses of a known frequency (fs) during one period of the signal to be measured. As shown in Figure 10-20, the signal of a known frequency is connected to the SOURCE, and the signal to be measured is connected to the GATE. The period is the count divided by the known frequency (TG = count/fs).

GATE

OUT

TG

Count Register

SOURCE

input of known frequency, fs

Figure 10-20. Measuring a Square Wave Period

You typically use period measurement for low-frequency signals where the signal to be measured is significantly slower than the chosen internal timebase. The internal timebases for the TIO-ASIC are 20 MHz, 100 kHz, and a device-specific maximum timebase. The internal timebases for the DAQ-STC are 20 MHz and 100 kHz. The internal timebases for the Am9513 are 1 MHz, 100 kHz, 10 kHz, 1 kHz, and 100 Hz. Whether you use period measurement or frequency measurement, you always can obtain

© National Instruments Corporation

10-23

LabVIEW Measurements Manual

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