Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to...

11
Introduction to LabVIEW Programming Xiaoshan Xu

Transcript of Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to...

Page 1: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

Introduction to LabVIEW Programming

Xiaoshan Xu

Page 2: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

Electric and electronic circuit and experimental physics

Source Circuit/system Probe

Generate perturbation Respond to perturbation Measure the response

Page 3: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

Generate perturbation Respond to perturbation Measure the response

LabVIEW

Laboratory Virtual Instrument

Engineering WorkbenchAcquire, Analyze, Present data

Control, Measure, Analyze, Visualize, Record

Page 4: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

Example: measurement of temperature dependence of resistance (10-310 K)

Cryostat

Temperaturecontroller

Source meter

Control: Set temperature Set current

Measure: Read voltage

AnalyzeCalculate R=V/I

VisualizePlot T(t), I(t), I(T), R (T)

RecordData saved on hard disk

Page 5: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

Temperaturecontroller

Control: Set temperature sequence Set current

Source meter

Page 6: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

How to communicate (control, measure) with the instrumentsCommunication standard (digital)

• RS232

• GPIB

• RS-485

• Ethernet

• Other

Page 7: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

LabVIEW Programming for beginners: Frontend and backend, where is my program?

Front panel: visualization and user interface

Block diagram: that is your program!

A LabVIEW program is called a VI.

A program file has a suffix .vi

Page 8: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

LabVIEW Programming for beginners: variables

Type:Numeric, Boolean, String, Array, List, Graph, etc.

Control Indicator

Page 9: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

LabVIEW Programming for beginners: Flow control

For, while, case, event, sequence, etc

Page 10: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

LabVIEW Programming for beginners: Subroutine (subVi)

Control, input

Indicator, outputCall the subvi in another program

Page 11: Introduction to LabVIEW Programming - xiaoshanxu.unl.edu · Generate perturbation Respond to perturbation Measure the response LabVIEW Laboratory Virtual Instrument Engineering Workbench

Laboratory Virtual Instrument Engineering Workbench ---online tutorial

• http://www.ni.com/swf/presentation/us/labview/aap/default.htm