Programming for Electronics Technology Professor Nick Reeder

Slides:



Advertisements
Similar presentations
LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
Advertisements

Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 2 Virtual Instruments Read Bishop, Chapter 2. Lab #2 and Homework #2 due next week. Quiz #1 next week.
Lesson 2 Navigating LabVIEW
LabVIEW 7.1 Tutorial. Measurement Lab. MECH262-MECH261 Imran Haider Malik January 16, 2006.
An Introduction to the Interface
Secondary Education University Engineering Greg Burnham Stephanie Foster Estacado High School Richard Gale Texas Tech Greg Burnham Stephanie Foster Estacado.
Introduction to LabVIEW 8.5
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
PC Applications Course LabVIEW: Laboratory Virtual Instrument Engineering Workbench Graphical Programming Easy to use Faster Development Time.
Laboratory 5: Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report / Presentation Closing.
MCT260-Operating Systems I Operating Systems I Interfaces to Operating Systems.
EG1003: Introduction to Engineering and Design Introduction to LabVIEW.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 12 Data Acquisition  Read Bishop, Chapter 8.  Lab #12 and Homework #12 due next week.
ME 411/511Prof. Sailor Data Acquisition & LabView Lecture goals… –Learn the basics of how to use and modify LabView Virtual Instruments –Become familiar.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 4 SubVIs  Read Bishop, Chapter 4.  Lab #4 and Homework #4 due next week.
Virtual Instrumentation With LabVIEW
Lecture 13LabVIEW and GPIB LabVIEW (National Instruments) –Graphical program language –Widely used in academia (lab) and industry (R&D) General Purpose.
Infinity-project.org Engineering education for today’s classroom The Infinity Project SM LabVIEW for The Infinity Project.
How to use LabVIEW Ihor Korolov February 2011.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
Design of Bio-Medical Virtual Instrumentation Tutorial 1.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Create.
MCEN 371 – Mechanical Engineering Lab Chapter 6: LabVIEW Part 1: Introduction.
Chapter 1 LabVIEW Basics. Features > Uses Graphic Symbols > Created by National Instruments > Virtual Instruments (VIs) > Extensive Library of VIs.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs LabVIEW Programs Are Called Virtual Instruments (VIs) Block Diagram.
LabVIEW an Introduction
Introduction to LabVIEW
Physics 145 Introduction to Experimental Physics I Instructor: Karine Chesnel Office: N319 ESC Tel: Office hours: on appointment.
Biomedical Measurements & Analysis using LabVIEW
Physics 434 Welcome Toby Burnett [prof] Durmus Karatay[TA] Jason Alferness [Equipment] David Pengra [consultant]
LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic.
Part I MVRT 2011 – 2012 Season Introduction to LabVIEW.
Introduction to Windows7
Analog Discovery Arbitrary Function Generator for Windows 7 by Mr
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 3 Editing and Debugging VIs  Read Bishop, Chapter 3.  Lab #3 and Homework #3 due next week.  Quiz.
Introduction to LabVIEW 8.5
An Overview of LabVIEW by: The Software User-Interface Group!
Lab 1 : Introduction to LabView 1 Southern Methodist University Bryan Rodriguez.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs Block Diagram Accompanying “program” for front panel Components.
Physics 434 Welcome Leslie Rosenberg [prof] Scott Davis [TA] Thanks to Toby Burnett [prof] (for much of the course material) Jason Alferness [Equipment]
Laboratory 5: Introduction to LabVIEW
Introduction to LabVIEW
A Presentation on Mr. SAJID NAEEM M.SC – Electronics (UOP) PG-DEP (C-DAC)
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report/Presentation Closing.
EG1003: Introduction to Engineering and Design Introduction to LabVIEW.
EET 2259 Programming for Electronics Technology Professor Nick Reeder.
EET 2259 Unit 12 Data Acquisition
Introduction to LabVIEW
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
EET 2259 Unit 11 Charts and Graphs
Getting Started with LabVIEW Virtual Instruments
EET 2259 Unit 3 Editing and Debugging VIs
Lesson 2: Introduction to Control programming using Labview
EET 2259 Unit 12 Data Acquisition
LabVIEW 7.1 寒假短期教學課程 歐陽丞修 2006/02/06.
Introduction to LabVIEW
Introduction to LabVIEW
Introduction to LabVIEW
Introduction to LabVIEW
EET 2259 Unit 7 Case Structures; Sequence Structures
EET 2259 Unit 11 Charts and Graphs
EET 2259 Unit 2 Virtual Instruments
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
EET 2259 Unit 8 Other Structures; Local Variables
Introduction to LabVIEW
EET 2259 Unit 3 Editing and Debugging VIs
Presentation transcript:

Programming for Electronics Technology Professor Nick Reeder EET 2259 Programming for Electronics Technology Professor Nick Reeder

Reminders Please turn off cell phones. No food or soft drinks in the classroom. Stow water bottles at floor level.

EET 2259 Unit 1 LabVIEW Basics Read Bishop, Chapter 1. Lab #1 and Homework #1 due next week. Handouts: Syllabus and Lab #1 -Share each person’s programming experience. -Go over syllabus -Have them log on to website.

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. (Bishop, p. 3) -Great demand among area employers. -Discuss idea of virtual instruments; using computer to behave like a DMM, scope, freq counter, function generator, ….

National Instruments Company founded in 1976 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)

Some of LabVIEW’s Uses General-purpose programming Instrument control Data acquisition Data analysis Data presentation Automated testing A slide on each follows.

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.

Instrument Control Using the computer to control multimeters, oscilloscopes, function generators, etc. Show them, using Fluke 45 Getting Started.vi (Be sure DMM’s parameters are set to 9600 baud, no parity, Echo off; to set these, push 2nd RATE, then use AUTO button to step through parameters and use up or down buttons to change values.) And use TKTDS1K2K GettingStarted.vi (Be sure scope’s parameters are set to 9600, Hardflagging, LF, Even; to set these, push UTILITY, Options, RS232 Setup.) If it doesn’t work, try TKTDS1K2K Initialize.vi

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. -Show them a voltage measurement; first a DC voltage, then func gen output with f=50 Hz (& measurement rate = 1kHz). -Our DAQ cards are PCI-6221 (M series), which sell for about $500.

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.

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.

Automated Testing Using computers to automatically test circuit boards or other manufactured parts as they leave an assembly line.

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)

Graphical vs. Text-Based Language Most other programming languages (Assembly, VisualBasic, C, C++, Java, Python, 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)

Example Program in C #include <stdio.h> 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); }

The Same Program in LabVIEW -Show them how to create it and run it. Then have them run it continuously. -Then edit to add 15 to the product.

“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)

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.

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 results back to the user.

Sample Front Panel By default, front panel has gray background.

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.

Sample Block Diagram By default, front panel has white background.

Toolbar (Bishop, pp. 10-14) Additional Buttons on the Diagram Toolbar Run Button Continuous Run Button Abort Execution Pause/Continue Button Text Settings Align Objects Distribute Objects Reorder Resize front panel objects Additional Buttons on the Diagram Toolbar Execution Highlighting Button Step Into Button Step Over Button Step Out Button Click the Run button to run the VI. While the VI runs, the Run button appears with a black arrow. Click the Continuous Run button to run the VI until you abort or pause it. While the VI runs, the Abort Execution button appears. Click this button to stop the VI immediately. Note: Best to avoid using the Abort Execution button to stop a VI. Click the Pause button to pause a running VI. (Bishop, pp. 10-14)

Controls Palette & Functions Palette (Used to place controls & indicators on Front Panel) Functions Palette (Used to place functions on Block Diagram) Can bring up these palettes either through the Window menu or by right-clicking in blank area of front panel or block diagram. -Show them how to configure the palettes as shown above. (Bishop, pp. 24-26)

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)

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) Demo with Lab01Strings.vi.

Context Help Window Ctrl + H Detailed help Lock help Simple/Complex Diagram help

Saving Your Control Values When you save a VI, values that you have set on the front panel are not saved. But you can cause them to be saved by selecting Edit > Make Current Values Default before you save the VI. Or you can do this with a single control by right-clicking it and selecting Data Operations > Make Current Value Default. Demo with Lab01Strings.vi.

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. Studying examples is a great way to learn any programming language. (Bishop, p. 5) -In some cases, it’s easier to find a VI similar to what you’re trying to do and then modify it, rather than starting from scratch. -Use Example Finder to demo Bouncing Cube (Fundamentals > Graphs & Charts). Other good examples: Building User Interfaces>Acquiring User Input>Keyboard & Mouse> Keyboard Puzzle Game.vi or Basic Input Demo.vi.

PCI-6221 or myDAQ? Recall that for programs that make measurements, we have two hardware choices: The PCI-6221 card that is installed in your computer. Or the myDAQ that plugs into a USB port. You make this choice inside the DAQ Assistant, which you place on a VI’s block diagram. For the first few labs we’ll use the myDAQ.