Structures- case, sequence, formula node

Slides:



Advertisements
Similar presentations
A. Virtual Instruments (VIs)
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.
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
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
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.
CS320n –Visual Programming LabVIEW Foundations. Visual ProgrammingLabVIEW Foundations2 What We Will Do Today Hand back and review the midterm Look at.
Loops A.About While Loops B.About For Loops C.About Case structures D.Sequence Structures E.Formula Node You Will Learn:
1 Lesson 5 Clusters TOPICS Introduction to Clusters Cluster Functions Error Clusters.
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 11 Charts and Graphs  Read Bishop, Chapter 7.  Lab #11 and Homework #11 due next week.
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.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
V1: HMFR, V2: MFNB, 2007 LabView Seminar University of Puerto Rico Mayagüez Campus.
Virtual Instrumentation With LabVIEW. Section I LabVIEW terms Components of a LabVIEW application LabVIEW programming tools Creating an application in.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Create.
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.
Design of Bio-Medical Virtual Instrumentation Tutorial 3.
LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
CS320n –Visual Programming More LabVIEW Control Structures.
Samuel Alberg Thrysøe, PhD, PostDoc, Kontakt info: Tlf:
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:
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
Digital Electronics and Computer Interfacing Tim Mewes 4. LabVIEW - Advanced.
Design of Bio-Medical Virtual Instrumentation Tutorial 2.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs Block Diagram Accompanying “program” for front panel Components.
Floyd, Digital Fundamentals, 10 th ed EET 2259 Unit 9 Arrays  Read Bishop, Sections 6.1 to 6.3.  Homework #9 and Lab #9 due next week.  Quiz #5 next.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
LabVIEW Course Course 2.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Week 3 Labview exercises
Quiz Which types of folders are available in a LabVIEW Project?
Data Structures Arrays Common Array Functions Polymorphism
EE 200 Design Tools Laboratory 14
EET 2259 Unit 11 Charts and Graphs
Visual Basic 6 (VB6) Data Types, And Operators
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
EET 2259 Unit 3 Editing and Debugging VIs
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.
Lesson 2: Introduction to Control programming using Labview
הודעות ריענון מהיר והרחבות Charts & Graphs גרף XY בניית מחולל אותות
הודעות ריענון מהיר והרחבות כתיבה לקובץ Low-Level דגימת אות Low-Level
Microsoft Office Illustrated Introductory, Windows XP Edition
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
LabVIEW 7.1 寒假短期教學課程 歐陽丞修 2006/02/06.
Introduction to Problem Solving and Control Statements
LabVIEW.
EET 2259 Unit 9 Arrays Read Bishop, Sections 6.1 to 6.3.
Introduction to LabVIEW
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.
EET 2259 Unit 11 Charts and Graphs
EET 2259 Unit 2 Virtual Instruments
Presentation transcript:

Structures- case, sequence, formula node VI Programming Loops- for, while Graph & chart Structures- case, sequence, formula node

LabVIEW Programming Structures Structures located on the Functions» Programming» Structures palette to control how a block diagram executes processes: For Loop: Executes a subdiagram a set number of times. While Loop: Executes a subdiagram until a condition is met. Case structure: Contains multiple subdiagrams, only one of which executes depending on the input value passed to the structure. Sequence structure: Contains one or more subdiagrams, which execute in sequential order. Formula Node: Performs mathematical operations based on numeric input. MEI U4 P2

For Loop Structure Block Diagram > Functions > Programming >Structures > For Loop For Loop executes its subdiagram count times, where the count equals the value contained in the count terminal (N) Iteration 0 during the first iteration 1 during the second iteration etc up to N-1 •If you wire 0 to the count terminal, the loop does not execute. MEI U4 P2

MEI U4 P2

While Loop Structure Block Diagram > Functions > Programming > Structures > While Loop: The While Loop executes the subdiagram until the conditional terminal. You can select (Continue if true or Stop if true ) Inputs to a loop pass data before loop execution. Outputs pass data out of a loop only after the loop completes all iterations. MEI U4 P2

MEI U4 P2

Timing Wait Until Next ms Multiple function Wait (ms) function This function is used to synchronize activities. The function is placed within a loop to control the loop execution rate. Wait (ms) function Adds the wait time to the code execution time, as illustrated. This can cause a problem if code execution time is variable. MEI U4 P2

Shift Registers in Loops Shift registers are local variables that feed back or transfer values from the completion of one iteration to the beginning of the next. By selecting Add Shift Register from the loop border pop-up menu, you can create a register anywhere along the vertical boundary only To initialize a shift register, wire a value from outside the loop to the left terminal. If you do not initialize the register, the loop uses as the initial value the last value inserted in the register when the loop last executed. MEI U4 P2

Multiple Shift Registers One can create multiple shift registers on a particular structure. The left, topmost terminal holds the value from the previous iteration, i-1. The terminal immediately under the uppermost terminal contains the value from iteration i-2, and so on with each successive terminal. MEI U4 P2

Types of Charts & Graphs Waveform Chart: special numeric indicator that can display a history of values acquired at a constant rate. Waveform Graph: special numeric indicator that displays an array of data. Updates after all points have been collected. XY Graph: Displays data acquired at a non-constant rate, such as two columns or arrays data. Digital Waveform Graph: Displays data as pulses or groups of digital lines. (Windows) 3D Graphs: Displays 3D data on a 3D plot MEI U4 P2

MEI U4 P2

Accumulates after new run MEI U4 P2

MEI U4 P2

Chart Update Modes: The waveform charts use various modes to display data. These modes include Strip Chart, Scope Chart, and Sweep Chart. MEI U4 P2

MEI U4 P2

Waveform Graphs Input should be of array data type- (default) x axis- array index y axis- value in array MEI U4 P2

Waveform XY Graphs Waveform graph and XY graph requires input data type as array For waveform graph: Array index acts as x axis scale For XY graph: both X and Y must be array MEI U4 P2

MEI U4 P2

There are many planes in the xy graph There are many planes in the xy graph. Such planes like: Nyquist, S plane, Z plane and Nichols MEI U4 P2

DIGITAL WAVEFORM MEI U4 P2

Charts & Graphs Features Plot Legend: Defines the color and style of the plot(s). Resize the legend to display multiple plots. Scale Legend: Defines labels for scales and configures scale properties. X Scale and Y Scale: Formats the x- and y-scales. Cursor Legend (graph only): Displays a marker at a defined point coordinate. You can display multiple cursors on a graph. Scrollbar (chart only): Scrolls through the data in the chart. Use the scroll bar to view data that the buffer does not currently display. MEI U4 P2

Case Structures The Case Structure is a method of executing conditional statements. The Case Structure is similar If (Condition) then Do This Else Do That Endif MEI U4 P2

The selector terminal can be Boolean, Numeric, or String A Case structure has two or more subdiagrams, or cases. Only one subdiagram is visible at a time. The selector terminal can be Boolean, Numeric, or String MEI U4 P2

Case structure A few things to remember about Case Structures and their data types: • If the data type is Boolean, the structure can only have two cases: True or False. • If the data type is numeric or string, the structure can have many cases. • If the data type is numeric or string, the first case will have default in the case structure name. • If the data type is numeric, use positive integer values. • If the data type is string, the data values must be in quotes. • Cases are not required to use input data or to supply output data, but if any case supplies output data, all must do so MEI U4 P2

Sequence Structures The Sequence Structure is used to control the data flow in a VI's Block Diagram. They are used to control the order of execution of nodes. MEI U4 P2

Sequence Structures MEI U4 P2

To pass data from one frame to any subsequent frame, use a sequence local terminal. MEI U4 P2

Sequence Structures An outward-pointing arrow appears in the sequence local terminal of the frame that contains the data source. MEI U4 P2

Sequence Structures The output tunnels of Sequence Structures can only have one data source which, unlike Case Structures, has outputs that must have one data source per case. The output can come from any frame, but the data will not leave the structure until the last frame in the structure has completed it's execution. MEI U4 P2

Formula Node Functions Palette >>Programming >>Structures>>Formula node Formula Node is a box where you enter algebraic formulas directly into the Block Diagram. It is useful when an equation is complicated or has many variables. y = x^2 + x + 1 Declare an input variable by right-clicking the Formula Node border and selecting Add Input from the menu. You cannot declare input variables inside The Formula Node Declare an output variable by and selecting Add Output from the menu. MEI U4 P2

You must wire all input terminals. There is no limit to the number of variables or equations in a Formula Node. No two inputs and no two outputs can have the same name, but an output can have the same name as an input. You can declare and use a variable inside the Formula Node without relating it to an input or output wire. You must wire all input terminals. MEI U4 P2

Formula Node Expression node Evaluates mathematical formulas and expressions similar to C. Expression node Functions Palette >>Programming>>Numeric>>Expr It is a simple model of the formula node, it has a single input, single output and one expression can be wrote without ;. MEI U4 P2