Вы находитесь на странице: 1из 24

1e|emark Un|vers|ty Co||ege

ueparLmenL of LlecLrlcal Lnglneerlng, lnformaLlon 1echnology and CyberneLlcs


Faculty of Technology, Postboks 203, Kjlnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01







NI USB-6008 DAQ Device
PAnS-L11L8 PALvC8SLn, 2013.08.16


ll

Table of Contents
1able of ConLenLs .................................................................................................................................... ll
1 lnLroducLlon ...................................................................................................................................... 1
2 SysLem uescrlpLlon ........................................................................................................................... 2
2.1 uocumenLaLlon ......................................................................................................................... 3
3 ConflguraLlon .................................................................................................................................... 4
3.1.1 1esLlng Lhe uS8-6008 ln MAx ............................................................................................ 4
3.2 CreaLlng 1asks ........................................................................................................................... 9
4 uslng nl uS8-6008 ln LabvlLW ....................................................................................................... 10
4.1 uAC AsslsLanL .......................................................................................................................... 11
4.1.1 Analog lnpuL ..................................................................................................................... 11
4.1.2 Analog CuLpuL .................................................................................................................. 18

1

1 Introduction
nl uS8-6008 ls a slmple and low-cosL mulLlfuncLlon l/C devlce from naLlonal lnsLrumenLs LhaL wlll be
used ln Lab Work aL 1elemark unlverslLy College (1uC).
1he nl uS8-6008 ls a uS8 based daLa acqulslLlon (uAC) and conLrol devlce wlLh analog lnpuL and
ouLpuL and dlglLal lnpuL and ouLpuL.
2

2 System Description
nl uS8-6008 ls a slmple and low-cosL mulLlfuncLlon l/C devlce from naLlonal lnsLrumenLs.

1he devlce has Lhe followlng speclflcaLlons:
8 analog lnpuLs (12-blL, 10 kS/s)
2 analog ouLpuLs (12-blL, 130 S/s)
12 dlglLal l/C
uS8 connecLlon, no exLra power-supply neeeded
CompaLlble wlLh LabvlLW, LabWlndows/Cvl, and MeasuremenL SLudlo for vlsual SLudlo .nL1
nl-uACmx drlver sofLware

1he maln feaLures of nl uS8-6008 are as follows:
Analog lnpuL (Al): 8 lnpuLs wlLh referenced slngle ended slgnal coupllng or 4 lnpuLs wlLh
dlfferenLlal slgnal coupllng. SofLware-conflgurable volLage ranges: 20v, 10v, 3v, 4v,
2.3v, 2v, 1.23v, 1v. Max sampllng raLe ls 48kS/s (48000 samples per second). 12 blLs Au
converLer.
Analog ouLpuL (AC): 2 ouLpuLs. volLage range ls 0 - 3v (flxed). CuLpuL raLe ls 130Pz
(samples/second). 12 blLs uA converLer.
ulglLal lnpuL (ul) and dlglLal ouLpuL (uC): 12 channels whlch can be used as elLher ul or uC
(conflgured lndlvldually). 1hese 12 channels are organlzed ln porLs, wlLh orL 0 havlng llnes 0,
.., 7, and orL 1 havlng llnes 0, .., 3. lnpuL low ls beLween -0.3v and +0.8v. lnpuL hlgh ls
beLween 2.0v and +3.8v. CuLpuL low ls below 0.8v. CuLpuL hlgh ls above 2v.
3 SysLem uescrlpLlon
Lab Equipment: NI USB-6008 DAQ Device

CounLer: 32 blLs. CounLlng on falllng edge.
Cn-board volLage sources (avallable aL lndlvldual Lermlnals): 2.3v and 3.0v
ower: uS8-6008 ls powered vla Lhe uS8 cable.


?ou may use dlfferenL uevelopmenL SofLware when worklng wlLh Lhe nl uS8-6008 devlce, e.g.,
LabvlLW, C, or vlsual SLudlo.
?ou may also use Lhe devlce on dlfferenL laLforms, such as Wlndows, Mac and Llnux.
1hls documenL wlll focus on uslng LabvlLW for Wlndows.
2.1 Documentation
1he documenLaLlon for Lhe nl uS8-6008 uAC devlce ls as follows:
nl uS8-6008 uaLa SheeL
nl uS8-6008 user Culde
nl-uAC mx for uS8 uevlces
1hese documenLs are avallable from www.nl.com or from my 8log: hLLp://home.hlL.no/~hansha/

4

3 Configuration
Conflgurlng and LesLlng: uS8-6008 can be conflgured and LesLed uslng MAx (MeasuremenL and
AuLomaLlon Lxplorer), whlch ls lnsLalled wlLh Lhe nl-uACmx urlver SofLware.
1he flrsL Llme you connecL Lhe uS8-6008 Lo Lhe C, Lhe Wlndows Pardware lnsLaller Wlzard wlll
open.
1he wlzard searches Lhe C for Lhe necessary drlver sofLware for Lhe uS8-6008. 1hls drlver sofLware
was lnsLalled along wlLh Lhe lnsLallaLlon of Lhe nl-uAC sofLware. When Lhe wlzard has flnlshed Lhe
lnsLallaLlon of Lhe drlver sofLware, Lhe uS8-6008 ls ready for use.
3.1.1 Testing the USB-6008 in MAX
8efore you sLarL Lo use Lhe uS8-6008 ln an appllcaLlon, you should LesL Lhe devlce ln Lhe
MeasuremenL and AuLomaLlon Lxplorer (MAk).


ln Lhe MAx wlndow, expand Lhe uevlces and lnLerfaces" node and Lhen nl uACmx uevlces".
8lghL-cllck on Lhe nl uS8-6008 devlce and selecL Self-1esL".
3 ConflguraLlon
Lab Equipment: NI USB-6008 DAQ Device



Popefully Lhe self-LesL passes wlLhouL errors. 1hen, you should LesL Lhe lndlvldual channels of Lhe
uS8-6008 Lo check LhaL Lhe lnpuL slgnals are deLecLed correcLly by Lhe uS8-6008, and LhaL Lhe ouLpuL
slgnals generaLed by Lhe uS8-6009 have correcL values. 1hls l/C can be LesLed ln several ways,
dependlng on whlch channels you acLually wanL Lo LesL.
We wlll perform a slmple loopback LesL:
Pere, leL us LesL analog ouLpuL channel 0 (AC0) and Lhe analog lnpuL channel 0 (Al0) Lo see lf Lhey
work correcLly. We wlll perform a very slmple LesL, whlch ls sufflclenL lf we are Lo check LhaL boLh
AC0 and Al0 work correcLly. 1he LesL procedure, whlch ls denoLed !""#$%&', ls Lo connecL Lhe Al0
channel Lo Lhe AC0 channel. 1hen we generaLe some legal volLage aL AC0. lf Al0 deLecLs Lhe same
volLage, we know LhaL boLh AC0 and Al0 work. (We may Lhen repeaL Lhls procedure for oLher
channels.) lf for some reason Al0 deLecLs some oLher volLage Lhan Lhe value we seL for AC0, Lhen
Lhere ls an error ln elLher Lhe Al0 channel or ln Lhe Lhe AC0 channel, and furLher lnvesLlgaLlons are
necessary.
1o prepare for Lhe loopback LesL, we wlre LogeLher Al0 and AC0. 1o see Lhe Lermlnals of Lhe
uS8-6000, selecL uevlce lnouLs" from Lhe rlghL-cllck menu.
6 ConflguraLlon
Lab Equipment: NI USB-6008 DAQ Device



1he llgure shows Lhe Al0 and AC0 channels wlred LogeLher.

7 ConflguraLlon
Lab Equipment: NI USB-6008 DAQ Device

1o acLually perform Lhe loopback LesL, rlghL-cllck on Lhe nl uS8-6008 devlce ln MAx, and Lhen selecL
1esL anels.." ln order Lo open Lhe 1esL anels. ln Lhe 1esL anels wlndow, selecL Lhe Analog CuLpuL
Lab.


Figure 11: The Voltage Output dialog window in the Test Panels window
ln Lhe Analog CuLpuL Lab, selecL any volLage beLween 0v and 3v.
nexL, cllck Lhe Analog lnpuL Lab ln Lhe 1esL anels wlndow.
8 ConflguraLlon
Lab Equipment: NI USB-6008 DAQ Device


1he Analog lnpuL Lab should lndlcaLe Lhe same (or almosL Lhe same) volLage as ls seL ouL on AC0.
1here may be a small dlfference beLween Lhe values due Lo Lhe llmlLed resoluLlon ln Lhe
uA-converLer (dlglLal-Lo-analog) and ln Lhe Au-converLer (analog-Lo-dlglLal).

9 ConflguraLlon
Lab Equipment: NI USB-6008 DAQ Device

3.2 Creating Tasks
ln general, a Lask represenLs Lhe conflguraLlon of Lhe slgnal lnpuL or slgnal ouLpuL operaLlon Lo be
execuLed by Lhe l/C devlce. CreaLlng Lasks ls a general feaLure of Lhe MAx uLlllLy, l.e., Lasks are used
also for conflgure oLher l/C devlces Lhan Lhe uS8-6008.
ln general, a Lask can conLaln one or more (!"$%! "* !"&%! +,*-.%! &/%001!2, and one such vlrLual
channel ls based on one #/32,&%! &/%001! (havlng e.g. a screw Lermlnal on Lhe l/C devlce). A local
vlrLual channel exlsLs only wlLhln lLs parenL Lask, whlle a global vlrLual channel may be used ln several
Lasks. lf a global channel ls reconflgured, all Lasks whlch lnvolve LhaL global channel are updaLed
accordlngly.
ln Lhe followlng lL descrlbed how Lo creaLe -%2'2 for Lhe analog lnpuL and Lhe analog ouLpuL
operaLlons. 1hese Lasks may be referred Lo ln Lhe appllcaLlon program, e.g. LabvlLW.



10

4 Using NI USB-6008 in
LabVIEW
ln order Lo use Lhe nl uS8-6008 ln LabvlLW you need Lo use Lhe uACmx funcLlons, see llgure below.


uACmx - uaLa AcqulslLlon paleLLe:
11 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device


4.1 DAQ Assistant
1he easlesL ways ls Lo use Lhe uAC AsslsLanL.
4.1.1 Analog Input
When you drag Lhe uAC AsslsLanL lcon on your 8lock ulagram, Lhe followlng wlndow appears:

ln Lhls wlndow you need Lo selecL elLher Acqulre Slgnals" (l.e., lnpuL Slgnals) or CeneraLe Slgnals"
(l.e., CuLpuL Slgnals).
12 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device

SelecL Acqulre Slgnals - Analog lnpuL - volLage.

ln Lhe nexL wlndow you selecL whlch Analog lnpuL you wanL Lo use. SelecL al0 (Analog lnpuL channel
0) and cllck llnlsh.

1he followlng wlndow appears:
13 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device


ln Lhe 1|m|ng Sett|ngs SelecL 1 Samp|e (Cn Demand)".
14 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device



1he nexL sLep ls Lo selecL Lhe Slgnal lnpuL 8ange. A common slgnal ls 0-3v.


?ou may also rename Lhe name of Lhe channel (rlghL-cllck on Lhe name):
13 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device




?ou are now flnlshed wlLh Lhe conflguraLlon. Cllck Ck ln Lhe uAC AsslsLanL wlndow 1he uAC
AsslsLanL lcon appears on Lhe 8lock ulagram:




16 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device

Lxamp|e:
Wlre Lhe daLa ouLpuL Lo a numerlc lndlcaLor llke Lhls (and hlL Lhe 8un buLLon):

1hen numerlc lndlcaLor wlll show, e.g., Lhe followlng value:


Lxamp|e:
lf you wanL a conLlnuous acqulslLlon, puL a Whlle loop around Lhe uAC AsslsLanL llke Lhls:

Powever you should noL use Lhe uAC AsslsLanL lnslde a loop because of Lhe lack of performance. 1he
followlng ls Lherefore beLLer:
17 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device


ln Lhls example we have used some of Lhe oLher vls ln Lhe uACmx paleLLer as well.
1he lronL anel may loook llke Lhls.

ln Lhls example we assume LhaL we connecL wlres for Analog CuL and Analog ln LogeLher llke Lhls (a
socalled loopback LesL):
18 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device



An alLernaLlve meLhod wlLhouL uslng Lhe uAC AsslsLanL ls follows:

lor more advanced appllcaLlons Lhls ls Lhe recommended approach.
[Lnd of Lxample]
4.1.2 Analog Output
Analog CuLpuL ls slmllar.
19 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device





20 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device


Lxamp|e:

Cr lnslde a loop:
21 uslng nl uS8-6008 ln LabvlLW
Lab Equipment: NI USB-6008 DAQ Device


An alLernaLlve meLhod wlLhouL uslng Lhe uAC AsslsLanL ls follows:

lor more advanced appllcaLlons Lhls ls Lhe recommended approach.
[Lnd of Lxample]






1e|emark Un|vers|ty Co||ege
Iacu|ty of 1echno|ogy
k[|nes k|ng S6
N-3918 orsgrunn, Norway
www.h|t.no



nans-etter na|vorsen, M.Sc.
1e|emark Un|vers|ty Co||ege
Iacu|ty of 1echno|ogy
Department of L|ectr|ca| Lng|neer|ng, Informat|on 1echno|ogy and Cybernet|cs


L-ma||: hans.p.ha|vorsenQh|t.no
8|og: http:]]home.h|t.no]~hansha]
koom: 8-237a

Вам также может понравиться