336540 Design of Bio-Medical Virtual Instrumentation Tutorial 2.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Based on LabVIEW 2011 Student Edition
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
CS0004: Introduction to Programming Repetition – Do Loops.
Loops (Part 1) Computer Science Erwin High School Fall 2014.
Loops in LabVIEW (while,for and case)
Introduction to LabVIEW
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 5 Loops  Read Bishop, Sections 5.1 and 5.2.  Lab #5 and Homework #5 due next week.  Exam #1 next.
Do/Loops A loop repeats a series of instructions. An iteration is a single execution of the statement(s) in the loop. Used when the exact number of iterations.
Example – calculating interest until the amount doubles using a for loop: will calculate up to 1000 years, if necessary if condition decides when to terminate.
Loops A.About While Loops B.About For Loops C.About Case structures D.Sequence Structures E.Formula Node You Will Learn:
Chapter 6 - Repetition. Introduction u Many applications require certain operations to be carried out more than once. Such situations require repetition.
Chapter 5: Loops and Files.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
CS320n –Visual Programming LabVIEW Control Structures.
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
Lecture 13LabVIEW and GPIB LabVIEW (National Instruments) –Graphical program language –Widely used in academia (lab) and industry (R&D) General Purpose.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
Design of Bio-Medical Virtual Instrumentation Tutorial 1.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs LabVIEW Programs Are Called Virtual Instruments (VIs) Block Diagram.
LabVIEW an Introduction
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
Each VI has 2 Windows Front Panel User Interface (UI) –Controls = Inputs –Indicators = Outputs Block Diagram Graphical Code –Data travels on wires from.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
EET 2259 Unit 7 Case Structures; Sequence Structures  Read Bishop, Sections 5.4 and 5.5.  Lab #7 and Homework #7 due next week.  Quiz #3 next week.
Creating, Editing, & Debugging a VI A.How to Create VIs B.How to Edit VIs C.How to Debug VIs You Will Learn:
Mr. Dave Clausen1 La Cañada High School Chapter 6: Repetition Statements.
COMPUTER PROGRAMMING I 5.05 Apply Looping Structures.
Visual Basic.net Loops. Used to do multiple executions of the same block of code Do while loops Do until loops For next loops.
Control Structures II Repetition (Loops). Why Is Repetition Needed? How can you solve the following problem: What is the sum of all the numbers from 1.
Repetition Control Structures Simple Program Design Third Edition A Step-by-Step Approach 5.
Repetition. Control of Flow SEQUENCE SELECTION (if..else, switch…case) REPETITION.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs Block Diagram Accompanying “program” for front panel Components.
CS320n –Visual Programming More LabVIEW Foundations.
1 Chapter 9. To familiarize you with  Simple PERFORM  How PERFORM statements are used for iteration  Options available with PERFORM 2.
ITERATIVE STATEMENTS. Definition Iterative statements (loops) allow a set of instruction to be executed or performed several until condition are met.
Pascal Programming Pascal Loops and Debugging. Pascal Programming Pascal Loops In our first brush with the while do loops, simple comparisons were used.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
Loops and Files. 5.1 The Increment and Decrement Operators.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5: Looping.
Iteration. Iteration: Review  If you wanted to display all the numbers from 1 to 1000, you wouldn’t want to do this, would you? Start display 1 display.
Copyright © 2012 Pearson Education, Inc. Chapter 5: Loops.
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
Chapter Looping 5. The Increment and Decrement Operators 5.1.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Chapter Looping 5. The Increment and Decrement Operators 5.1.
Lecture 7 – Repetition (Loop) FTMK, UTeM – Sem /2014.
Quiz Which types of folders are available in a LabVIEW Project?
EE 200 Design Tools Laboratory 14
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
Introduction to LabVIEW
Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS.
Chapter 5 Structures.
Looping and Repetition
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Chapter 4 Editing and Debugging
Iteration: Beyond the Basic PERFORM
Iteration: Beyond the Basic PERFORM
© A+ Computer Science - What is a LOOP? © A+ Computer Science -
LabVIEW.
Loop Strategies Repetition Playbook.
Structures- case, sequence, formula node
Loops.
LabVIEW基礎課程(一) 參考書籍: LabVIEW for Everyone (Jeffrey Travis/Jim Kring)
EET 2259 Unit 7 Case Structures; Sequence Structures
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Presentation transcript:

Design of Bio-Medical Virtual Instrumentation Tutorial 2

Outline Debugging techniques Structures: – While loop – For loop

Debugging Techniques Broken VI

Debugging Techniques Non broken VI – Execution highlighting- generates an animation of the execution of the block diagram. – Single stepping – Breakpoints – Probe tools – helps checking intermediate values in a VI that produces unexpected results

Exercise 1 1. What is the problem with the next diagram? 2. Fix the following VI:

Structures

While loop Analog to: Repeat (code) ; Until Condition met; End; code Condition met? end No? Yes

Iteration terminal – contains the number of completed iterations. Starts at zero. Continue if true – the while loop executes its subdiagram until the condition teminal recieves a FALSE value. Stop if true - the while loop executes its subdiagram until the condition teminal recieves a TRUE value. While loop always executes at least once!

Structure Tunnels Tunnels feed data into and out of structures. The tunnel apears as a solid block on the border of the While loop. What happens if we run the VI with a Boolean value of False?

For loop Analog to: N=100; i=0; Until i=N; Repeat(code); i=i+1; End; N=100 i=N? end No? Yes i=0 Code i=i+1

Iteration terminal – contains the number of completed iterations. Starts at zero. Count terminal – input terminal whose value indicates how many times to repeat the subdiagram

Conditional terminal to a for loop You can add a conditional terminal to configure a For loop to stop when a Boolean condition is met or an error occurs. The For loop will execute until the condition occurs OR until the all iterations are complete.

Exercise 2 What will the indicator display after this program has run?

Timing a VI Wait until Next ms Multiple – monitors a millisecond counter and waits until the millisecond counter reaches a multiple of the amount you specify. Wait (ms)- waits until the millisecond counter counts to an anount equal to the input. Time elapsed- the amount of time elapses after the specified start time.

Iterative Data Transfer – Shift Register Used when wanting to pass values from previous iterations through the loop to the next iterations.

Exercise 3 Create a VI which raffles a random number (between 0-1) in each iteration and compares it to the number from the last iterations If the current random number is smaller than the previous one, stop the loop. Returns the number of iterations.