LabVIEW 7.1 寒假短期教學課程 歐陽丞修 2006/02/06.

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

LabVIEW Crash Course Presented by:.
LabVIEW is a graphical programming development environment for data acquisition and control, data analysis, and data presentation. With LabVIEW you can.
Lesson 2 Navigating LabVIEW
Based on LabVIEW 2011 Student Edition
Workshop 1 of 7 Welcome!. Who am I? Dilim Nwobu Computer Engineering ‘12 Fall 2011 Software Developer for NI LabVIEW Student Ambassador for Texas A&M.
Introduction to LabVIEW
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.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
ME 411/511Prof. Sailor Data Acquisition & LabView Lecture goals… –Learn the basics of how to use and modify LabView Virtual Instruments –Become familiar.
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.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
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.
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
Biomedical Measurements & Analysis using 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 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
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.
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:
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.
Digital Electronics and Computer Interfacing Tim Mewes 4. LabVIEW - Advanced.
Introduction to LabVIEW 8.5
Lab 1 : Introduction to LabView 1 Southern Methodist University Bryan Rodriguez.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs Block Diagram Accompanying “program” for front panel Components.
CS320n –Visual Programming More LabVIEW Foundations.
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.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
EET 2259 Programming for Electronics Technology Professor Nick Reeder.
Workshop 5 of 7 Welcome!. Today's Topics Review from Workshop 4 Modularity & subVIs Documentation File Input/Output Introduction.
Week 3 Labview exercises
Chapter 2: The Visual Studio .NET Development Environment
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
EET 2259 Unit 11 Charts and Graphs
EET 2259 Unit 3 Editing and Debugging VIs
Introduction to LabVIEW
הודעות-שיעור1 שי שרעבי חדר 201
Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS.
CST-115 Introduction to Computer Programming
הודעות ריענון מהיר והרחבות כתיבה לקובץ Low-Level דגימת אות Low-Level
Chapter 1 LabVIEW Basics
Chapter 5 SubVIs.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter 4 Editing and Debugging
Structures- case, sequence, formula node
EET 2259 Unit 9 Arrays Read Bishop, Sections 6.1 to 6.3.
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 3 Editing and Debugging VIs
Presentation transcript:

LabVIEW 7.1 寒假短期教學課程 歐陽丞修 2006/02/06

LabVIEW 簡介 LabVIEW (Laboratory Virtural Instrument Engineering Workbench ) 虛擬儀表(VI,Virtual Instrument) 量測、呈現與分析資料 G 語言(Graphic Language)

虛擬儀表 (Virtual Instrument) Virtual instrument has all main properties of the real one, being „only” computer program.

Virtual Instrumentation With LabVIEW 程式方塊 人機介面

開啟LabVIEW 開始=>程式集=>National Instrument LabVIEW 7.1

開啟新VI

人機介面 Front Panel 程式方塊圖 Block Diagram

建立VI程式 狀態面板 工具面板 控制面板

Automatic Selection Tool 工具面版 Floating Palette Used to operate and modify front panel and block diagram objects. Automatic Selection Tool Operating Tool Positioning/Resizing Tool Labeling Tool Wiring Tool Shortcut Menu Tool Scrolling Tool Breakpoint Tool Probe Tool Color Copy Tool Coloring Tool If automatic tool selection is enabled and you move the cursor over objects on the front panel or block diagram, LabVIEW automatically selects the corresponding tool from the Tools palette. Toggle automatic tool selection by clicking the Automatic Tool Selection button in the Tools palette. Use the Operating tool to change the values of a control or select the text within a control. Use the Positioning tool to select, move, or resize objects. The Positioning tool changes shape when it moves over a corner of a resizable object. Use the Labeling tool to edit text and create free labels. The Labeling tool changes to a cursor when you create free labels. Use the Wiring tool to wire objects together on the block diagram.

狀態面版 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 if the VI is a top-level VI, meaning it has no callers and therefore is not a subVI. Click the Continuous Run button to run the VI until you abort or pause it. You also can click the button again to disable continuous running. While the VI runs, the Abort Execution button appears. Click this button to stop the VI immediately. Note: Avoid using the Abort Execution button to stop a VI. Either let the VI complete its data flow or design a method to stop the VI programmatically. By doing so, the VI is at a known state. For example, place a button on the front panel that stops the VI when you click it. Click the Pause button to pause a running VI. When you click the Pause button, LabVIEW highlights on the block diagram the location where you paused execution. Click the Pause button again to continue running the VI. Select the Text Settings pull-down menu to change the font settings for the VI, including size, style, and color. Select The Align Objects pull-down menu to align objects along axes, including vertical, top edge, left, and so on. Select the Distribute Objects pull-down menu to space objects evenly, including gaps, compression, and so on. Select the Resize Objects pull-down menu to change the width and height of front panel objects.

LabVIEW介面 控制元(Input) 與顯示元(Output) Front Panel

Block Diagram 控制元接點 接線 節點 顯示元接點

程式方塊之接線型式 Floating-point Number 橘色 Interger Number 藍色 Boolean 綠色 String 粉紅色

Wiring Tips – Block Diagram Wiring “Hot Spot” Click To Select Wires Clean Up Wiring Use Automatic Wire Routing In addition to Front Panel terminals, the Block diagram contains functions. Each function may have multiple input and output terminals. Wiring to these terminals is an important part of LabVIEW programming. Once you have some experience programming in LabVIEW, wiring will become easy. At first, you may need some assistance. Here are some tips to get you started: The wiring tool is used to wire to the nodes of the functions. When you “aim” with the wiring tool, aim with the end of the wire hanging from the spool. This is where the wire will be placed. As you move the wiring tool over functions, watch for the yellow tip strip. This will tell you the name of the terminal you are wiring to. As you move the wiring tool over a terminal, it will flash. This will help you identify where the wire will attach. For more help with the terminals, right-click on the function and select Visible Items>>Terminals. The function’s picture will be pulled back to reveal the connection terminals. Notice the colors- these match the data types used by the front panel terminals. For additional help, select Help>>Show Context Help, or press CTRL+H. This will bring up the context help window. As you move your mouse over the function, this window will show you the function, terminals, and a brief help description. Use this with the other tools to help you as you wire. If your wiring becomes doesn’t look very good, right-click on the particular wire in question and choose Clean Up Wire to automatically re-route that wire.

數值運算

布林運算

比較運算

簡易計算機練習

簡易計算機練習

建立子程式(SubVIs) A SubVI is a VI that can be used within another VI Similar to a subroutine Advantages Modular Easier to debug Don’t have to recreate code Require less memory After you build a VI and create its icon and connector pane, you can use it in another VI. A VI within another VI is called a subVI. A subVI corresponds to a subroutine in text-based programming languages. Using subVIs helps you manage changes and debug the block diagram quickly.

Steps to Create a SubVI Create the Icon Create the Connector Assign Terminals Save the VI Insert the VI into a Top Level VI

建立子程式(SubVI)

建立子程式(SubVI)

呼叫子程式

呼叫子程式 若為常數有何好處 SubVI 內容

呼叫子程式

架構-迴圈控制

迴圈種類 C語言 for (i=0;i<10;i++) { … } i=0; do { … i++; } while (i<10) i=0; while (i<10) { … i++; } For Loop While Loop Do … While Loop

For Loop 次數(N) 目前執行完畢的迴圈數

For Loop for (i=0;i<10;i++) { … } 位移暫存器 (0~N-1)

位移暫存器

For Loop 結果有何差異??

While Loop 目前執行的迴圈次數 狀態接點

While Loop i=0; while (i<10) { … i++; } i=-1; do { … i++; }

While Loop 錯誤!! 正確!!

While Loop 等效

圖形函式

For Loop & While Loop練習

For Loop & While Loop練習

模擬雜訊

模擬雜訊

Case structure

Case structure

Case structure if (Number >= 0) then Square Root Value= SQRT (Number) else Square Root Value = -99999 Display Error Message end if

Case structure 應用

Case structure 應用

Formula Node

Formula Node

Formula Node

Sequence Structure Stacked Sequence Structure Flat Sequence Structure

Stacked Sequence Structure 逐頁執行…

Stacked Sequence Structure

Flat Sequence Structure 由左而右逐頁執行…

Event Structure

Adding an Array From the Controls >> All Controls >> Array and Cluster subpalette, select the Array Shell Drop it on the screen. To create an array control or indicator as shown, select an array on the Controls»All Controls»Array & Cluster palette, place it on the front panel, and drag a control or indicator into the array shell. If you attempt to drag an invalid control or indicator such as an XY graph into the array shell, you are unable to drop the control or indicator in the array shell. You must insert an object in the array shell before you use the array on the block diagram. Otherwise, the array terminal appears black with an empty bracket.

Adding an Array (cont.) Place data object into shell (i.e. Numeric Control) To add dimensions to an array one at a time, right-click the index display and select Add Dimension from the shortcut menu. You also can use the Positioning tool to resize the index display until you have as many dimensions as you want.

Creating an Array with a Loop If you wire an array to a For Loop or While Loop input tunnel, you can read and process every element in that array by enabling auto-indexing. When you auto-index an array output tunnel, the output array receives a new element from every iteration of the loop. The wire from the output tunnel to the array indicator becomes thicker as it changes to an array at the loop border, and the output tunnel contains square brackets representing an array, as shown in the following illustration. Disable auto-indexing by right-clicking the tunnel and selecting Disable Indexing from the shortcut menu. For example, disable auto-indexing if you need only the last value passed to the tunnel in the previous example, without creating an array. Note Because you can use For Loops to process arrays an element at a time, LabVIEW enables auto-indexing by default for every array you wire to a For Loop. Auto-indexing for While Loops is disabled by default. To enable auto-indexing, right-click a tunnel and select Enable Indexing from the shortcut menu. If you enable auto-indexing on an array wired to a For Loop input terminal, LabVIEW sets the count terminal to the array size so you do not need to wire the count terminal. If you enable auto-indexing for more than one tunnel or if you wire the count terminal, the count becomes the smaller of the choices. For example, if you wire an array with 10 elements to a For Loop input tunnel and you set the count terminal to 15, the loop executes 10 times.

Creating 2D Arrays You can use two For Loops, one inside the other, to create a 2D array. The outer For Loop creates the row elements, and the inner For Loop creates the column elements.

Creating an Array with a Loop

Formula Node

Thanks for your attention!

參考資訊 Example programs (Help» Find Examples…) LabVIEW Student Edition (www.ni.com/labviewse) Web resources (ni.com) NI Developer Zone (zone.ni.com) Application Notes Info-labview newsgroup (www.info-labview.org/) Instrument Driver Library (www.ni.com/idnet) Where do you go from here? National Instruments offers a wide range of instructional courseware to expand your knowledge. Please visit ni.com/academic for programs and resources available. The LabVIEW Student Edition is a available from our website. In includes Learning With LabVIEW, a textbook written by Dr. Bob Bishop from the University of Texas at Austin. The web is the best place to turn in order to find information on LabVIEW. Ni.com is designed to be the one stop resource to find information. The NI Developer Zone (“NIDZ”) is a place for developers to meet, discuss design issues, and post content. Application Notes can be downloaded from ni.com/support on a variety of topics. Info-labview is a newsgroup maintained by a third party. There is an exhaustive library of LabVIEW instrument drivers available for download from NIDZ.