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

Chapter 6

Analog Input

 

 

 

 

Figure 6-15. Using the Intermediate VIs to Acquire Multiple Waveforms

With these VIs, not only can you configure triggering, coupling, acquisition timing, retrieval, and additional hardware, but you also can control when each step of the data acquisition process occurs. With the AI Config VI, you can configure the different parameters of the acquisition, such as the channels to be read and the size of the buffer to use. In the AI Start VI, you specify parameters used in your program to start the acquisition, such as the number of scans to acquire, the rate at which your VI takes the data, and the trigger settings. In the AI Read VI, you specify parameters to retrieve the data from the data acquisition buffer. Then, the application calls the

AI Clear VI to deallocate all buffers and other resources used for the acquisition by invalidating the taskID. If an error occurs in any of these VIs, your program passes the error through the remaining VIs to the Simple Error Handler VI, which notifies you of the error.

For many DAQ devices, the same ADC samples many channels instead of only one. The maximum sampling rate per channel is the maximum sampling rate of the device divided by the number of channels.

The scan rate input in all the VIs described above is the same as the sampling rate per channel. To figure out your maximum scan rate, you must divide the maximum sampling rate by the number of channels.

Simple-Buffered Analog Input Examples

This section contains several different examples of simple-buffered analog input.

Simple-Buffered Analog Input with Graphing

Figure 6-16 shows how you can use the AI Acquire Waveforms VI to acquire two waveforms from channels 0 and 1 and then display the waveforms on separate graphs. This type of VI is useful for comparing two or more waveforms or for analyzing how a signal looks before and after

© National Instruments Corporation

6-23

LabVIEW Measurements Manual

Chapter 6

Analog Input

going through a system. In this illustration, 1,000 scans of channels 0 and 1 are taken at the rate of 5,000 scans per second. The actual scan period output displays in the actual timebase on the X-axis of the graphs.

Figure 6-16. Simple Buffered Analog Input Example

Refer to the Acquire N Scans example VI in the examples\daq\ anlogin\anlogin.llb for an example of a simple buffered input application that uses graphing.

Simple-Buffered Analog Input with Multiple Starts

In some cases, you might not want to acquire contiguous data, such as in an oscilloscope application. In this case, you want to take only a specified number of samples as a snapshot of what the input looks like periodically. Refer to the Acquire N-Multi-Start VI in the examples\daq\ anlogin\anlogin.llb for an example using the Intermediate VIs similar to the Acquire N Scans example, except the acquisition only occurs each time the start button on the front panel is pressed.

This example is similar to the standard simple buffered analog input VI, but now both the AI Start and AI Read VIs are in a While Loop, which means the program takes a number of samples every time the While Loop iterates.

Note The AI Read VI returns 1,000 samples, taken at 5,000 samples per second, every time the While Loop iterates. However, the duration of the iterations of the While Loop can vary greatly. This means that, with this VI, you can control the rate at which samples are taken, but you may not be able to designate exactly when your application starts acquiring each set of data.

LabVIEW Measurements Manual

6-24

www.ni.com

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