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

Chapter 6

Analog Input

The scan rate determines how many times per second LabVIEW acquires data from channels. scan rate enables interval scanning (a longer interval between scans than between individual channels

comprising a scan) on devices that support this feature. channel clock rate defines the time between the acquisition of consecutive channels in your channel string. Refer to the Letting an Outside Source Control Your Acquisition Rate section later in this chapter for more information about scan and channel clock rates.

Single-Point Acquisition

This section shows how you can acquire one data point from a single channel and then one data point from each of several channels using LabVIEW.

Single-Channel, Single-Point Analog Input

A single-channel, single-point analog input is an immediate, non-buffered operation. In other words, the software reads one value from an input channel and immediately returns the value. This operation does not require any buffering or timing. Use single-channel, single-point analog input when you need one data point from one channel. An example of this would be if you periodically needed to monitor the fluid level in a tank. You can connect the transducer that produces a voltage representing the fluid level to a single channel on your DAQ device and initiate a single-channel, single-point acquisition whenever you want to know the fluid level.

For most basic operations, use the AI Sample Channel VI, available on the Functions»Data Acquisition»Analog Input palette. The Easy Analog Input VI, AI Sample Channel, measures the signal attached to the channel you specify on your DAQ device and returns the scaled value.

Note If you configured your channel in the DAQ Channel Wizard, you do not need to enter the device or input limits. Instead, enter a channel name in the channel input, and the value returned is relative to the physical units you specified for that channel in the DAQ Channel Wizard. If you specify the input limits, they are treated as being relative to the physical units of the channel. LabVIEW ignores the device input when channel names are used. This principle applies throughout this manual.

Refer to the Acquire 1 Point from 1 Channel VI in the examples\daq\ anlogin\anlogin.llb for an example of how to use the AI Sample Channel VI to acquire data. Open and examine its block diagram.

LabVIEW Measurements Manual

6-14

www.ni.com

Chapter 6

Analog Input

The Acquire 1 Point from 1 Channel VI initiates an A/D conversion on the DAQ device and returns the scaled value as an output. The high limit is the highest expected level of the signals you want to measure. The low limit is the lowest expected level of the signals you want to measure. Refer to the Buffered Waveform Acquisition section later in this chapter for more information about acquiring multiple points from a single channel.

Single-channel acquisition makes acquiring one channel very basic, but what do you do if you need to take more than one channel sample? For example, you might need to monitor the temperature of the fluid as well as the fluid level of the tank. In this case, two transducers must be monitored. You can monitor both transducers using a multiple-channel, single-point acquisition in LabVIEW.

Multiple-Channel, Single-Point Analog Input

With a multiple-channel, single-point read (or scan), LabVIEW returns the value on several channels at once. Use this type of operation when you have multiple transducers to monitor and you want to retrieve data from each transducer at the same time. Your DAQ device executes a scan across each of the specified channels and returns the values when finished.

The Easy I/O VI, AI Sample Channels, acquires single values from multiple channels. The AI Sample Channels VI performs a single A/D conversion on the specified channels and returns the scaled values in a waveform. The expected range for all the signals, specified by high limit and low limit inputs, applies to all the channels. Figure 6-11 shows how to acquire a signal from multiple channels using this VI.

Note Remember to use commas to delimit individual channels in the channel string. Use a colon to indicate an inclusive list of channels.

Figure 6-11. Acquiring a Voltage from Multiple Channels with the AI Sample

Channels VI

© National Instruments Corporation

6-15

LabVIEW Measurements Manual

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