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

Chapter 4 Example Measurements

Refer to Application Note 048, Signal Conditioning Fundamentals for PC-Based Data Acquisition Systems, available on the National Instruments Web site at zone.ni.com/appnotes.nsf/, for more information about hardware signal conditioning.

The examples that follow show the data acquisition system, the typical signal being acquired, a sketch of how to physically connect the transducer involved, and LabVIEW diagrams of how to acquire the signal.

Single-Point Acquisition Example

Figure 4-1 shows a simple data acquisition system for DC measurements using an anemometer to measure wind speed.

Figure 4-1. Simple Data Acquisition System

In this example, you take a single wind-speed measurement. In the Averaging a Scan Example section, you apply some simple software signal conditioning to improve our measurement.

Figure 4-2 shows what the actual wind speed might be at a given time.

29 (mph)

speed

time

Figure 4-2. Wind Speed

LabVIEW Measurements Manual

4-2

www.ni.com

Chapter 4 Example Measurements

Figure 4-3 shows a typical wiring diagram for an anemometer with an output range of 0 to 10 V, which corresponds to wind speed from

0 to 200 mph. This means that in software, you will need to scale the data using the following formula:

anemometer reading (V) × 20 (mph/V) = wind speed (mph)

(4-1)

Notice the use of a resistor, R, because an anemometer is usually not a grounded signal source. If the anemometer transducer were already grounded, using R would cause a ground loop and result in erroneous readings. Refer to Chapter 6, Analog Input, for more information about grounded and floating signal sources.

Figure 4-3. Anemometer Wiring

Figure 4-4 shows the block diagram needed to measure the wind speed. In this diagram, device is the number assigned to the plug-in DAQ device during configuration. Channel is the analog input channel the anemometer is wired to. The high limit and low limit values show the expected voltage range. This range determines the amount of gain the DAQ device will apply. AI Sample Channel is the DAQ subVI that acquires a single value, in this case raw voltage. The scaling value of 20 mph/V is used to scale the input voltage range of 0 to 10 V to the wind speed range of 0 to 200 mph according to Equation 4-1.

Figure 4-4. Measuring Voltage and Scaling to Wind Speed

© National Instruments Corporation

4-3

LabVIEW Measurements Manual

Chapter 4 Example Measurements

You can simplify this block diagram by using DAQ Named Channels. Refer to Chapter 3, Installing and Configuring Your Measurement Hardware, for more information about DAQ Named Channels.

Figure 4-5 shows the LabVIEW diagram needed to measure the wind speed using DAQ Named Channels. This simplifies the block diagram, because the DAQ Named Channel remembers information about the device, channel, gains, and the scaling equation. Again, AI Sample Channel acquires a single value, but in this case, it returns the wind speed.

Figure 4-5. Measuring Wind Speed Using DAQ Named Channels

Averaging a Scan Example

One of the most useful and easy-to-use forms of signal conditioning is averaging data in software. Averaging can yield a more useful reading if a signal is rapidly changing or if there is noise on the line. Refer to Chapter 12, DC/RMS Measurements, for more information about averaging to improve your measurements.

Figure 4-6 shows the data acquisition system for measuring wind speed with the addition of software averaging.

Figure 4-6. DAQ System for Measuring Wind Speed with Averaging

Figure 4-7 shows what the actual wind speed might look like over time. Due to gusting winds, the speed values look noisy. Notice that our earlier wind speed reading of 29 mph is a peak speed, but may give the impression

LabVIEW Measurements Manual

4-4

www.ni.com

Chapter 4 Example Measurements

that the wind is holding at 29 mph. A better representation might be to take the average speed over a short period of time.

29 (mph)

speed

time

Figure 4-7. Wind Speed

Because you average in software, the hardware wiring for this approach does not change. It is the same as in Figure 4-3. The block diagram in Figure 4-8 shows the software to measure an average wind speed if you are using DAQ Named Channels. Again, the DAQ Named Channel remembers information about the device, channel, gains, and scaling. Notice that the DAQ subVI of this example differs from the Single-Point Acquisition Example in that it acquires a waveform instead of a single value. The number of samples and sample rate inputs define the waveform of data acquired. For example, if you set the number of samples to 1000 and the sample rate to 500 (samples/sec), it takes two seconds to acquire the 1000 points. The waveform of data from AI Acquire Waveform is then wired to the Mean subVI. The Mean subVI returns the average wind speed for two seconds of time.

Figure 4-8. Average Wind Speed Using DAQ Named Channels

One common reason for averaging is to eliminate 50 or 60 Hz powerline noise. The oscillating magnetic field around powerlines can induce noise voltages on unshielded transducer wiring. Because powerline noise is sinusoidal, the average over one period is zero. If you use a scan rate that is

© National Instruments Corporation

4-5

LabVIEW Measurements Manual

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