140 likes | 368 Views
CS320n –Visual Programming. Introduction to LabVIEW. What We Will Do Today. Look at the LabVIEW programming environment Tests handed back next time and go over in class Assignment 7 on web today. What is LabVIEW. A product of National Instruments
E N D
CS320n –Visual Programming Introduction to LabVIEW
What We Will Do Today • Look at the LabVIEW programming environment • Tests handed back next time and go over in class • Assignment 7 on web today Introduction to LabVIEW
What is LabVIEW • A product of National Instruments • Designed to provide a programming tool for scientists and engineers to write programs to analyze data gathered by instrumentation • Like Alice it is a graphical programming language • Unlike Alice it can be used to build a much greater variety of programs Introduction to LabVIEW
What is LabVIEW • LabVIEW = Laboratory Virtual Instrument Engineering Workbench • Loaded on the Painter Hall lab computers • Can be downloaded from engineering department web page Introduction to LabVIEW
Creating a LabVIEW program • start LabVIEW • Select the arrow on “New” • On the menu that pops up select “Blank VI” Introduction to LabVIEW
Virtual Instruments • LabVIEW programs are called “VIs” which stands for Virtual Instruments • They consist of two parts • a front panel • a block diagram • The front panel is a graphical user interface • this is how a the user of a program will interact with it • The block diagram is the implementation of the program, the code Introduction to LabVIEW
Working with a Program • I find it best to set up the front panel and block diagram side by side • Select this choosing “Window” and “Tile Left and Right” or by pressing the control key and T at the same time Introduction to LabVIEW
Front Panel and Block Diagram Introduction to LabVIEW
Working with the Front Panel and Block Diagram • In LabVIEW the programmer can add things to either the front panel or the block diagram • right click in either window to select the programming elements (commands, primitives) available Introduction to LabVIEW
Controls and Functions • When you right click in the front panel a pop up menu appears • These are the controls for the front panel • click on the pin to make the pop up menu permanent • the menu on the block diagram contains functions Introduction to LabVIEW
Quick Demonstration of LabVIEW • Write a program in LabVIEW to convert kilometers to miles. • The Milan - San Remo bicycle race was 294 kilometers this year • Add controls and indicators to front panel • Connect controls and indicators in block diagram Introduction to LabVIEW
More Complicated Program • LabVIEW comes with a large number of example programs • Open an existing LabVIEW program by selecting “File” -> “Open” or by pressing the control key and O • Get to National Instruments Folder (probably under Program Files) • LabVIEW 7.0 • examples • express • Moonlanding.vi Introduction to LabVIEW
Moon Landing Simulator – Front Panel Introduction to LabVIEW
Moon Landing Simulator – Block Diagram Introduction to LabVIEW