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

Chapter 6

Analog Input

Hardware Triggering

Hardware triggering lets you set the start time of an acquisition and gather data at a known position in time relative to a trigger signal. External devices produce hardware trigger signals. In LabVIEW, you specify the triggering conditions that must be reached before acquisition begins. When the conditions are met, the acquisition begins. You also can analyze the data before the trigger.

There are two types of hardware triggers: digital and analog. In the following two sections, you will learn about the necessary conditions to start an acquisition with a digital or an analog signal.

Digital Triggering

A digital trigger is usually a transistor-transistor logic (TTL) signal having two discrete levels: a high and a low level. When moving from high to low or low to high, a digital edge is created. There are two types of edges: rising and falling. You can set your analog acquisition to start as a result of the rising or falling edge of your digital trigger signal.

In Figure 6-20, the acquisition begins after the falling edge of the digital trigger signal. Usually, digital trigger signals are connected to

STARTTRIG*, EXTTRIG*, DTRIG, EXT TRIG IN, or PFI pins on your DAQ device. If you want to know which pin your device has, check your hardware manual. The STARTTRIG* and EXTTRIG* pins, which have an asterisk after their names, regard a falling edge signal as a trigger. Make sure you account for this when specifying your triggering conditions.

TTL Signal

Connect to STARTTRIG*, EXTTRIG*,

or DTRIG Pins

Falling Edge of Signal

Data Capture Initiated

Figure 6-20. Diagram of a Digital Trigger

© National Instruments Corporation

6-31

LabVIEW Measurements Manual

Chapter 6

Analog Input

Figure 6-21 shows a timeline of how digital triggering works for post-triggered data acquisition. In this example, an external device sends a trigger, or TTL signal, to your DAQ device. As soon as your DAQ device receives the signal and your trigger conditions are met, your device begins acquiring data.

With NI 406X hardware, start trigger pulses can be generated externally or internally. The following start trigger pulse sources apply:

Software start trigger

External trigger

External

Digital Trigger

DAQ

Device

Signal

Device

DAQ Device waits until digital trigger conditions are met.

Then …

External

Analog Data

DAQ

Device

Device

 

Figure 6-21. Digital Triggering with Your DAQ Device

Digital Triggering Examples

Refer to the Acquire N Scans Digital Trig VI in the examples\daq\ anlogin\anlogin.llb for an example of digital triggering. Open this VI and examine its block diagram. This VI uses the Intermediate VIs to perform a buffered acquisition, where LabVIEW stores data in a memory

LabVIEW Measurements Manual

6-32

www.ni.com

Chapter 6

Analog Input

buffer during acquisition. After the acquisition completes, the VI retrieves all the data from the memory buffer and displays it.

You must tell your device the conditions on which to start acquiring data.

For this example, the choose trigger type Boolean should be set to START OR STOP TRIGGER. Select START & STOP TRIGGER only when you have two triggers: start and stop. In addition, if you use a DAQ device with PFI lines (for example, E Series devices), you can specify the trigger signal condition in the trigger channel control in the analog chan & level cluster.

You can acquire data both before and after a digital trigger signal.

If pretrigger scans is greater than 0, your device acquires data before the triggering conditions are met. It then subtracts the pretrigger scans value from the number of scans to acquire value to determine the number of scans to collect after the triggering conditions are met. If pretrigger scans is 0, you acquire the number of scans to acquire after the triggering conditions are met.

Before you start acquiring data, you must specify in the trigger edge input whether the acquisition is triggered on the rising or falling edge of the digital trigger signal. You also can specify a value for the time limit, the maximum amount of time the VI waits for the trigger and requested data.

The Acquire N Scans Digital Trig VI example holds the data in a memory buffer until your device completes the acquisition. The number of data points you need to acquire must be small enough to fit in memory. This VI views and processes the information only after the acquisition. Refer to the Acquire & Proc N Scans-Trig VI in the examples\daq\anlogin\ anlogin.llb for viewing and processing information during the acquisition. Refer to the Acquire N-Multi-Digital Trig VI in the examples\daq\anlogin\anlogin.llb if you expect multiple digital trigger signals that start multiple acquisitions.

Analog Triggering

You connect analog trigger signals to the analog input channels—the same channels where you connect analog data. Your DAQ device monitors the analog trigger channel until trigger conditions are met. You configure the DAQ device to wait for a certain condition of the analog input signal, such as the signal level or slope (either rising or falling). Once the device identifies the trigger conditions, it starts an acquisition.

© National Instruments Corporation

6-33

LabVIEW Measurements Manual

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