Upload
vancong
View
231
Download
5
Embed Size (px)
Citation preview
Physics 3100 Electronics, Fall 2008, Digital Circuits 1
LabView Exercises: Part IIIThe working VIs should be handed in to the TA at the end of the lab.
This is a lab under development so we may experience some “glitches” the first time through. Please bearwith us.
Initializing the NI 6251 and SCC68sThe NI 6251 Multifunction I/O allows rapid analog to digital conversion and input to the computer as wellas rapid Digital to Analog conversion and output from the computer via the USB port. It also providesdigital I/O capabilities as well as some timer functions. We have interfaced this device to an SCC68 boxcontaining analog and digital buffers to protect the sensitive inputs and outputs of the 6251. These twodevices are connected by a 37 pin cable. The banana plugs and BNC connectors which we have added tothe SCC68 provide a convenient interface to the student’s experiments.
Exercise 1: Using MAX to initialize the NI 6251
The first time this hardware is used on any given computer it must be initialized. The Measurement andAutomation Explorer (MAX) software provides an easy way to identify the NI hardware connected to thecomputer. Follow the following steps:
1) Once you are sure that the NI 6251 and SCC68 are correctly connected and powered on, launch MAXby double clicking on its icon on the desk-top.
Physics 3100 Electronics, Fall 2008, Digital Circuits 2
2) On the left side of the window which MAX opens you will see a column entitled “Configuration”.Double-click on “Devices and Interfaces” to expand the sub-category (or click on the ‘+’ box). Double-click on NI-DAQmx Devices. The expanded sub-category should show an NI USB-6251 (Mass Termi-nation): “Dev xx” (there will only be one such entry for your computer).
3) Click on the NI USB 6251 entry (it should be showing a green circuit board on the left to indicate thatit is connected).
4) Click on the Properties tab at the centre top of the window. This will open a “Device Properties”dialog box. On the Accessory tab which is displayed there will be a check-list. Scroll down the list tofind SCC-68 as shown. Click on SCC-68 and on “OK”.
Physics 3100 Electronics, Fall 2008, Digital Circuits 3
5) Now click on the tab “Test Panels..” at the top of the window to display the test panel dialog box.
This panel will allow you to test the functioning of your NI 6251 and the SCC 68 which is connected
Physics 3100 Electronics, Fall 2008, Digital Circuits 4
to it.
6) Begin by testing the Analog Input channels (the first tab). The channels which are connected via theSCC 68 are Dev*/ai4 and Dev*/ai12. First select Channel Name Dev*/ai4 and set up the testfor Continuous Mode, and the RSE Input Configuration, as shown below.
If there is no signal source connected to the BNC connector labelled AI0 on the SCC 68 the displaychart should show noise similar to that displayed on the figure when you press Start.
6) Connect the output from your function generator to the input AI0 BNC connector. Since the acquisitionrate specified in the test panel is 1000 Hz (see figure above) your function generator frequency shouldbe set to a frequency which is less than 500 Hz. (You must sample at least twice as fast as thehighest frequency of interest..this is the sampling theorem). Choose a suitably low frequency. Also,the input should have an amplitude less than 10 volts. If the output displayed on the panel is as you’dexpect, click on STOP and perform the same test on Channel Name Dev*/ai12 using the same setup parameters. If both channels pass this test, move on to the Analog Output test by clicking on theAnalog Output tab at the top of the window.
7) Connect the Dev*/ao0 output from BNC AO0 on the SCC 68 to your oscilloscope. Set up channel 0as shown below
Physics 3100 Electronics, Fall 2008, Digital Circuits 5
You should see a sine wave on your oscilloscope. Change the amplitude and frequency to verify thateverything is working correctly then repeat the test using Dev*/ao0 and the AO1 BNC connector.
8) Finally, click on the“Digital I/O”tab at the top of the window and test the 4 output and 4 input digitallines. These are connected to the coloured banana jacks and are labelled DO0 through DO3 and DI0through DI3. Set up the test panel as shown below, using port1 and click on “Start”. Lines 0 through3 are assigned as inputs while those from 4 through 7 are outputs. All 8 lines are connected internallyto pull-up resistors so the 4 input lines )bits 0 through 3) show up as “high” unless something pullsthem down. Connect any of the 4 lines DI0 through DI3 to ground using a wire with banana plugsand the corresponding circular green “light” on the test panel should go dark.. Next, connect one ofthe output lines DO0 through DO3 to an LED (use a 1 kΩ series resistor). Then using the test panel’sslide switches you should be able to turn the LED on and off. This demonstrates that the digital I/Ois working. After you have completed these tests you may continue with the next exercise.
Physics 3100 Electronics, Fall 2008, Digital Circuits 6
Exercise 2: Data Acquisition Using the NI USB-6251plus SCC 68The National Instruments USB-6251 provides 16 single-ended or 8 differential channels of analog input. Itdoes this using a single 16-bit analog to digital converter capable of digitizing at a maximum rate of 1.25MHz. The 16 channels are provided by multiplexing the input to this A/D converter. If more than onechannel is used the maximum aggregate sampling rate is 1.0 MHz (i.e., 500 kHz per channel for 2 channels,etc). It also provides two separate 16 bit analog output channels which can operate at up to 2.86 MHz for asingle channel or 2.0 MHz aggregate for two channels. See the attached data sheet for detailed specifications.
The NI SCC 68 provides the interface between the NI 6251 and the user’s experiment. We have enabledtwo analog input channels, channel ai4 and ai12 each of which is buffered by an Analog Devices OP249op-amp to provide operation over the full range of specifications of the NI 6251. The two digital outputsare also buffered by OP249’s operating with a series 51 Ω resistor to protect against short-circuits on theoutputs. Finally, we provide 4 digital input lines (port 1, bits 0 to 3) and 4 digital output lines (port 1, bits4 to 7) which are buffered by a 74LS244. There is a 560 Ω pull-up resistor on each digital input and output.
The NI USB 6251/SCC 68 combination is a flexible and powerful data acquisition and control systemand the exercise described below is an introduction to using such a system.
Physics 3100 Electronics, Fall 2008, Digital Circuits 7
Exercise 2: Data Acquisition using the A/D Converter
In this exercise you will build a LabView VI for acquiring data from the two analog input channels ai4 andai12. The VI allows you to change the sampling rate and to save the data to an“.lvf”file. (This is LabView’stext formatted data file format.)
Launch LabView and, under “New”, click on “Blank VI”. Decorate your front panel as shown below.
The corresponding block diagram should be as shown in the next figure.
Physics 3100 Electronics, Fall 2008, Digital Circuits 8
You will notice that the block diagram contains three loop structures: the outermost loop is a while loopwhich terminates only when the “STOP” button is pushed, the large inner loop is a “Case” structure whichexecutes every time you press the “READY” button. The small inner loop executes when you push the“Save?” button and saves the data to a file.
When you place the“DAQ Assistant”on the block diagram you will need to configure the physical channelbeing used (dev*/ai4). The configuration dialog box should open when you place it on the block diagram. Ifit doesn’t, right click on the icon and, from the menu displayed, select “Properties”. Set up channel dev*/ai4as shown.
Physics 3100 Electronics, Fall 2008, Digital Circuits 9
This VI allows you to collect “# of samples” data points at “Sampling Rate”. If you connect a sine waveto the AI0 input channel. The sampled data is displayed on the front panel graph. If you like the look ofthe data you can save it by pressing “Save?”.
Save a set of data and open the .lvm file with Windows NotePad to see the organization of the data file.Once your VI is working, save it to give to the TA. Then, click on “Save As” and choose “Substitute Copy
for Original” and give it a new name so that you can modify the VI for the next exercise.
Physics 3100 Electronics, Fall 2008, Digital Circuits 10
Exercise 3: Generating a Square Wave Output using the D/A Converter
If you modify the VI as shown by the Front Panel and Block Diagrams below, you will be able to generateand output a waveform which you can use to excite some external circuit. The A/D converter can then beuse to view the excitation and the response.
Physics 3100 Electronics, Fall 2008, Digital Circuits 11
As an example we suggest using a “square wave” excitation of an RLC circuit. Set up the D/A converterto provide a 50 Hz square wave, amplitude of 4 v. using a size of 1024 samples. This output should beconfigured to appear at Physical Channel Dev*/ao0. Build an RLC resonant circuit as shown
Use the output of the D/A (from BNC AO0) as Vi. Connect AI0 to the input side of the RLC circuit andconnect AI1 to the output side of the circuit.
When you click on the READY button, the VI generates roughly a single cycle of the square wave whichresults in a 4 volt step at the input to the resonance circuit. The circuit then rings at its characteristicfrequency ω0 = 1/
√LC. The ringing decays rapidly with time because of the internal resistance of the wire
used to make L1. Measure the frequency of the ringing and estimate the decay time.Save the VI and give the results to the TA.
Requirements and Compatibility | Ordering Information | Detailed Specifications | Pinouts/Front Panel Connections
With recent bandwidth improvements and new innovations from National Instruments, USB has evolved into a core bus of choice for measurement and automation applications. NIM Series high-speed devices for USB deliver high-performance data acquisition in an easy-to-use and portable form factor through USB ports on laptop computers and otherportable computing platforms. NI created NI signal streaming, an innovative patent-pending technology that enables sustained bidirectional high-speed data streams on USB. Thenew technology, combined with advanced external synchronization and isolation, helps engineers and scientists achieve high-performance applications on USB.
M Series high-speed multifunction data acquisition (DAQ) modules for USB are optimized for superior accuracy at fast sampling rates. They provide an onboard NI-PGIA 2amplifier designed for fast settling times at high scanning rates, ensuring 16-bit accuracy even when measuring all available channels at maximum speed. All high-speed deviceshave a minimum of 16 analog inputs, 24 digital I/O lines, seven programmable input ranges, analog and digital triggering, and two counter/timers. USB M Series devices are idealfor test, control, and design applications including portable data logging, field monitoring, embedded OEM, in-vehicle data acquisition, and academic. High-speed NI USB-625x MSeries devices have an extended two-year calibration interval.
Technical SalesCanada
(866) [email protected]
Unl
ike
typi
calm
ultif
unct
ion
US
Bda
taac
quis
ition
devi
ces,
NIU
SB
MS
erie
sD
AQ
devi
ces
inco
rpor
ate
NIs
igna
lstrea
min
g,a
pate
nt-p
endi
ngte
chno
logy
that
com
bine
sth
ree
inno
vativ
eha
rdw
are-
and
softw
are-
leve
ldes
ign
elem
ents
toen
able
sust
aine
dhi
gh-s
peed
and
bidi
rect
iona
ldat
ast
ream
sov
erU
SB
.NIs
igna
lstrea
min
g,al
ong
with
the
erro
rco
rrec
tion,
nois
ere
ject
ion,
pow
erm
anag
emen
t,an
dpo
wer
dist
ribut
ion
inhe
rent
inth
eU
SB
prot
ocol
,yie
lds
aro
bust
,sec
ure,
and
relia
ble
bus.
With
outN
Isig
nals
trea
min
g,a
mul
tifun
ctio
nda
taac
quis
ition
devi
ceco
uld
sust
ain
only
asi
ngle
high
-spe
edda
tast
ream
,effe
ctiv
ely
mak
ing
ita
sing
le-fun
ctio
nde
vice
.For
mor
ein
form
atio
n,vi
sitn
i.com
/usb
.
For
test
,you
can
use
the
MS
erie
shi
gh-s
peed
anal
ogin
puts
and
10M
Hz
digi
tall
ines
with
NIs
igna
lcon
ditio
ning
forap
plic
atio
nsin
clud
ing
test
,com
pone
ntch
arac
teriz
atio
n,an
dse
nsor
mea
sure
men
t.H
igh-
spee
dU
SB
-625
xM
Ser
ies
devi
ces
are
com
patib
lew
ithth
eN
ISC
Csi
gnal
cond
ition
ing
plat
form
,pro
vidi
ngam
plifi
catio
nfil
terin
gan
dpo
wer
forvi
rtua
llyev
ery
type
ofse
nsor
.Thi
spl
atfo
rmis
also
com
plia
ntw
ithIE
EE
1451
.4sm
artt
rans
duce
rel
ectron
icda
tash
eet(
TE
DS
)se
nsor
s,w
hich
offe
rdi
gita
lsto
rage
forse
nsor
data
shee
tin
form
atio
n.U
SB
MS
erie
sm
ultif
unct
ion
DA
Qde
vice
sal
soco
mpl
emen
texi
stin
gte
stsy
stem
sth
atne
edad
ditio
nalm
easu
rem
entc
hann
els.
For
high
er-c
hann
el-c
ount
sign
alco
nditi
onin
gon
US
B,c
onsi
derth
eN
ICom
pact
DA
Qor
NIS
CX
Ipla
tform
.
US
BM
Ser
ies
digi
tall
ines
can
driv
e24
mA
forre
lay
and
actu
ator
cont
rol.
By
cloc
king
the
digi
tall
ines
asfa
stas
10M
Hz
(with
onbo
ard
rege
nera
tion)
,you
can
use
thes
elin
esfo
rpu
lse-
wid
thm
odul
atio
n(P
WM
)to
cont
rolv
alve
s,m
otor
s,fa
ns,l
amps
,and
pum
ps.W
ithfo
urw
avef
orm
anal
ogou
tput
s,tw
o80
MH
zco
unte
r/tim
ers,
and
four
high
-spe
edda
tast
ream
son
US
B,M
Ser
ies
devi
ces
can
exec
ute
mul
tiple
cont
roll
oops
sim
ulta
neou
sly.
Hig
h-sp
eed
US
B-6
25x
MS
erie
sde
vice
sal
soof
ferdi
rect
supp
ortf
oren
code
rm
easu
rem
ents
,pr
otec
ted
digi
tall
ines
,and
digi
tald
ebou
nce
filte
rs.W
ithup
to80
anal
ogin
puts
,32
cloc
ked
digi
tall
ines
,and
four
anal
ogou
tput
s,yo
uca
nex
ecut
em
ultip
leco
ntro
lloo
psw
itha
sing
lede
vice
.
You
can
also
crea
tea
com
plet
ecu
stom
mot
ion
cont
rolle
rby
com
bini
ngU
SB
MS
erie
sde
vice
sw
ithth
eN
ISof
tMot
ion
Dev
elop
men
tMod
ule.
For
desi
gnap
plic
atio
ns,y
ouca
nus
ea
wid
era
nge
ofI/O
–from
80an
alog
inpu
tsto
48di
gita
llin
es–
tom
easu
rean
dve
rify
prot
otyp
ede
sign
s.U
SB
MS
erie
sde
vice
san
dN
ILa
bVIE
WS
igna
lExp
ress
inte
ract
ive
mea
sure
men
tsof
twar
ede
liver
benc
htop
mea
sure
men
tsto
the
PC
.With
LabV
IEW
Sig
nalE
xpre
ss,y
ouca
nqu
ickl
ycr
eate
desi
gnve
rific
atio
nte
sts.
The
fast
acqu
isiti
onan
dge
nera
tion
rate
sof
high
-per
form
ance
US
BM
Ser
ies
high
-spe
edde
vice
sal
ong
with
LabV
IEW
Sig
nalE
xpre
sspr
ovid
efa
stde
sign
anal
ysis
.You
can
conv
erty
ourte
sted
and
verif
ied
LabV
IEW
Sig
nalE
xpre
sspr
ojec
tsto
LabV
IEW
appl
icat
ions
forim
med
iate
MS
erie
sD
AQ
use,
and
brid
geth
ega
pbe
twee
nte
st,c
ontrol
,and
desi
gnap
plic
atio
ns.
Sho
rten
your
time
tom
arke
tby
inte
grat
ing
Nat
iona
lIns
trum
ents
OE
Mpr
oduc
tsin
your
desi
gn.B
oard
-onl
yve
rsio
nsof
US
BM
Ser
ies
DA
Qde
vice
sar
eav
aila
ble
forO
EM
appl
icat
ions
,with
com
petit
ive
quan
tity
pric
ing
and
softw
are
cust
omiz
atio
n.The
NIO
EM
Elit
eP
rogr
amof
fers
free
30-d
aytria
lkits
forqu
alifi
edcu
stom
ers.
Vis
itni.c
om
/oem
form
ore
info
rmat
ion.
Nat
iona
lIns
trum
ents
mea
sure
men
tser
vice
sso
ftwar
e,bu
iltar
ound
NI-D
AQ
mx
driv
erso
ftwar
e,in
clud
esin
tuiti
veap
plic
atio
npr
ogra
mm
ing
inte
rfac
es,c
onfig
urat
ion
tool
s,I/O
assi
stan
ts,a
ndot
herto
ols
desi
gned
tore
duce
syst
emse
tup,
conf
igur
atio
n,an
dde
velo
pmen
ttim
e.N
atio
nalI
nstrum
ents
reco
mm
ends
usin
gth
ela
test
vers
ion
ofN
I-D
AQ
mx
driv
erso
ftwar
efo
rap
plic
atio
nde
velo
pmen
tin
NIL
abV
IEW
,Lab
VIE
WS
igna
lExp
ress
,Lab
Win
dow
s™/C
VI,
and
Mea
sure
men
tStu
dio.
To
obta
inth
ela
test
vers
ion
ofN
I-D
AQ
mx,
visi
tni.c
om
/support
/daq
/ver
sions.
NIm
easu
rem
ents
ervi
ces
softw
are
spee
dsup
your
deve
lopm
entw
ithfe
atur
esin
clud
ing:
• • • • • • • MS
erie
sde
vice
sar
eco
mpa
tible
with
the
follo
win
gve
rsio
ns(o
rla
ter)
ofN
Iapp
licat
ion
softw
are
–La
bVIE
W,L
abW
indo
ws/
CV
I,or
Mea
sure
men
tStu
dio
vers
ions
7.x
orLa
bVIE
WS
igna
lExp
ress
2.x.
Sig
nalc
ondi
tioni
ngis
requ
ired
forse
nsor
mea
sure
men
tsor
volta
gein
puts
grea
terth
an10
V.N
ISC
Cpr
oduc
ts,w
hich
are
desi
gned
toin
crea
seth
epe
rfor
man
cean
dre
liabi
lity
ofyo
urda
taac
quis
ition
syst
em,a
reup
to10
times
mor
eac
cura
teth
anus
ing
term
inal
bloc
ksal
one.
For
mor
ein
form
atio
n,vi
sitn
i.com
/sig
con.
For
aco
mpl
ete
listo
facc
esso
ries,
visi
tthe
prod
uctp
age
onni
.com
.
NIm
easu
rem
enth
ardw
are
isca
libra
ted
toen
sure
mea
sure
men
tacc
urac
yan
dve
rify
that
the
devi
cem
eets
itspu
blis
hed
spec
ifica
tions
.To
ensu
reth
eon
goin
gac
cura
cyof
your
mea
sure
men
thar
dwar
e,N
Ioffe
rsba
sic
orde
taile
dre
calib
ratio
nse
rvic
eth
atpr
ovid
eson
goin
gIS
O90
01au
ditc
ompl
ianc
ean
dco
nfid
ence
inyo
urm
easu
rem
ents
.To
lear
nm
ore
abou
tNIc
alib
ratio
nse
rvic
esor
tolo
cate
aqu
alifi
edse
rvic
ece
nter
near
you,
cont
acty
ourlo
cals
ales
offic
eor
visi
tni.c
om/c
alib
ratio
n.
Get
answ
ers
toyo
urte
chni
calq
uest
ions
usin
gth
efo
llow
ing
Nat
iona
lIns
trum
ents
reso
urce
s.
Support
-V
isit
ni.c
om/s
uppo
rtto
acce
ssth
eN
IKno
wle
dgeB
ase,
exam
ple
prog
ram
s,an
dtu
toria
lsor
toco
ntac
tour
appl
icat
ions
engi
neer
sw
hoar
elo
cate
din
NIs
ales
offic
esar
ound
the
wor
ldan
dsp
eak
the
loca
llan
guag
e.D
iscu
ssio
nForu
ms
-V
isit
foru
ms.
ni.c
omfo
ra
dive
rse
seto
fdis
cuss
ion
boar
dson
topi
csyo
uca
reab
out.
Onlin
eC
om
munity
-V
isit
com
mun
ity.n
i.com
tofin
d,co
ntrib
ute,
orco
llabo
rate
oncu
stom
er-c
ontrib
uted
tech
nica
lcon
tent
with
user
slik
eyo
u.
Whi
leyo
um
ayne
verne
edyo
urha
rdw
are
repa
ired,
NIu
nder
stan
dsth
atun
expe
cted
even
tsm
ayle
adto
nece
ssar
yre
pairs
.NIo
ffers
repa
irse
rvic
espe
rfor
med
byhi
ghly
trai
ned
tech
nici
ans
who
quic
kly
retu
rnyo
urde
vice
with
the
guar
ante
eth
atit
will
perfor
mto
fact
ory
spec
ifica
tions
.For
mor
ein
form
atio
n,vi
sitn
i.com
/rep
air.
The
NIt
rain
ing
and
certifi
catio
npr
ogra
mde
liver
sth
efa
stes
t,m
ostc
erta
inro
ute
toin
crea
sed
prof
icie
ncy
and
prod
uctiv
ityus
ing
NIs
oftw
are
and
hard
war
e.Tra
inin
gbu
ilds
the
skill
sto
mor
eef
ficie
ntly
deve
lop
robu
st,m
aint
aina
ble
appl
icat
ions
,whi
lece
rtifi
catio
nva
lidat
esyo
urkn
owle
dge
and
abili
ty.
Cla
ssro
om
trai
nin
gin
cities
worl
dw
ide
-th
em
ostc
ompr
ehen
sive
hand
s-on
trai
ning
taug
htby
engi
neer
s.O
n-s
ite
trai
nin
gat
your
faci
lity
-an
exce
llent
optio
nto
trai
nm
ultip
leem
ploy
ees
atth
esa
me
time.
Onlin
ein
stru
ctor-
led
trai
nin
g-lo
wer
-cos
t,re
mot
etrai
ning
ifcl
assr
oom
oron
-site
cour
ses
are
notp
ossi
ble.
Cours
eki
ts-lo
wes
t-co
st,s
elf-pa
ced
trai
ning
that
you
can
use
asre
fere
nce
guid
es.
Tra
inin
gm
ember
ship
san
dtr
ainin
gcr
edits
-to
buy
now
and
sche
dule
trai
ning
late
r.
Vis
itni
.com
/trai
ning
form
ore
info
rmat
ion.
NIo
ffers
optio
nsfo
rex
tend
ing
the
stan
dard
prod
uctw
arra
nty
tom
eett
helif
e-cy
cle
requ
irem
ents
ofyo
urpr
ojec
t.In
addi
tion,
beca
use
NIu
nder
stan
dsth
atyo
urre
quire
men
tsm
aych
ange
,the
exte
nded
war
rant
yis
flexi
ble
inle
ngth
and
easi
lyre
new
ed.F
orm
ore
info
rmat
ion,
visi
tni.c
om/w
arra
nty.
NIo
ffers
desi
gn-in
cons
ultin
gan
dpr
oduc
tint
egra
tion
assi
stan
ceif
you
need
NIp
rodu
cts
forO
EM
appl
icat
ions
.For
info
rmat
ion
abou
tspe
cial
pric
ing
and
serv
ices
forO
EM
cust
omer
s,vi
sitn
i.com
/oem
.
Spe
cific
atio
nslis
ted
belo
war
ety
pica
lat2
5°C
unle
ssot
herw
ise
note
d.R
efer
toth
eM
Ser
ies
Use
rM
anua
lfor
mor
ein
form
atio
nab
outN
I625
xde
vice
s.