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

Chapter 10 High-Precision Timing (Counters/Timers)

Counting Events

How you count events depends upon which counter chip is on your DAQ device. If you are not sure which counter your DAQ device has, refer to your hardware user manual.

TIO-ASIC, DAQ-STC

Open the Count Edges (DAQ-STC) and Count Edges (NI-TIO) VIs in the daq\examples\counter library and study the block diagrams.

Am9513

The Count Events-Easy (9513) VI, available in the examples\daq\ counter\Am9513.llb, uses the Easy VI, Count Events or Time, available on the Functions»Data Acquisition»Counter palette.

This VI initiates the counter to count the number of rising edges of a TTL signal at the SOURCE of counter. The counter continues counting until you click the STOP button. You must externally wire your signal to be counted to the SOURCE of counter. Additionally, you can cascade two counters by choosing two counters (32-bits) in the number of counters to use menu. This extends your counting range to over 4 billion. You must also wire the OUT of counter to the SOURCE of counter+1 for this increased counting range.

If you need more control over when your event counting begins and ends, use the Intermediate VIs instead of the Easy VIs. Refer to the Count Events-Int (9513) VI in the examples\daq\counter\Am9513.llb for an example of using Intermediate VIs for more control over when your event counting begins and ends.

This example uses the Intermediate VIs Event or Time Counter Config, Counter Start, Counter Read, and Counter Stop. The Event or Time Counter Config VI configures counter to count the number of rising edges of a TTL signal at its SOURCE input pin. The Counter Start VI begins the counting operation for counter. The Counter Read VI returns the count until you click the STOP button or an error occurs. Finally, the Counter Stop VI stops the counter operation. You must externally wire your signal to be counted to the SOURCE of counter. You also can gate counter with a pulse to control when it starts and stops counting. To do this, wire your pulse to the GATE of counter, and choose the appropriate gate mode from the front panel menu. Additionally, you can cascade two counters by choosing two counters (32-bits) in the number of counters to use menu. This extends

LabVIEW Measurements Manual

10-32

www.ni.com

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