You are on page 1of 42

Cho bn th Ch b tham gia vo i Cc kha hc ti hocdelam org hocdelam.

org

Ngn ng giao tip a knh gi con ngi, thut tan v cc thit b ngi
Nguyn B Hi

LabVIEW Trong K Thut


S lc kha hc Kha hc: Thi gian: Phng hc: Ngy hc: Ngi hng dn: Lp trnh LabVIEW cn bn 8:00 sng 110:00 sng (2 bui) Online Th 3 Nguyn B Hi bmnhy2003@yahoo.com

S lc ging vin g p Ging vin H S phm K thut TPHCM Nghin cu sinh, Biorobotics Lab, KUT, Hn quc Lnh vc nghin cu Biorobotics, Haptics, Biophysics Automotive Modeling and Control

LabVIEW Trong K Thut


Cc kha hc Cn bn Bi 1: Lm quen mi trng lp trnh LabVIEW Bi 2: Input v Output, while loop Bi 3: th v biu Bi 5: Case, Case structrure Bi 6: Lp trnh v ti u GUI Bi 7: Tiu lun cui kha Trung cp (5 lp) g p( p) 1. Giao tip cng COM 2. Giao tip USB thu thp d liu & iu khin thit b ngoi vi 3. M phng ng c DC 4. iu khin PID ng c DC s dng LabVIEW 5. Giao tip vi Matlab, TCP IP, c file Excel, PWM Generation, Simulation Kim tra: Lp trnh ng dng k thut, o to Website kha hc: http://hocdelam org http://hocdelam.org

Lm quen mi trng LabVIEW


Chun b cho kha hc - LabVIEW: Laboratory Virtual Instrumentation Engineering Workbench t 8 5 008 - Bn mi nht: 8.5.1 / 2008. - Ti liu trnh chiu ti lp - Mch giao tip COM (hocdelam.org)
L Lp trnh LabV VIEW

Din n tho lun http://vagam.dieukhien.net http://vagam dieukhien net

LabVIEW 8.5 DVD


4.7 Gbyte

o to trc tuyn http://hocdelam.org

B Hi Quang Hiu

- Mch giao tip USB (hocdelam.org) - Ti liu theo chuyn VAGAM

VAGAM - 2007

LabVIEW L bVIEW l g? ?

ng dng ca LV d

Ai ang dng LV?

Lm quen vi LV

LabVIEW l g?
LabVIEW l vit tt ca Laboratory Virtual Instrumentation Engineering Workbench B mi nht: 8 5 1 / 2008 Bn i ht 8.5.1

S lc tnh nng ca LabVIEW


Tng thch vi bt k h iu hnh no. Kt ni bt k thit b, bt k cm bin, c cu chp hnh no. , , p iu khin bt k c cu chp hnh, bt k thit b no. M phng bt k h thng vt l no. Lu v phn tch, bt k dng d liu no theo nhiu thi gian thc. Thc thi bt k gii thut/thut tan no.
Theo Lava.org Lava org

H tr hu ht cc OS
OS: Windows Mac OS X Linux Windows, X,

Cc ng dng ca LabVIEW
M phng m hnh ton Pht trin h Real-Time & FPGA X d Xy dng h th nhng thng h X l, phn tch tn hiu s/tng t Phn tch, trong tan hc Thu thp, phn tch, x l nh

Cc ng dng ca LabVIEW
T ng chun an kim tra ( t thit b), an, t, b) Thit k b iu khin M Mng cng nghip (CAN Fl R hi (CAN, FlexRay,) ) Giao tip mng my tnh Hnh nh ha d liu (graphs,..)

Kh nng kt ni thit b
- Kt ni vi tt c thit b/chun/h iu hnh - o, test, iu khin, bo co, phn tch

Li ch chnh ca LabVIEW
Ngn ng gip k s/nh nghin cu dng thc hin thut tan giao tip vi thit b phn cng mt cch: Nhanh nht Tin li nht Tin ht Ti cy nht Thm m nht
LabVIEW Thut tan/chin lc LabVIEW khin iu Phn cng/thit b/ mi trng Nh thit k phn mm iu khin/gim st

Ai ang dng LabVIEW


Cc phng th nghim/trung tm nghin cu cc chu lc, c bit l C. M, C. . Cc nh my sn xut t, robot, my bay v tu thy. Nhip nh gia, nh kinh t hc vv

Ai ang dng LabVIEW

Sn phm no dng LabVIEW


NASA dng LabVIEW gim thi gian, ct gim gi thnh trong h thng kim tra t ng cho Microshutters.

Robot tm m du ca tp an Nexans

Sn phm no dng LabVIEW


Gim st v iu khin theo thi gian thc my gia tc ln nht th gii.
- iu

khin: Vn tc, thu thp cc s liu, iu khin real-time.

- R hn, nh gn hn PLC.

Cc ng dng & cng c trong LabVIEW

Nhiu libraries vi hn 1000 functions MathScript = Ngn ng C, VB .m file script syntax trao i vi Matlab. c im Object-oriented ca LabVIEW code cho php k tha cc VIs LabVIEW cho PocketPCs, PDAs. Lp t h FPGA L trnh FPGA.

Cc ng dng & cng c trong LabVIEW

Ai dng c LabVIEW
Mi trng lp trnh LabVIEW, gm: g p ,g
V d Ti liu

D dng t d d to ng dng nh. h

Cho mi ngi

Thut tan/chng trnh phc tp i hi:


Kin thc su xc v LabVIEW Phng thc qun l b nh

Chuyn gia

V d GUI c bn trong ton


Thc thi php tan c bn

V d m phng con lc ngc

V d m phng ng c DC

V d trong Robot
LabVIEW and Apple Technology at Virginia Tech pp gy g

Lm quen mi trng LabVIEW


- Ci t - Khi ng - M, lu file , - Tra help - Ti liu

Lm quen mi trng LabVIEW


-Hai ca s chnh: Block diagram - Nhp d liu cho block diagram

User Interface

Lm quen mi trng LabVIEW


- Hai ca s chnh: Block diagram - Terminals, nodes, wires

Code, Functions

Lm quen mi trng LabVIEW


- Chng trnh LabVIEW = VIs - VI = block diagram + front p panel, + connector pane. , p

Front panel

Blog diagram

VI

Lm quen mi trng LabVIEW


- Numeric objects, While loop, - Cc cng c con tr - Cn chnh cc i tng g

VIEW>Tool palette p

Chut phi>Num Ctrls

Nh/qun!!?

Lm quen mi trng LabVIEW


Bi tp - Thit k cc nt nht sau

Lm quen mi trng LabVIEW


-V d c bn: php tan - M phng theo bc - L gn d ni Lm dy i - Copy nhanh i tng - Trang tr GUI c bn

Xem v d ny

Input, Output
- Inputs v outputs

Th t thc thi?
Xem v d ny

Xem v d ny

Input, Output while loop


- Dataflow - Thc thi khi MI input xc nh

Th t thc thi?
Xem v d ny

Xem v d ny

Input, Output while loop


- Dng khi gi lp tn hiu sine (Simulated signal) - Xc lp cc gi tr input cho hm - S dng cc thit b khc nhau xut kt qu. - Waveform chart l thit b xut gi tr s c bit ca hai hay nhiu tn hiu.

Xem v d ny

Input, Output while loop


- Dng khi gi lp tn hiu sine - Xc lp cc gi tr input cho hm - S dng cc thit b khc nhau xut kt qu

Xem v d ny

Input, Output while loop


- Dng khi gi lp tn hiu sine - Xc lp cc gi tr input cho hm - S dng cc thit b khc nhau xut kt qu. - Trnh by kt qu dng bng. - S dng Front panel> Modern> >Table express> Table.

Input, Output while loop


- Dng khi gi lp tn hiu sine - Xc lp cc gi tr input cho hm - S dng cc thit b khc nhau xut kt qu. - Trnh by kt qu dng bng. - S dng Front panel> Modern> >Table express> Table.

Xem v d ny

Input, Output while loop


- K thut tm li

Input, Output while loop


Bi tp thc hnh - Vit chng trnh chuyn nhit o t C sang F g - T(oF) = 32+T(oC)*1.8

Hy so snh kt qu T(oC): 0 -> T(oF) =? > T(oC): 100 -> T(oF) =?

i hc S phm K thut TP. HCM

Input, Output while loop


Bi tp thc hnh - Vit chng trnh chuyn nhit o t C sang F g - T(oF) = 32+T(oC)*1.8

Xem v d ny

Input, Output while loop


Bi tp - H thng LED pht hin cc g gi tr gii hn ca sng Sine. g g

LabVIEW Trong K Thut

B Hi Quang Hiu

- Ab

Lp trnh LabVIEW h

VAGAM - 2007

Nguyn B Hi bmnhy2003@yahoo.com