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

Chapter 6

Analog Input

Figure 6-29 shows an example of using an external scan clock to perform a buffered acquisition.

Figure 6-29. Acquiring Data with an External Scan Clock

Externally Controlling Your Scan Clock

External scan clock control might be more useful than external channel clock control if you are sampling multiple channels, but might not be as obvious to find because it does not have the input on the I/O connector labeled ExtScanClock, the way the EXTCONV* pin does.

Note Some MIO devices have an output on the I/O connector labeled SCANCLK, which is used for external multiplexing and is not the analog input scan clock. This cannot be used as an input.

The appropriate pin to input your external scan clock can be found in

Table 6-2.

Table 6-2. External Scan Clock Input Pins

Device

External Scan Clock Input Pin

 

 

 

 

All E Series Devices

Any PFI Pin

 

(Default: PF17/STARTSCAN)

 

 

Lab-PC+

OUT B1

1200 devices

 

 

 

Note Some devices do not have internal scan clocks and therefore do not support external scan clocks. These devices include but are not limited to the following: PC-LPM-16,

© National Instruments Corporation

6-43

LabVIEW Measurements Manual

Chapter 6

Analog Input

PC-LPM-16PnP, PC-516, DAQCard-500, DAQCard-516, DAQCard-700, NI 4060,

and Lab-LC.

After connecting your external scan clock to the correct pin,

set up the external scan clock in software. Refer to the Acquire N Scans-ExtScanClk VI in the examples\daq\anlogin\anlogin.llb for an example of how to set up the external clock in software. Two Advanced VIs, AI Clock Config and AI Control, are used in place of the Intermediate AI Start VI. This allows access to the clock source input. This is necessary because it allows access to the clock source string, which is used to identify the PFI pin to be used for the scan clock for E Series boards. The clock source also includes the clock source code (on the front panel), which is set to the I/O connector. The 0.0 wired to the Clock Config VI disables the internal clock.

Remember that the which clock input of the AI Clock Config VI should be set to scan clock (1).

Note You must divide the timebase by some number between 2 and 65,535 or you will get a bad input value error.

Because LabVIEW determines the length of time before AI Read times out based on the interchannel delay and scan clock rate, you might need to force a time limit into AI Read. In the example Acquire N Scans-ExtScanClk VI, the time limit is 5 seconds.

Externally Controlling the Scan and Channel Clocks

You can control the scan and channel clocks simultaneously. However, make sure that you follow the proper timing. Figure 6-30 demonstrates how you can set up your application to control both clocks.

Figure 6-30. Controlling the Scan and Channel Clock Simultaneously

LabVIEW Measurements Manual

6-44

www.ni.com

7

Analog Output

This chapter explains analog output for data acquisition.

Things You Should Know about Analog Output

Some measuring systems require that analog signals be generated by a DAQ device. Each of these analog signals can be a steady or slowly changing signal, or a continuously changing waveform. This section describes how to use LabVIEW to produce all of these different types of signals.

Single-Point Output

When the signal level at the output is more important than the rate at which the output value changes, you need to generate a steady DC value. You can use the single-point analog output VIs to produce this type of output. With single-point analog output, any time you want to change the value on an analog output channel, you must call one of the VIs that produces a single update (a single value change). Therefore, you can change the output value only as fast as LabVIEW calls the VIs. This technique is called software timing. You should use software timing if you do not need high-speed generation or the most accurate timing. Refer to the Single-Point Generation section, later in this chapter, for more information about single-point output.

Buffered Analog Output

Sometimes in performing analog output, the rate that your updates occur is just as important as the signal level. This is called waveform generation, or buffered analog output. For example, you might want your DAQ device to act as a function generator. You can do this by storing one cycle of sine wave data in an array and programming the DAQ device to generate the values continuously in the array one point at a time at a specified rate. This is known as single-buffered waveform generation. But what if you want to generate a continually changing waveform? For example, you might have a large file stored on disk that contains data you want to output. Because LabVIEW cannot store the entire waveform in a single buffer, you must continually load new data into the buffer during the generation. This

© National Instruments Corporation

7-1

LabVIEW Measurements Manual

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