LabVIEW Basics Dustin Cruise. Who is this guy? Graduate Student in Mechanical Engineering at Purdue University Specialty Areas: Combustion Control Systems.

Slides:



Advertisements
Similar presentations
Additional Programming Concepts MVRT 2011 – 2012 Season.
Advertisements

Robot Code MVRT 2010 – 2011 Season. Robot code controls the robot Robot Main.vi –Calls all the smaller SubVis Rules of programming the robot –Be careful.
LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
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
Based on LabVIEW 2011 Student Edition
Jeff Beltramo NHTI-Concord’s Community College FRC Team 1922.
1. 2 LabVIEW for FRC Doug Norman National Instruments January 6, 2012.
Welcome! Workshop 2 of 7.
Introduction to LabVIEW
Introduction to LabVIEW 8.5
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
Monroe L. Weber-Shirk S chool of Civil and Environmental Engineering Learning LabVIEW ä Learning ä LabVIEW ä Data Acquisition ä Control ä Learning ä LabVIEW.
LabVIEW For BIOEN 201 Fritz Reitz, Ph.D.. Why talk about LabVIEW BIOEN 301 labs use it, so it helps to be a little familiar with what it is it’s a VERY.
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
EG1003: Introduction to Engineering and Design Introduction to LabVIEW.
How to Use This Training Deck
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.
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Driver Station MVRT 2009 – 2010 Season. Add information Breadboard Classmate PC USB Hub Joysticks Stop Button.
US First Kickoff 2013 Software Programming (And Control System) Daniel Kohn University of Memphis.
V1: HMFR, V2: MFNB, 2007 LabView Seminar University of Puerto Rico Mayagüez Campus.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
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
Each VI has 2 Windows Front Panel User Interface (UI) –Controls = Inputs –Indicators = Outputs Block Diagram Graphical Code –Data travels on wires from.
LabVIEW Workshop September 26, 2009 Hauppauge High School SPBLI - FIRST Mark McLeod Advisor Hauppauge Team 358 Northrop Grumman Corp.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
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.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010.
Creating, Editing, & Debugging a VI A.How to Create VIs B.How to Edit VIs C.How to Debug VIs You Will Learn:
Games Development 2 Concurrent Programming CO3301 Week 9.
Digital Electronics and Computer Interfacing Tim Mewes 4. LabVIEW - Advanced.
Introduction to LabVIEW 8.5
An Overview of LabVIEW by: The Software User-Interface Group!
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs Block Diagram Accompanying “program” for front panel Components.
Advanced LabVIEW Topics Dustin Cruise. Who is this guy? Graduate Student in Mechanical Engineering at Purdue University Specialty Areas: Combustion Control.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs 參考 NI 官方教材: LabVIEW Intermediate II for 7.
Programming in LabVIEW
Introduction to LabVIEW
Chapter 7 Continued Arrays & Strings. Arrays of Structures Arrays can contain structures as well as simple data types. Let’s look at an example of this,
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
VAFIRST LabVIEW Workshop 11/19/11 Presenters: Marin Kobin & Patrick Foley.
Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report/Presentation Closing.
EG1003: Introduction to Engineering and Design Introduction to LabVIEW.
Introduction to LabVIEW
Getting Started with LabVIEW Virtual Instruments
Introduction to LabVIEW
Lesson 2: Introduction to Control programming using Labview
Chapter 1 LabVIEW Basics
Introduction to LabVIEW
Introduction to LabVIEW
Introduction to LabVIEW
Introduction to LabVIEW
Introduction to LabVIEW
EET 2259 Unit 7 Case Structures; Sequence Structures
EET 2259 Unit 2 Virtual Instruments
EET 2259 Unit 8 Other Structures; Local Variables
Introduction to LabVIEW
Presentation transcript:

LabVIEW Basics Dustin Cruise

Who is this guy? Graduate Student in Mechanical Engineering at Purdue University Specialty Areas: Combustion Control Systems I work in a lab burning things and using lasers I use LabVIEW a lot in my research Sensors Actuators Data Acquisition and Analysis Image Capture and Machine Vision

Topics Today LabVIEW Introduction Getting Started Programming – Projects, VIs – Dataflow and execution control… Troubleshooting tools Resources

LABVIEW INTRODUCTION

Virtual Instruments LabVIEW is a programming language! It is a full- fledged programming language, unlike many graphical “languages” which are not really complete. Historically, LabVIEW was designed by National Instruments to make life easier for engineers and scientists wanting to put together instrumentation – Advantage over other software is built-in analysis tools It is meant to be easy to use… – But you can’t program it exactly like C or other more traditional languages. It is a Dataflow, not a procedural language.

GETTING STARTED PROGRAMING VIs, variables, indicators, functions

Project Tree and Virtual Instruments Project Tree – Organizes and links VIs to hardware Components of a VI: – Front panel: You can put “indicators” and “controls” here Super useful! Buttons, LEDs, graphs, dials, anything you want! Caution though: charts can require a lot of processor and memory – Block diagram: Computational stuff goes here. This is the “code” part! Where the magic happens.

LabVIEW Block Diagram Example Startup Main Application Shutdown

Variables/Signals Variables/signals – people will use these terms interchangeably – Travel on wires – Basic types: Boolean – True or False (green wire) Numeric (integer) – negative or positive, ie -4, , (blue wire) Double – decimal number, like , (orange wire) String – array of characters that travel together, like a word or sentence…i.e. ‘this is a string’ (pink wire) – More types: Just wait! We’ll get there…

Quiz Time ‘I love LabVIEW’ is an example of a: – String – Double – Integer – Boolean How about ? See? This stuff is easy! Relax!

WHEN DO THINGS HAPPEN? Data flow and execution control

Dataflow Things happen in order…sort of. But what’s the order when you just have things strung together? Sometimes, it is hard to tell. Let’s talk about the rules with a little demonstration.

Quiz What’s the order in which events will happen in the following code?

Execution Control While Loops – Loop until condition is met For Loops – Loop a number of times Timing a VI – Waits/delays – Timed loops  USE FOR TIME CRITICAL THINGS LIKE CONTROL LOOPS!

Execution Control Case Statements – Use these to switch between possible code branches; i.e. do this or this other thing based on the value of a switch Boolean operations – Logic operations

Relating Data Arrays – All of same type, traveling together – Multiple dimensions possible Clusters – Multiple types bundled together – Can address by signal name Type Definitions – Kinda like object oriented programming…not going to cover it very much here, but it can be useful

Modularity SubVIs are super helpful in keeping code clean. – Simple example Be careful that you know how they will behave…especially when you put loops in SubVIs. – Stay organized, add descriptions

Some tricky questions What about…parallel loops? – This can be hairy. What can help? – Simple example with local variables to stop two parallel loops. – Local variables help you when everything is on the same block diagram…handy. – Global variables are used when running multiple VIs; different block diagrams.

TROUBLESHOOTING TOOLS!

Problems we can have Bad algorithms Timing not behaving the way we’d like Race conditions Anything you can imagine

Diagnosing problems Probes Execution Highlighting PLOT PLOT PLOT PLOT PLOT PLOT – CHARTS ARE THE BEST! – KEY ADVANTAGE OF LABVIEW!

Designing code to avoid problems Use simplest code problem to accomplish a task – THINK ABOUT THE CODE BEFORE YOU START PROGRAMMING! – Flowcharts/pseudocode not always the best…due to Dataflow you sometimes want to work backwards! – Practice on simple examples!

Dealing with Timing Problems Since LabVIEW is a implicitly and unavoidably multithreaded language, embrace it! It is super fun! – Hint: Use Queues and Error Clusters to control execution timing. What are these? Use advanced code structures like state machines!

How to learn LabVIEW The secret to learning LabVIEW… is doing LabVIEW. Build a library of examples as you come across them – Most likely, what you’re trying to do has already been done before – Try to explain what each piece of an example VI does. It doesn’t work to just glance over Get familiar with resources

Resources FIRST’s getting started documentation that comes with the control system (available online as well) – Search for FRC LabVIEW NI and lots of things come up. FRCmastery.com NI Examples found in Help menu NI.com Effective LabVIEW Programming, Thomas J. Bress

Examples Opening – Test Rig

Things I didn’t cover today A lot of multithreading things. Queues, semaphores, notifiers, lots of stuff here. But be careful. Robot Specifics Any of the really awesome math and IO functions that LabVIEW already has built in

Wait! What about the robot? Oh yeah! FIRST, NI, and WPI have collaborated to nicely give us a great setup FRC cRIO (on Robot) and Dashboard Project Templates

What does robot code look like? Pretty much the same. Even bigger focus on determinism. – Need to think a lot about how timing works, when things happen, in what order. Teleop vs. Autonomous Tying in to the field system…

Tying things together Explore the libraries, both NI and FRC/WPI. Controling ! Plotting the motion!