4-8
|
ni.com
Chapter 4
Analog Input
Consider again the example above where a 4 V signal is connected to channel 0 and a
1 mV signal is connected to channel 1. Suppose the input range for channel 0 is -10 V
to 10 V and the input range of channel 1 is -200 mV to 200 mV.
You can connect channel 2 to AI GND (or you can use the internal ground; refer to
Internal Channels
in the
NI-DAQmx Help
). Set the input range of channel 2 to
-200 mV to 200 mV to match channel 1. Then scan channels in the order: 0, 2, 1.
Inserting a grounded channel between signal channels improves settling time because
the NI-PGIA adjusts to the new input range setting faster when the input is grounded.
–
Minimize Voltage Step between Adjacent Channels—When scanning between
channels that have the same input range, the settling time increases with the voltage
step between the channels. If you know the expected input range of your signals, you
can group signals with similar expected ranges together in your scan list.
For example, suppose all channels in a system use a -5 to 5 V input range. The signals
on channels 0, 2, and 4 vary between 4.3 V and 5 V. The signals on channels 1, 3, and
5 vary between -4 V and 0 V. Scanning channels in the order 0, 2, 4, 1, 3, 5 produces
more accurate results than scanning channels in the order 0, 1, 2, 3, 4, 5.
4.
Avoid Scanning Faster Than Necessary
—Designing your system to scan at slower
speeds gives the NI-PGIA more time to settle to a more accurate level. Here are two
examples to consider:
–
Example 1—Averaging many AI samples can increase the accuracy of the reading by
decreasing noise effects. In general, the more points you average, the more accurate
the final result. However, you may choose to decrease the number of points you
average and slow down the scanning rate.
Suppose you want to sample 10 channels over a period of 20 ms and average the
results. You could acquire 500 points from each channel at a scan rate of 250 kS/s.
Another method would be to acquire 1,000 points from each channel at a scan rate of
500 kS/s. Both methods take the same amount of time. Doubling the number of
samples averaged (from 500 to 1,000) decreases the effect of noise by a factor of
1.4 (the square root of 2). However, doubling the number of samples (in this example)
decreases the time the NI-PGIA has to settle from 4
μ
s to 2
μ
s. In some cases, the
slower scan rate system returns more accurate results.
–
Example 2—If the time relationship between channels is not critical, you can sample
from the same channel multiple times and scan less frequently. For example, suppose
an application requires averaging 100 points from channel 0 and averaging 100 points
from channel 1. You could alternate reading between channels—that is, read one point
from channel 0, then one point from channel 1, and so on. You also could read all
100 points from channel 0 then read 100 points from channel 1. The second method
switches between channels much less often and is affected much less by settling time.
Содержание PCI-6281
Страница 1: ...PCI 6281...