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

Chapter 6

Analog Input

If you are using channel names configured in the DAQ Channel Wizard, level and hysteresis are treated as being relative to the physical units specified for the channel. If you are not using channel names, these inputs are treated as volts.

Conditional Retrieval Examples

The Acquire N Scans Analog Software Trig VI example, available in the examples\daq\anlogin\anlogin.llb, uses the Intermediate VIs. Open this VI and examine its block diagram.

The main difference between this software triggering example and hardware triggering is the use of the conditional retrieval input for the AI Read VI. You set up the trigger channel, trigger slope, and trigger level the same way for both triggering methods. The pretrigger scans value is negated and connected to the offset value in the conditional retrieval cluster of the AI Read VI. When the trigger conditions are met, the VI returns the requested number of scans.

Letting an Outside Source Control Your Acquisition Rate

Typically, a DAQ device uses internal counters to determine the rate to acquire data, but sometimes you might need to capture your data at the rate of particular signals in your system. For example, you also can read temperature channels every time a pulse occurs, which represents pressure rising above a certain level. In this case, internal counters are inefficient for your needs. You must control your acquisition rate by some other, external source.

You can compare a scan of your channels to taking a snapshot of the voltages on your analog input channels. If you set your scan rate to 10 scans per second, you are taking 10 snapshots each second of all the channels in your channel list. In this case, an internal clock within your device (the scan clock) sets the scan rate, which controls the time interval between scans.

Also, remember that most DAQ devices (those that do not sample simultaneously) proceed from one channel to the next or from one sample to the next, depending on the channel clock rate. Therefore, the channel clock is the clock controlling the time interval between individual channel samples within a scan, which means the channel clock proceeds at a faster rate than the scan clock.

© National Instruments Corporation

6-39

LabVIEW Measurements Manual

Chapter 6

Analog Input

The faster the channel clock rate, the more closely in time your system samples the channels within each scan, as shown in Figure 6-26.

Note For devices with both a scan and channel clock, lowering the scan rate does not change the channel clock rate.

0

1

2

3

0

1

2

3

 

 

0

1

2

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

channel interval

 

 

 

 

scan

 

interval

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 6-26. Channel and Scan Intervals Using the Channel Clock

Some DAQ devices do not have scan clocks, but rather use round-robin scanning. Figure 6-27 shows an example of round-robin scanning.

0

1

2

3

0

1

2

3

0

1

2

3

channel interval

Figure 6-27. Round-Robin Scanning Using the Channel Clock

The devices that always perform round-robin scanning include, but are not limited to, the following:

PC-LPM-16

PC-LPM-16PnP

PC-516

DAQCard-500

DAQCard-516

DAQCard-700

Lab-LC

NI 4060

With no scan clock, the channel clock is used to switch between each channel at an equal interval. The same delay exists among all channel samples, as well as between the last channel of a scan and the first channel of the next scan. For boards with scan and channel clocks, round-robin scanning occurs when you disable the scan clock by setting the scan rate to 0 and using the interchannel delay of the AI Config VI to control your acquisition rate.

LabVIEW Measurements Manual

6-40

www.ni.com

Chapter 6

Analog Input

LabVIEW is scan-clock oriented. In other words, when you select a scan rate, LabVIEW automatically selects the channel clock rate for you. LabVIEW selects the fastest channel clock rate that allows adequate settling time for the ADC.

LabVIEW adds an extra 10 s to the interchannel delay to compensate for any unaccounted factors. However, LabVIEW does not consider this additional delay for purposes of warnings. If you have specified a scan rate that is adequate for acquisition but too fast for LabVIEW to apply the 10- s delay, it configures the acquisition but does not return a warning.

You can set your channel clock rate with the interchannel delay input of the AI Config VI, which calls the Advanced AI Clock Config VI to actually configure the channel clock. The simplest method to select an interchannel delay is to gradually increase the delay, or clock period, until the data appears consistent with data from the previous delay setting.

Refer to your hardware manuals for the required setting time for your channel clock. You also can find the interchannel delay by running the low-level AI Clock Config VI for the channel clock with no frequency specified.

Externally Controlling Your Channel Clock

There are times when you might need to control the channel clock externally. The channel clock rate is the same rate at which analog conversions occur. For instance, suppose you need to know the strain value at an input, every time an infrared sensor sends a pulse. Most DAQ devices have an EXTCONV* pin or a PFI pin on the I/O connector for providing your own channel clock. For NI 406x Series devices, use the EXTRIG input pin. This external signal must be a TTL level signal. The asterisk on the signal name indicates that the actual conversion occurs on the falling edge of the signal, as shown in Figure 6-28. For devices with PFI lines and for the NI 406X Series devices, you can select either the rising edge or falling edge using LabVIEW. With devices that have a RTSI connector, you can get your channel clock from other National Instruments DAQ devices.

© National Instruments Corporation

6-41

LabVIEW Measurements Manual

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