Additional Programming Concepts MVRT 2011 – 2012 Season.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Previously… We created a simulated temperature reader which alerts if too hot or too cold… Download the solved practice to keep in sync: Thermostat.vi.
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.
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
Diego Torres LabVIEW Student Ambassador Fall 2011 ITESM CQ
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
LabVIEW Introduction Alan Jennings.
Welcome! Workshop 2 of 7.
Intro Programming By Trevor Decker Team 1743 By Trevor Decker Team 1743.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Introduction to LabVIEW
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
Chapter 6 Arrays & Clusters. LabVIEW Arrays > Collection of Elements > Same Data Type > Variable-Sized > One or More Dimensions.
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
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
Course contents 1.Labview basics – virtual instruments, data flow, palettes 2.Structures – for, while, case,... – editing techniques 3.Controls&Indicators.
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.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
V1: HMFR, V2: MFNB, 2007 LabView Seminar University of Puerto Rico Mayagüez Campus.
Advanced Web 2012 Lecture 4 Sean Costain PHP Sean Costain 2012 What is PHP? PHP is a widely-used general-purpose scripting language that is especially.
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.
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
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Design of Bio-Medical Virtual Instrumentation Tutorial 3.
Arrays – What is it? – Creation – Changing the contents Functions – What is it? – Syntax – How they work – Anonymous functions A quick lesson in Objects.
LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Part I MVRT 2011 – 2012 Season Introduction to LabVIEW.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
Samuel Alberg Thrysøe, PhD, PostDoc, Kontakt info: Tlf:
Putting Applets into Web Pages.  Two things are involved in the process of putting applets onto web pages ◦ The.class files of the applet ◦ The html.
1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010.
Lab 7 – Misc. pieces Southern Methodist University Bryan Rodriguez.
CSC 213 Lecture 10: BTrees. Announcements You should not need to do more than the lab exercise states  If only says add a CharRange, you should not need.
By Jonathan Villanueva. Bubble Sorting: the way to sort an array by switching two values that are right next to each other if the first number bigger.
Digital Electronics and Computer Interfacing Tim Mewes 4. LabVIEW - Advanced.
Mathematical Expressions, Conditional Statements, Control Structures
CS320n –Visual Programming
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs Block Diagram Accompanying “program” for front panel Components.
CS320n –Visual Programming More LabVIEW Foundations.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
Tutorial 7 Creating Animations. XP Objectives Learn about animation Create a timeline Add AP divs and graphics to a timeline Move and resize animation.
Language Find the latest version of this document at
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
Chapter 6 Arrays & Clusters. LabVIEW Arrays > Collection of Elements > Same Data Type > Variable-Sized > One or More Dimensions.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Week 3 Data Structures and Common Tools. Common Tools in Labview Automatic Tool Selector Using the Operating Tool Using the Positioning Tool to Select.
Comp1004: Introduction III Java. Content How Java Works: The JVM Writing a Class in Java – Class – Member Variables – Method – Statement Magic incantations.
Workshop 5 of 7 Welcome!. Today's Topics Review from Workshop 4 Modularity & subVIs Documentation File Input/Output Introduction.
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
Introduction to LabVIEW
Doing some Boolean: On/Off
Chapter 5 SubVIs.
Coding Concepts (Basics)
Electronics II Physics 3620 / 6620
Problem Solving Designing Algorithms.
Learning Intention I will learn about programming using selection (making choices) with one condition.
EET 2259 Unit 2 Virtual Instruments
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
Web Programming and Design
How to allow the program to know when to stop a loop.
Presentation transcript:

Additional Programming Concepts MVRT 2011 – 2012 Season

Case structure Loops Arrays Clusters SubVI Table of content

Case Structures

Case structures If a condition is met then do something Simile If _a dog is chasing you_ then _climb a tree_. If condition met (true) then goes to true case If condition isnt met (false) Then goes to false case Case Structures

Example If/Else Case Structures

Incomplete as we didnt add what to return for false value After adding false case it works Example If/Else Case Structures

Another way And and Or are in Boolean panel Example If/Else Case Structures

Normal case Structure Number case Structure Will work for most simple data types Example Multiple Decision Case Structure

Loops

While While a condition is not met then do something Simile While _dog is chasing you_ then _keep running_. When _dog stops chasing you_ then _stop running_. action: running condition: dog stops chasing you condition needs to be met to stop action While loop

Condition met? Stop if met # of times through loop While loop

While _stop is not pressed_ then _find a random number_. Example of a while loop

For loop For a certain number of times do something Simile For _5 laps_ keep _running_. When _5 laps_ are done then stop _running_. action: running condition: 5 laps condition needs to be met to stop action For loop

# of times gone through loop condition – total number of times it needs to go through the loop For Loop

For vs. While Loops For Loops While loops Good for set number of times Good for arrays as you can use ArraySize.VI Obviously for conditions that change Use for state machines to run the loop till state value is done

Array

Array – a set of elements of the same data type Useful for doing similar processing on same data Works well with loops There are multiple dimension of arrays –1 d arrays are simple where elements in arrays are simple data types –2 d arrays are like grids, boards, spreadsheets, etc. 2 d can be thought of as an array of arrays where the first arrays elements are arrays Simile: They are lot like filling cabinets Array

Creating Arrays

Array Function Nodes/VIs

Array: Initialized vs. Non- initialize values

Operations only on initialized values

Index, Replace, Insert, Delete ONLY work only within array values. If you have a 1 d array size of 3 elements you cannot use insert to add element at index 6 and expect it to initialize other elements Similar problems

2D arrays are like a filling cabinet holding other file cabinets Similar to a grid or spreadsheet Index VI gets element at that index Subset returns a part or chunk of array 2D Array

Making 2D Arrays

Array Dimensions change Everything

Clusters

objects of different data types combined into one data type useful when you want to bundle data together ex. Used in robot code Simile orange juice, apple juice and pineapple juice are mixed into passion fruit juice Clusters

Making Clusters

Bundling Clusters

Bundling Clusters of Clusters

SubVI

VI virtual instruments –Everything is a vi –Has inputs and outputs which can be controlled by the front panel or other Vis Simile java: a class an essay VI

SubVI a VI used in another VI –Smaller Vis or smaller blocks of code that help complete the overall goal Simile java: a method in a class a paragraph in an essay SubVI

Project Many VIs and SubVIs used together –Largest VI Simile java: multiple classes used together a portfolio/compilation of essays Project

Initial Code complex code repetition of the code Initial Code

SubVI Benefits Shortens & simplifies code by making it a part of another document Allows you to fix all applications of code easily Note: keep in mind this works in reverse too Simile Website – has multiple web pages which help to divide up the content into multiple parts Example throughout the robot project – so that all of its code is not in one VI SubVIs Benefit

Creating SubVI Select Code Find: Edit Create SubVIs Creating SubVI

Creating an Icon top right corner of front panel Why: to be able to identify what a VI does Creating an Icon

Connector Pane inputs and outputs Creating a Connector Pane top right corner of front panel Creating a connector pane

Initial Code complex code repetition of the code Initial code

Final Code less complex code no repetition of the code Final Code with SubVI

Using VIs As SubVIs If you create a separate VI and want to use it as a SubVI you can click Select a VI and search through your folders for the VI