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

Chapter 5 Introduction to Data Acquisition in LabVIEW

The waveform control can be customized to have many appearances. The DAQ VIs use two common appearances, one to reflect single-point waveforms and one to reflect multi-point waveforms. Figure 5-4 shows these appearances of the waveform control.

Figure 5-4. Waveform Control

Waveform Control Components

The waveform control is a special cluster of components that includes time-domain, uniformly sampled waveform information only. Use the waveform functions to access and manipulate individual components.

Start Time (t0)

The start time is the start time of the first point in the waveform. Use the start time to synchronize plots on a multi-plot waveform graph or to determine delays between waveforms. This value is not used by the Analog Output VIs.

Delta t (dt)

Delta t is the time between successive data points in the waveform. This value is not used by the Analog Output VIs.

Waveform Data (Y)

The waveform data is a 1D array of double-precision numbers that represents the waveform. Generally, the number of data values in the array corresponds directly to the number of scans taken from a data acquisition device. Refer to the Using the Waveform Control section for more information about acquiring and generating waveform data.

Attributes

The attribute component may be used to contain other information about the waveform. You can set attributes with the Set Waveform Attribute function and read attributes with the Get Waveform Attribute function.

© National Instruments Corporation

5-7

LabVIEW Measurements Manual

Chapter 5 Introduction to Data Acquisition in LabVIEW

Using the Waveform Control

There are a number of LabVIEW VIs and primitives that accept, operate on, and/or return waveforms. In addition, you can connect the waveform control wires directly to many LabVIEW controls, including the graph, chart, numeric, and numeric array controls.

The block diagram in Figure 5-5 acquires a waveform from a channel on a data acquisition device, sends it through a Butterworth filter, and plots the resulting waveform on a graph.

Figure 5-5. Using the Waveform Data Type

The AI Acquire Waveform VI takes a number of samples from a channel at a specified scan rate at a particular time. The VI returns a waveform. The probe displays the components of the waveform, which includes the time the acquisition began (t0), the time between successive data points (dt), and the data of a waveform acquired with each scan (Y). The Waveform FIR Filter VI accepts the array of waveforms and automatically filters the data (Y) of each waveform. The waveform graph then plots and displays the waveform.

The waveform control can also be used with single point acquisitions as shown in Figure 5-6. The AI Sample Channel VI takes a single sample from a channel and returns a single-point waveform. The waveform contains the value read from the channel and the time the channel was read. The chart and the temperature controls accept the waveform and display its data. The

LabVIEW Measurements Manual

5-8

www.ni.com

Chapter 5 Introduction to Data Acquisition in LabVIEW

Get Waveform Components function is used to extract the start time from the waveform.

Figure 5-6. Single-Point Example

The waveform control can be used with analog output as shown in Figure 5-7. The Sine Waveform VI generates a sine waveform. The AO Generate Waveform VI sends the waveform to the device.

Figure 5-7. Using the Waveform Control with Analog Output

Extracting Waveform Components

Use the Get Waveform Components function to extract and manipulate the components of a waveform you generate. The VI in Figure 5-8 uses the Get Waveform Components function to extract the waveform data. The Negate function negates the waveform data and plots the results to a graph.

© National Instruments Corporation

5-9

LabVIEW Measurements Manual

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