Download presentation
Presentation is loading. Please wait.
Published byCandace Shields Modified over 8 years ago
1
EET 2259 Programming for Electronics Technology Professor Nick Reeder
2
Reminders Please turn off cell phones. No food or soft drinks in the classroom. Stow water bottles at floor level.
3
EET 2259 Unit 1 LabVIEW Basics Read Bishop, Chapter 1. Lab #1 and Homework #1 due next week.
4
LabVIEW Stands for Laboratory Virtual Instrument Engineering Workbench. It’s a software package created by National Instruments (www.ni.com). This company bought Multisim a few years ago.www.ni.com (Bishop, p. 3)
5
National Instruments Company founded about 30 years ago in Austin, TX. In addition to Multisim, LabVIEW, and other software packages, they sell data acquisition boards and other hardware for using computers in engineering, science, and industry. (Bishop, pp. 3-4)
6
Some of LabVIEW’s Uses General-purpose programming Instrument control Data acquisition Data analysis Data presentation Automated testing
7
General-purpose Programming Writing programs to perform calculations, process information, play games, etc. Examples: Checkbook balancer Calorie counter Baseball statistics calculator This is not really what LabVIEW is meant for, but you can use it to do these things.
8
Instrument Control Using computer to control multimeters, oscilloscopes, function generators, etc.
9
Data Acquisition (DAQ) Connecting the computer directly to circuits or sensors to measure voltage, current, temperature, pressure, light intensity, chemical composition, etc. Need to have either: a special data-acquisition board installed in your computer, or an external data-acquisition device such as an NI myDAQ.NI myDAQ
10
Data Analysis Performing statistical analysis, curve fitting, signal processing, or other kinds of mathematical calculations on the data that you’ve gathered from a DAQ board or from measuring instruments. Similar to what you can do with Microsoft Excel or other spreadsheet programs.
11
Data Presentation Using tables, charts, and graphs to present the results of your data analysis. Again, similar to what you can do with Microsoft Excel or other spreadsheet programs.
12
Automated Testing Using computers to automatically test circuit boards or other manufactured parts as they leave an assembly line.
13
G LabVIEW is built around a programming language called G. Most of this course will be devoted to learning how to write programs in G. (Bishop, p. 4)
14
Graphical vs. Text-Based Language Most other programming languages (Assembly, VisualBasic, C, C++, Java, etc.) are text-based languages. You write programs by typing text. G is a graphical language. You write programs by placing icons and connecting them with wires. (Bishop, p. 4)
15
Example Program in C #include int main() { float value1, value2, product; printf("Enter first number => "); scanf("%f", &value1); printf("Enter second number => "); scanf("%f", &value2); product = value1 * value2; printf("The product is %f", product); }
16
Same Program in LabVIEW
17
“Virtual Instruments” LabVIEW programs are called virtual instruments, or VIs for short. When you save a program file in LabVIEW, its extension is “.vi” (Bishop, p. 4)
18
Front Panel & Block Diagram Every LabVIEW program has two parts, which appear in two different windows on your computer screen: the front panel and the block diagram. You don’t have to save these two parts separately; whenever you save, they’re both saved in the same file.
19
Front Panel The front panel is the user interface for a program. It contains controls (inputs) and indicators (outputs). Controls let the user feed data into the program. Indicators let the program give data back to the user.
20
Sample Front Panel
21
Block Diagram The block diagram shows the program’s underlying logic. It shows how the user’s data (entered through controls) is manipulated to give the results that are fed back to the user (through indicators). The block diagram contains components “wired” together.
22
Sample Block Diagram
23
Run Button Continuous Run Button Abort Execution Pause/Continue Button Text Settings Align Objects Distribute Objects Reorder Resize front panel objects Execution Highlighting Button Step Into Button Step Over Button Step Out Button Additional Buttons on the Diagram Toolbar Toolbar (Bishop, pp. 10-14)
24
Controls Palette & Functions Palette Controls Palette (Used to place controls & indicators on Front Panel) Functions Palette (Used to place functions on Block Diagram) (Bishop, pp. 24-26)
25
Menus LabVIEW has pull-down menus and short-cut menus (pop-up menus) that give you many options. Sections 1.6 and 1.7 in textbook discuss the menus. (Bishop, pp. 14-23)
26
Help LabVIEW’s context help window is very useful. It automatically shows help for functions and other objects when you roll your mouse over those objects. More detailed help is also available through Help menu. (Bishop, pp. 33-34)
27
Context Help Window Ctrl + H Detailed help Lock help Simple/Complex Diagram help
28
Saving Your Control Values When you save a VI, values that you have set on the front panel are not saved. But you can make them be saved by selecting Edit > Make Current Values Default before you save. Or you can do this with a single control by right-clicking it and selecting Data Operations > Make Current Value Default.
29
Example Programs LabVIEW comes with many example VIs, which you can access by clicking Help > Find Examples… in LabVIEW’s menus. More examples are in the textbook’s Learning Directory files, which you’ll download from the Web as part of Homework #1. (Bishop, p. 5)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.