Application Note 007
Data Acquisition (DAQ) Fundamentals
Introduction
Today, most scientists and engineers are using personal computers with ISA, EISA, PCI, PCMCIA, Macintosh
NuBus, or parallel or serial ports for data acquisition in laboratory research, test and measurement, and industrial
automation. Many applications use plug-in boards to acquire data and transfer it directly to computer memory.
Others use DAQ hardware remote from the PC that is coupled via parallel or serial port. Obtaining proper results
from a PC-based DAQ system depends on each of the following system elements (see Figure 1).
•
•
•
•
•
The personal computer
Transducers
Signal conditioning
DAQ hardware
Software
This application note gives an overview of each of these elements and explains the most important criteria of each
element. The application note also defines much of the terminology common to each of the elements of a PC-based
DAQ system.
Figure 1. The Typical PC-Based DAQ System
The Personal Computer
The computer used for your data acquisition system can drastically affect the maximum speeds at which you are
able to continuously acquire data. Today’s technology boasts Pentium and PowerPC class processors coupled with
the higher performance PCI bus architecture as well as the traditional ISA/EISA bus and Macintosh NuBus. With
the advent of PCMCIA, portable data acquisition is rapidly becoming a more flexible alternative to desktop PC
based data acquisition systems. For remote data acquisition applications that use RS-232 or RS-485 serial
communication, your data throughput will usually be limited by the serial communication rates.
____________________________
Product and company names are trademarks or trade names of their respective companies.
340019B-01
© Copyright 1996 National Instruments Corporation. All rights reserved.
May 1996
The data transfer capabilities of the computer you use can significantly affect the performance of your DAQ system.
All PCs are capable of programmed I/O and interrupt transfers. DMA transfers, not available on some computers,
increases the system throughput by using dedicated hardware to transfer data directly into system memory. Using
this method, the processor is not burdened with moving data and is therefore free to engage in more complex
processing tasks. To reap the benefits of DMA or interrupt transfers, the DAQ board you choose must also be
capable of making these types of transfers.
The limiting factor for acquiring large amounts of data is often the hard drive. Disk access time and hard drive
fragmentation can significantly reduce the maximum rate at which data can be acquired and streamed to disk. For
systems that need to acquire high-frequency signals, you should select a high-speed hard drive for your PC and
make sure that there is enough contiguous (unfragmented) free disk space to hold the data.
Applications requiring real-time processing of high-frequency signals need a high-speed, 32-bit processor with its
accompanying coprocessor, or a dedicated plug-in processor such as a digital signal processing (DSP) board. If the
application only acquires and scales a reading once or twice a second, however, a low-end PC can be satisfactory.
You must also look ahead to determine which operating system and computer platform will yield the greatest long
term return on investment and still able to meet your short term goals. Factors that may influence your choice may
include the experience and needs of both your developers and end users, other uses for the PC both now and in the
future, cost constraints, and the availability of different computers with respect to your implementation time frame.
Traditional platforms include Mac OS, which is known for its simple graphical user interface, and Windows 3.X.
Windows 95, which boasts a much improved user interface over Windows 3.X, also offers the option of Plug and
Play hardware configuration. In addition, Windows NT 4.0 will offer a more robust 32-bit OS with the look and feel
of Windows 95.
Transducers
Tra nsduce rs se nse physic al phe nomena and provide ele ctrica l signals tha t the DAQ syste m ca n me asure . For
exa mple , thermoc ouple s, RT Ds, the rmistor s, and IC sensor s conve rt te mpe ra tur e into an ana log signal that an ADC
ca n me asure . Other exa mple s include stra in gauge s, flow tr ansduce rs, and pre ssur e transduc ers, whic h mea sure
for ce , rate of flow, a nd pre ssure, r espe ctively. In eac h c ase , the e lectric al signa ls produce d a re propor tiona l to the
physica l par ameter s they ar e monitoring.
Signal Conditioning
The ele ctrica l signals ge ner ated by the tra nsduc er s must be optimize d f or the input r ange of the DAQ boar d. Signal
conditioning ac ce ssories can amplify low- level signa ls, and the n isolate and filte r the m for more a cc urate
mea sureme nts. I n addition, some tr ansduce rs r equire voltage or cur re nt exc ita tion to gene ra te a voltage output.
F igur e 2 de pic ts a typic al DAQ syste m with SC XI signa l conditioning fr om Na tiona l Instruments.
Amplifica tion – The most c ommon type of c onditioning is a mplific ation. Low-le vel ther mocouple signa ls, f or
exa mple , should be amplified to incr ease the re solution and r educ e noise . For the highest possible a cc ura cy, the
signal should be a mplif ie d so tha t the maximum voltage ra nge of the c onditioned signal e quals the maximum input
ra nge of the a nalog-to-digital c onver te r (ADC).
F or e xample, SCX I has se vera l signal conditioning module s that a mplif y input signals. The gain is applied to the
low-le vel signals within the SC XI chassis loc ated close to the transduc ers, se nding only high-level signals to the PC,
minimizing the e ffe cts of noise on the re adings.
2
F igur e 2. The SCXI Signa l Conditioning Front-End Syste m for Plug- In D AQ Boa rds
Isolation – Another c ommon applica tion for signal c onditioning is to isola te the tra nsduc er signals f rom the
computer f or sa fe ty purposes. The system being monitored may contain high- volta ge tr ansients tha t could damage
the computer.
An additiona l r eason for nee ding isolation is to ma ke sure that the re adings f rom the plug-in D AQ board ar e not
af fe cted by diff ere nce s in gr ound potentials or c ommon- mode voltage s. Whe n the DAQ boar d input a nd the signal
being ac quir ed are e ac h re fe renc ed to “ ground,” pr oble ms occ ur if the re is a potential dif fer ence in the two grounds.
This diff ere nce c an le ad to wha t is known as a ground loop, w hic h may ca use ina cc ura te r epre sentation of the
ac quired signal, or if too la rge , ma y da ma ge the me asure ment system. Using isolate d signal c onditioning module s
will eliminate the gr ound loop and ensure that the signals are a cc urate ly ac quired. For exa mple , the SC XI-1120 and
S CXI -1121 module s provide isola tion up to 250 Vr ms of common-mode volta ge. The SC XI-1122 module pr ovides
up to 450 Vr ms isola tion.
Multiplexing – A common te chnique for mea suring seve ra l signals with a single measur ing devic e is multiplexing.
S igna l conditioning de vic es for ana log signals of te n pr ovide multiple xing for use with slowly c hanging signa ls such
as temper ature . This is in a ddition to any built-in multiplexing on the DAQ board. T he ADC samples one cha nnel,
switche s to the next cha nnel, samples it, switche s to the next cha nnel, and so on. Bec ause the sa me ADC is sa mpling
many cha nnels instea d of one, the ef fe ctive sa mpling rate of ea ch individua l cha nnel is inve rsely proportional to the
number of cha nnels sa mple d. Our SCXI modules f or analog signa ls employ multiple xing so tha t as many as 3072
signals c an be me asure d w ith one DAQ boar d. With the AMUX- 64T a nalog multiple xer, you ca n me asure up to 256
signals with a single boar d.
F ilter ing – T he pur pose of a f ilte r is to re move unwa nted signa ls fr om the signa l that you ar e tr ying to me asure . A
noise filte r is used on DC-c la ss signals suc h a s tempe rature to attenua te higher f reque ncy signa ls that can re duce the
ac cur ac y of your me asur ement. For e xample, many of the SCXI module s ha ve 4 Hz a nd 10 kHz lowpass filte rs to
eliminate noise be fore the signals a re digitiz ed by the DAQ boar d.
3
AC-c la ss signals suc h a s vibra tion often requir e a dif fer ent type of filter known as a n a ntia lia sing filter. Like the
noise filte r, the antialiasing f ilter is a lso a lowpass filte r; how eve r, it must have a ve ry ste ep c utoff ra te , so that it
almost c omple te ly re moves a ll fr equenc ies of the signal tha t ar e highe r tha n the input ba ndwidth of the boa rd. I f the
signals we re not r emoved, the y would err oneously a ppea r as signals within the input ba ndwidth of the board. Boa rds
designe d spec ifica lly for AC-cla ss signal me asure me nt – the A T-DSP2200, A T-2150, NB-A2100, a nd N B- A2150
dynamic signal a cquisition boards – and the SCX I-1141 module ha ve antialiasing filte rs built into them.
Exc ita tion – Signa l c onditioning a lso gene rate s exc ita tion for some transduc ers. Strain gauge s, the rmistor s, a nd
R TDs, for exa mple , re quir e exter nal voltage or c urre nt exc ita tion signals. Signal conditioning module s f or the se
tra nsduc er s usually pr ovide the se signa ls. RTD measur ements a re usually ma de with a cur rent source tha t conve rts
the varia tion in re sista nce to a mea surable voltage . Stra in gauge s, which are ve ry low -re sista nce devic es, typic ally
ar e used in a Whe atstone br idge c onfigura tion with a voltage exc ita tion sourc e. The SCX I-1121 and SCXI- 1122
have onboa rd exc ita tion sour ce s, configura ble as c urr ent or voltage, tha t you c an use for strain gauges, the rmistors,
or RT Ds.
Linea riza tion – A nothe r common signal c onditioning f unction is linea riza tion. Ma ny tra nsduce rs, such as
ther moc ouples, have a nonlinea r r esponse to c hange s in the phenome na be ing mea sure d. Both our N I-DA Q dr ive r
softwa re and LabV IEW, L abWindows/C VI, ComponentWor ks, and VirtualB ench applica tion softwa re include
linear ization r outine s f or the rmocouples, stra in gauge s, and RTD s.
It is important to understand the nature of your signal, the configuration that is being used to measure the signal and
the affects of the surrounding environment. Based on this information you can easily determine whether signal
conditioning will be a necessary part of your DAQ system.
DAQ Hardware
Analog Inputs
B asic Consider ations of Ana log Inputs – The ana log input spe cifica tions ca n give you infor ma tion on both the
ca pabilitie s and the ac cura cy of the DA Q pr oduct. Basic specif ic ations, which are a vailable on most D AQ pr oducts,
tell you the numbe r of c hanne ls, sa mpling rate, r esolution, a nd input r ange . The number of analog cha nnel inputs
will be spec ified for both single -e nded and dif fer ential inputs on boar ds that have both types of inputs. Single -ende d
inputs ar e all re fe renc ed to a common ground point. These inputs a re typic ally use d whe n the input signals a re high
leve l (gr eate r tha n 1 V), the lea ds fr om the signa l sourc e to the ana log input har dwar e are short (less tha n 15 ft), a nd
all input signa ls share a c ommon ground ref er ence . If the signa ls do not meet the se cr ite ria, you should use
diffe re ntia l inputs. W ith diffe rential inputs, e ac h input ha s its own ground r efe re nce . Noise e rror s a re re duce d
bec ause the common-mode noise pic ked up by the le ads is canc ele d out.
S ampling Rate – This pa ra me ter dete rmine s how ofte n conve rsions c an ta ke place . A faste r sa mpling r ate ac quires
more points in a given time a nd c an the ref ore ofte n for m a better r epre sentation of the original signa l. For exa mple ,
audio signa ls conve rted to e le ctric al signals by a microphone c ommonly have fr equenc y c omponents up to 20 kHz.
To proper ly digitiz e this signa l for ana lysis, the Nyquist sampling theor em te lls us that we must sample a t more than
twice the ra te of the maximum fr equenc y c omponent w e want to detec t. So, a boa rd w ith a sa mpling ra te gr eate r
than 40 kS/s (suc h a s the AT-D SP2200, AT-2150, N B- A2100, and NB-A2150) is ne eded to pr operly acquir e this
signal.
Multiplexing – A common te chnique for mea suring seve ra l signals with a single ADC is multiple xing. The ADC
samples one cha nnel, switc hes to the next c hanne l, sa mple s it, switc hes to the next c hanne l, a nd so on. Be ca use the
same ADC is sampling many cha nnels instea d of one, the ef fe ctive r ate of ea ch individual cha nnel is inve rsely
propor tiona l to the number of cha nnels sa mple d. For exa mple , an AT-MI O-16E- 1 sampling a t 1 MS/s on 10
cha nnels w ill eff ec tive ly sample eac h individual c hanne l a t:
1 MS/s
= 100 kS/s per c hannel
10 channe ls
4
R esolution – The numbe r of bits that the A DC uses to re pre se nt the ana log signal is the r esolution. The highe r the
re solution, the highe r the numbe r of divisions the range is broken into, a nd the ref ore, the smaller the detec table
voltage cha nge. Figure 3 shows a sine w ave and its cor responding digital ima ge as obta ine d by an ideal 3-bit AD C.
A 3-bit c onverte r ( which is ac tua lly seldom use d but a c onvenient exa mple ) divides the analog range into 23, or 8
divisions. Ea ch division is r epr esente d by a bina ry code betwe en 000 a nd 111. Clea rly, the digital r epre sentation is
not a good repr ese nta tion of the or igina l ana log signal beca use inf ormation ha s be en lost in the conver sion. By
incr easing the r esolution to 16 bits, howe ver, the number of code s f rom the ADC inc re ases from 8 to 65, 536, and
you can there for e obta in an extre mely a cc urate digita l r epre sentation of the ana log signal if the re st of the a nalog
input cir cuitry is designed proper ly.
Figure 3. Digitized Sine Wave with a Resolution of Three Bits
R ange – Ra nge ref ers to the minimum a nd maximum voltage leve ls that the AD C ca n qua ntiz e. The multif unction
DAQ boa rds of fer se le ctable ra nges so that the boa rd is conf igur able to ha ndle a va riety of diff ere nt voltage leve ls.
With this f lexibility, you c an match the signa l ra nge to that of the ADC to ta ke best a dvanta ge of the re solution
ava ila ble to ac cur ately me asure the signal.
The ra nge, r esolution, a nd ga in ava ila ble on a DAQ boa rd de termine the sma lle st detec table cha nge in volta ge. This
cha nge in voltage re pre se nts 1 LSB of the digita l value , and is often ca lle d the code width. The idea l code w idth is
found by dividing the volta ge ra nge by the gain times tw o ra ised to the or der of bits in the re solution. For e xample,
one of our 16-bit multifunc tion DAQ boa rds, the A T-MIO -16X, ha s a selec table ra nge of 0 to 10 or - 10 to 10 V and
sele ctable gain of 1, 2, 5, 10, 20, 50, or 100. W ith a volta ge range of 0 to 10 V , and a gain of 100, the ideal code
width is:
10
= 1. 5 µV
The ref ore, the theor etica l re solution of one bit in the digitiz ed value is 1.5 µV.
100 x 216
C ritic al Consider ations of Analog Inputs – Although the basic spec if ic ations pr eviously desc ribed may show that a
DAQ boa rd ha s a 16- bit resolution AD C and a 100 kS/s sampling ra te , this does not mea n you ca n sample at full
spee d on all 16 cha nnels a nd ge t full 16- bit ac cura cy. For example, you ca n pur cha se pr oducts on the ma rket today
with 16- bit ADCs a nd ge t less tha n 12 bits of use ful da ta . How do you tell if the boa rd tha t you are c onside ring will
give you the desire d r esults? The most important thing to do is to scr utinize spe cifica tions that go beyond the
re solution of the DAQ pr oduct. National Instruments of fer s se vera l applica tion notes to help you under sta nd a ll the
spec ifica tions on DAQ produc ts. While e valua ting DAQ produc ts, a lso consider the DNL, r elative ac cur acy, se ttling
time of the instr ume ntation a mplifier , and noise , bec ause wha t you don’ t know about the DA Q boa rd you ar e
conside ring c an hurt your mea surements.
Ide ally, as you incr ea se the leve l of volta ge applied to a DAQ boar d, the digital codes fr om the ADC should a lso
incr ease linea rly. If you w ere to plot the voltage ve rsus the output c ode from a n ide al A DC, the plot would be a
straight line. D eviations f rom this idea l stra ight line a re spec if ie d a s the nonline ar ity.
5
DNL is a mea sure in LSB of the worst-c ase devia tion of c ode widths fr om their ide al value of 1 LSB. A n idea l DA Q
boar d ha s a DNL of 0 L SB. Pr ac tic ally, a good DAQ boa rd w ill ha ve a DNL of ±0. 5 LSB .
The re is no uppe r limit on how w ide a c ode can be. Code s do not have widths of less tha n 0 LSB, so the DN L is
neve r worse than -1 LSB. A DAQ boar d with poor pe rfor ma nce may have a c ode width equa l to or ve ry ne ar z ero,
which indic ate s a missing code. N o matter wha t voltage you input to the DAQ boar d with a missing code , the boa rd
will neve r quantize the volta ge to the value re prese nted by this code . Some times DNL is spec ified by stating that a
DAQ boa rd ha s no missing c odes, whic h mea ns that the D NL is bounded be low by -1 LSB but does not make a ny
spec ifica tions a bout the upper bounda ries. All N ational I nstr ume nts E Se ries boa rds are gua ra nte ed to have no
missing codes, a nd our spec ifica tions clea rly state wha t the DNL is in the spec ifica tion so that you know the
ac cur ac y or our board line ar ity.
If the DAQ boar d in the pr evious e xample, whic h had a code w idth of 1. 5 µV , had a missing c ode slightly above
500 µV, the n inc rea sing the volta ge to 502 µV would not be dete ctable. O nly whe n the volta ge is incre ase d a nothe r
LS B, or in this e xample, be yond 503 µV, will the volta ge cha nge be de tecta ble . As you ca n se e, poor DNL re duce s
the resolution of the boar d.
R elative Acc ura cy – It is a measur e in LSBs of the wor st- ca se de viation fr om the ideal DAQ boar d tra nsfer f unction,
a straight line. Re la tive a cc urac y is de termined on a D AQ board by c onnec ting a volta ge at ne gative full sca le,
digitiz ing the volta ge, incr easing the voltage , and repe ating the steps until the input r ange of the boa rd has been
cove re d. Whe n the digitize d points a re plotte d, the r esult will be a n appa re nt straight line (se e Figure 4a ). Howe ver ,
you can subtrac t ac tual stra ight- line va lue s f rom the digitize d va lues a nd plot the se r esulting points, a s shown in
F igur e 4b. The ma ximum deviation f rom z er o is the re la tive a cc urac y of the DAQ boa rd.
F igur e 4b.
F igur e 4a.
F igur e 4. Deter mining the r elative ac cura cy of a DAQ boar d. Figure 4a shows
the a ppare nt stra ight-line plot gene ra te d by swee ping the input. Figur e 4b shows,
by subtra cting out ca lc ulated str aight-line values, that the plot in not ac tually stra ight.
The drive r sof tw are f or a D AQ board will transla te the binar y code va lue of the AD C to voltage by multiplying it by
a constant. Good re lative a cc ura cy is impor ta nt for a DA Q boa rd beca use it ensure s that the tr anslation fr om the
binar y code of the ADC to the volta ge value is ac cura te. Obta ining good re lative acc ura cy require s tha t both the
ADC and the surr ounding a nalog c ir cuitry are de signe d pr operly.
Settling Time – On a typical plug-in DAQ board, an analog signal is first selected by a multiplexer, and then
amplified by an instrumentation amplifier before it is converted to a digital signal by the ADC. This instrumentation
amplifier must be able to track the output of the multiplexer as the multiplexer switches channels, and also to settle
6
to the accuracy of the ADC quickly (See Figure 5.). Otherwise, the ADC will convert an analog signal that has not
yet settled to the value that you are trying to measure with your DAQ board. The time required for the
instrumentation amplifier to settle to a specified accuracy is called the settling time. Poor settling time is a major
problem because the amount of inaccuracy usually varies with gain and sampling rate. Because the errors occur in
the analog stages of the DAQ board, the board cannot return an error message to the computer when the
instrumentation amplifier does not settle.
Figure 5. The input to an instrumentation amplifier that is multiplexing 40 DC signals
appears to be a high-frequency AC signal.
The instrumentation amplifier is most likely not to settle when you are sampling several channels at high gains and
high rates. Under such conditions, the instrumentation amplifier has difficulty tracking large voltage differences that
can occur as the multiplexer switches between input signals. Typically, the higher the gain and the faster the channel
switching time, the less likely it is that the instrumentation amplifier will settle. In fact, no off-the-shelf
programmable-gain instrumentation amplifier can settle to 12-bit accuracy in less than 2 µs when amplifying at a
gain of 100. That is why National Instruments developed the NI-PGIA specifically for DAQ board applications – so
our boards that use the NI-PGIA can consistently settle at high gains and sampling rates.
Noise – A ny unwa nte d signa l that a ppea rs in the digitiz ed signa l of the DAQ boar d is noise. Be cause the PC is a
noisy digital e nvir onment, ac quir ing data on a plug- in boar d take s a ve ry car eful layout on multilaye r D AQ boards
by skilled ana log designer s. Simply plac ing an ADC, instr umentation a mplifie r, and bus inter fac e circ uitr y on a one
or two-laye r board will most like ly r esult in a ve ry noisy DAQ board. D esigner s ca n use meta l shielding on a D AQ
boar d to help r educe noise . Prope r shie lding should not only be a dded ar ound sensitive analog sec tions on a DAQ
boar d, but must also be built into the laye rs of the DAQ boa rd w ith ground pla nes.
F igur e 6 shows the D C noise plot of two DAQ produc ts, both of w hic h use the same ADC. Two qualitie s of the
DAQ boa rd c an be deter mine d f rom the noise plots – ra nge of noise and the distribution. The plot in Figure 6a,
which is our AT- MI O-16X , has a high distribution of samples at 0 and a ver y small numbe r of points oc curr ing at
other code s. The distr ibution is Gaussian, w hic h is w hat is e xpec ted from r andom noise . From the plot, the pea k
noise le vel is within ±3 LSB. The plot in Figure 6b, made w ith a very noisy DAQ pr oduct f rom a c ompe titor, ha s a
fa r dif fer ent distribution. It ha s noise grea ter than 20 LSB, w ith many sa mple s oc curr ing at points othe r tha n the
expe cte d value . For the DAQ produc ts in Figur e 5, the te st wa s run with an input ra nge of ±10 V a nd a ga in of 10.
The ref ore, 1 LSB = 31 µV , so a noise le vel of 20 LSB is equivale nt to 620 µV of noise.
7
Figure 6b.
Figure 6a.
Figure 6. Noise plots of two DAQ products with significantly different
noise performance even though they use the same 16-bit ADC. Figure 6a. is
the National Instruments AT-MIO-16X; Figure 6b is a competitor’s DAQ product.
Eva lua te the Spec if ications – With a sophistic ated mea suring de vic e like a plug-in DAQ board, you ca n ge t
signif icantly dif fer ent a cc urac ies depending on whose boa rd you ar e using. N ational I nstr ume nts goes to gre at
lengths to ma ke our boards extre mely a cc urate , in many case s more a cc urate than sta nd-a lone instruments. We
publish this ac cur acy in our spec ifica tions. Be le er y of boar ds that are inade quate ly spec if ied, bec ause the
spec ifica tion omitted ma y be the one that c ause s your mea sur ements to be inacc ura te . By eva luating more a nalog
input spec ifica tions tha n simply the resolution of the ADC c onver te r, you can make sure that you a re getting a DA Q
produc t that is ac cura te enough f or your a pplic ation.
Analog Outputs
Ana log output cir cuitry is often require d to provide stimuli for a DA Q system. Sever al spe cific ations for the digita lto-a nalog c onverte r (DAC) deter mine the quality of the output signal pr oduced – se ttling time, slew ra te, and
re solution. Settling time and sle w rate wor k togethe r in deter mining how f ast the DAC can cha nge the le vel of the
output signal. Settling time is the time re quired for the output to settle to the spe cifie d a cc urac y. The settling time is
usually spe cified for a full-sc ale cha nge in volta ge. The slew ra te is the ma ximum rate of cha nge tha t the DAC can
produc e on the output signal. Ther ef ore, a DA C with a small se ttling time a nd a high sle w r ate ca n ge nera te highfr eque ncy signa ls, be ca use little time is nee ded to ac cura tely c hange the output to a ne w voltage leve l.
An exa mple of an applica tion that r equire s high pe rfor ma nce in the se para meter s is the gene ration of a udio signals.
The DAC requir es a high sle w r ate and sma ll settling time to ge ner ate the high fre quenc ies ne ce ssa ry to cove r the
audio range . In contra st, a n e xample of an a pplic ation tha t does not re quire fa st D/A c onver sion is a voltage sourc e
that c ontrols a he ater . Be ca use the he ater ca nnot r espond quic kly to a voltage cha nge, f ast D/A conve rsion is not
nec essa ry. The applica tion will dete rmine the DA C specif ic ations.
Output resolution is similar to input resolution. It is the number of bits in the digital code that generates the analog
output. A larger number of bits reduces the ma gnitude of ea ch output volta ge incre ment, there by ma king it possible
to ge nera te smoothly c hanging signa ls. A pplic ations re quir ing a wide dynamic ra nge with sma ll incr emental volta ge
cha nges in the ana log output signal ma y nee d high-r esolution voltage outputs.
.
8
Triggers
Many DAQ applications need to start or stop a DAQ operation based on an external event. Digital triggers
synchronize the acquisition and voltage generation to an external digital pulse. Analog triggers, used primarily in
analog input operations, start or stop the DAQ operation when an input signal reaches a specified analog voltage
level and slope polarity.
Real-Time System Integration (RTSI®)
The National Instruments expertise in instrumentation led to the development of the RTSI bus for our DAQ
products. The RTSI bus uses a custom gate array and a ribbon cable to route timing and trigger signals between
multiple functions on one DAQ board, or between two or more boards. With RTSI, you can synchronize A/D
conversions, D/A conversions, digital inputs, digital outputs, and counter/timer operations. For example, with RTSI,
two analog input boards can capture data simultaneously while a third board generates an output pattern
synchronized to the sampling rate of the inputs.
Digital I/O
DI O inter fac es are of te n use d on PC D AQ syste ms to contr ol proc esses, ge nera te patterns for testing, a nd
communica te w ith periphe ral equipment. In ea ch case , the importa nt par ameter s include the number of digital line s
ava ila ble, the ra te a t which you c an ac ce pt and source digital da ta on these lines, and the drive ca pability of the lines.
If the digita l line s a re used for contr olling e vents suc h a s turning on and off hea ters, motors, or lights, a high da ta
ra te is usually not r equire d be cause the equipment ca nnot re spond ver y quickly. The numbe r of digital lines, of
cour se, ne eds to ma tch the numbe r of proc esse s that a re c ontr olle d. In eac h of these e xamples, the amount of cur re nt
re quired to turn the de vice s on a nd of f must be le ss than the a vailable drive cur rent from the boa rd.
With the pr oper digita l signal c onditioning a cc essories, howe ver , you c an use the low-c urr ent TTL signals to/fr om
the DAQ har dwar e to monitor /c ontrol high voltage a nd c urre nt signals f rom industrial hardw are . For e xample, the
voltage and cur rent nee ded to open and close a la rge va lve may be on the orde r of 100 VA C at 2 A. Bec ause the
output of a digita l I/O board is 0 to 5 V DC at seve ral millia mpere s, an SSR Serie s, E R- 8/16, SC -206X Se ries, or
S CXI module is nee ded to switch the pow er signal to control the valve .
A common a pplic ation is to tr ansfe r data betwe en a computer and equipment suc h a s da ta logger s, data proc essors,
and printer s. Be cause this e quipme nt usually tra nsfe rs da ta in one byte ( 8-bit) inc reme nts, the digita l lines on a plugin digital I /O boa rd a re a rra nged in groups of e ight. I n a ddition, some boards with digita l c apabilitie s will ha ve
handsha king cir cuitry f or communic ation sync hroniza tion purposes. The number of c hannels, da ta r ate, a nd
handsha king ca pabilitie s a re all important specif ic ations that should be understood and ma tched to the applica tion.
Timing I/O
C ounte r/time r circ uitry is usef ul for many applica tions, including counting the occ urre nce s of a digita l eve nt, digital
pulse timing, and gene rating squa re wa ves a nd pulses. Y ou c an implement all of these a pplic ations using thre e
counte r/time r signals – ga te , source , and output. The ga te is a digital input that is use d to enable or disable the
func tion of the c ounter. The sour ce is a digita l input that ca use s the counte r to incre ment e ac h time it toggles, a nd
ther efor e provides the timebase f or the ope ration of the counte r. Fina lly, the output gene ra te s digital squa re wa ves
and pulses a t the output line .
The most significant specifications for oper ation of a counte r/time r a re the re solution and clock frequency. The
resolution is the number of bits the counter uses. A higher resolution simply means that the counter can count
higher. The clock frequency determines how fast you can toggle the digital source input. With higher frequency, the
counter increments faster and therefore can detect higher frequency signals on the input and generate higher
frequency pulses and square waves on the output. The DAQ-STC counter/timer used on our E Series DAQ boards,
for example, has 16 and 24-bit counters with a clock frequency of 20 MHz. The DAQ-STC is a National Instruments
9
custom ASIC designed specifically for DAQ applications. In comparison with the off-the-shelf counter/timer chips
generally used on DAQ boards, the DAQ-STC is in a league of its own. For example, the DAQ-STC is an up/down
counter/timer, meaning that it can use additional external digital signals to count up or down, depending on whether
the level is high or low. This type of counter/timer can measure positioning from rotary or linear encoders. Other
special functions include buffered pulse-train generation, timing for equivalent time sampling, relative time
stamping, and instantaneous changing of sampling rate.
Figure 7. Automobile Lubricant Test Application Showing SCXI Chassis
and LabVIEW running on a Macintosh
Software
Software transforms the PC and DAQ hardware into a complete DAQ, analysis, and display system. DAQ hardware
without software is useless – and DAQ hardware with poor software is almost useless. The majority of DAQ
applications use driver software. Driver software is the layer of software that directly programs the registers of the
DAQ hardware, managing its operation and its integration with the computer resources, such as processor interrupts,
DMA, and memory. Driver software hides the low-level, complicated details of hardware programming, providing
the user with an easy-to-understand interface.
For example, the code that follows shows NI-DAQ function calls used in C to read and scale a voltage from an
analog input channel of an MIO-16E-10.
main()
{
/* Program to read and scale an analog input */
int
brd,
/* Which board to read analog value from */
chan,
/* Analog input channel to read value from */
gain,
/* Software-programmable gain to use on channel */
reading;
/* Binary result of A/D conversion */
Double voltage;
/* Voltage value at input channel after scaling */
brd = 1; /* Read from board 1, */
chan = 3;
/* channel 3, */
gain = 100;
/* with gain of 100 */
AI_Read(brd, chan, gain, &reading);
/* Take a reading */
AI_Scale(brd, gain, reading, &voltage);
/* Scale to voltage */
printf(“\nThe voltage is %lf volts”, voltage);
10
}
The incr easing sophistica tion of DAQ hardw are , computer s, and sof tw are c ontinue s to e mphasize the impor tance
and value of good dr iver softwar e. Prope rly sele cted driver softwa re c an deliver an optimal combination of
fle xibility and per forma nce, w hile a lso signific antly r educing the time requir ed to deve lop the DAQ applica tion.
While selec ting drive r sof tw are , there a re seve ral fa ctors to consider .
Whic h Functions Ar e Available? – Drive r f unctions f or c ontrolling DAQ har dwar e can be groupe d into a nalog I /O ,
digita l I/O, a nd timing I/O. Although most dr ivers will have this ba sic func tiona lity, you will want to make sure tha t
the driver c an do more than simply ge t da ta on and off the board. Ma ke sure the driver has the f unctionality to:
•
•
•
•
•
•
•
Ac quir e data at spe cifie d sampling r ates
Ac quir e data in the backgr ound while proc essing in the f oregr ound
Use progr ammed I/O, interr upts, a nd DMA to tra nsfe r da ta
S tr ea m data to a nd f rom disk
P erf orm se vera l func tions simultane ously
Inte grate more than one DAQ boar d
Inte grate sea mle ssly with signal conditioning equipment
The se a nd othe r f unctions of the DAQ driver , which are inc lude d in the Na tiona l Instrume nts NI- DAQ driver
softwa re, c an save the user a consider able amount of time.
Whic h Ope ra ting Systems Ca n You Use with the Drive r? – Ma ke sure that the drive r sof tw are is c ompatible w ith the
oper ating systems you plan to use now a nd in the f uture. The dr ive r should also be de signed to ca pita liz e on the
diffe re nt fe ature s and ca pabilitie s of the OS. For exa mple , while dr ive rs writte n f or Windows 3. x ma y run under
Windows 95, only drive rs w ritte n in f ull 32-bit c ode for Windows 95 c an ta ke advanta ge of the incr ea sed
per forma nce and robustness ava ila ble with Windows 95. Drive rs f or W indows 95 should also be able to wor k
together with Windows 95 Plug and Play to e nsure that your system is easy to set up a nd c onfigure. Y ou may also
nee d the fle xibility to por t your code e asily betwe en platforms, say fr om a Windows PC to a Ma cintosh or a Sun
S PARC sta tion. N I-DA Q dr ive r softwar e is ava ila ble f or Windows 95/NT /3. 1, DOS, Mac OS, and Sun Sola ris.
NI -DAQ prote cts your softwa re investment be ca use you ca n switch betwe en har dware pr oducts or ope rating
systems with little or no modific ation to your a pplic ation
Whic h Progra mming Langua ges Ca n You Use with the Drive r? – Ma ke sure that the drive r c an be ca lle d fr om your
fa vorite progra mming la nguage , and is designed to wor k we ll within that de velopment environment. A
progr amming langua ge suc h a s Visua l Ba sic, for e xample, has an eve nt- driven deve lopme nt envir onme nt that use s
contr ols for deve loping the application. If you are de veloping in the Visua l Basic environment, you need to make
sure that the dr ive r has custom controls, such as those in NI- DAQ, to ma tch the methodology of the progr amming
langua ge.
Ar e the Ha rdwa re Functions You Nee d A cce ssible in Softwa re ? – A problem occurs when a developer purchases
DAQ hardware, then combines the hardware with software, only to find that a required hardware feature is not
handled by the software. The problem occurs most frequently when the hardware and software are developed by
different companies. By asking this question, you can save yourself time searching through the software manuals
looking for a function that does not exist. NI-DAQ, which is developed at National Instruments along with our DAQ
hardware, handles every function listed on the data sheets of our DAQ hardware.
Doe s the Drive r Limit Perf ormanc e? – Because the driver is an additional layer, it may cause some performance
limitations. In addition, operating systems such as Windows 3.1 can have significant interrupt latencies. If not dealt
with properly, these latencies can greatly reduce the performance of the DAQ system. NI-DAQ is a highperformance driver that has code written specifically to reduce the interrupt latencies of Windows and to provide
acquisition rates up to 1 MS/s.
The answ ers to these que stions w ill give you an indic ation of the eff ort tha t has gone into developing the dr ive r
softwa re. I dea lly, you want to get your dr iver softwar e from a company that ha s a s much expe rtise in the
deve lopme nt of the DAQ softwa re as the y do in the deve lopme nt of DAQ har dwar e.
11
Applica tion Sof tw are – An additiona l wa y to pr ogra m DAQ har dwar e is to use applica tion softwa re. But e ven if you
use applica tion softwar e, it is importa nt to know the a nswer s to the pr evious que stions, bec ause the applica tion
softwa re will use driver softwa re to c ontrol the DAQ ha rdwar e. Applica tion softwa re adds ana lysis a nd pr esenta tion
ca pabilitie s to the drive r sof tw are . Application sof twar e a lso integra tes instrument control (GPIB, RS-232, and VXI )
with da ta a cquisition. N ational I nstr ume nts off ers LabW indows/CVI , application sof twar e f or the tra ditiona l
C progr ammer , and LabVI EW, a pplic ation softwa re with gr aphica l progr amming methodology, for deve loping
complete instrumentation, ac quisition, and control applications. Both produc ts ca n be a ugme nted w ith add-on
toolkits for specia l func tiona lity. Compone ntWorks gives c omple te instrume nta tion ca pabilitie s to Visual Ba sic
through OLE custom controls. For the spre adshe et use r, Mea sure off ers DAQ ca pabilitie s dire ctly within the
Windows Exce l e nvir onme nt. For the Windows DAQ user who wants r ea dy-to-run virtual instruments,
Virtua lBenc h of fer s a n oscilloscope , dynamic signa l ana lyzer , function gener ator, D MM, a nd da ta logge r. For
ana lysis of the da ta you collec t, we offe r HiQ w ith extensive numeric al a nalysis a nd visualiza tion capa bilities.
Figure 8. VirtualBench Stand-Alone Virtual Instruments – Oscilloscope and Function Generator
Developing Your System
To develop a high quality DAQ system for measurement and control or test and measurement, you must understand
each of the components involved. Of all the DAQ system components, the element that should be examined most
closely is the software. Because plug-in DAQ boards do not have displays, the software is the only interface you
have to the system. The software is the component that relays all the information about the system, and it is the
element that controls the system. The software integrates the transducers, signal conditioning, DAQ hardware, and
analysis hardware into a complete, functional DAQ system.
12
Figure 9. With the signal processing functions in the LabWindows/CVI Advanced Analysis Library, you can
perform frequency analysis, filtering, and windowing operations on your data.
Therefore, when developing a DAQ system, be sure to completely evaluate the software. The hardware components
can be selected by determining the requirements of your system and making sure that the hardware specifications are
compatible with your system and your needs. Carefully selecting the proper software—whether it be driver level or
application software—can save you a lot of development time and money.
13