Week 3 Labview exercises

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.
LabView Academy 5. óra. Témakörök SubVI Modularitás Icon Connector Pane.
Lesson 2 Navigating LabVIEW
Welcome! Workshop 2 of 7.
Introduction to LabVIEW
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.
1 Lesson 5 Clusters TOPICS Introduction to Clusters Cluster Functions Error Clusters.
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.
Workshop 3 of 7 Welcome!. Today's Topics Review of Workshop 2 Loops While For Auto-indexing Shift registers Case Structure.
Course contents 1.Labview basics – virtual instruments, data flow, palettes 2.Structures – for, while, case,... – editing techniques 3.Controls&Indicators.
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.
Virtual Instrumentation With LabVIEW. Front Panel Controls = Inputs Indicators = Outputs LabVIEW Programs Are Called Virtual Instruments (VIs) Block Diagram.
LabVIEW an Introduction
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
Samuel Alberg Thrysøe, PhD, PostDoc, Kontakt info: Tlf:
Introduction to LabVIEW 8.5
CS320n –Visual Programming
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.
LabVIEW Course Course 2.
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.
Workshop 5 of 7 Welcome!. Today's Topics Review from Workshop 4 Modularity & subVIs Documentation File Input/Output Introduction.
Chapter 2: The Visual Studio .NET Development Environment
Welcome! Workshop 3 of 7.
Quiz Which types of folders are available in a LabVIEW Project?
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
LabVIEW Core 1 Key messages for the instructor:
Data Structures Arrays Common Array Functions Polymorphism
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
EE 200 Design Tools Laboratory 14
EET 2259 Unit 11 Charts and Graphs
Chapter 2 – Introduction to the Visual Studio .NET IDE
3.01 Apply Controls Associated With Visual Studio Form
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
EET 2259 Unit 3 Editing and Debugging VIs
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
Introduction to LabVIEW
Lesson 2: Introduction to Control programming using Labview
הודעות ריענון מהיר והרחבות Charts & Graphs גרף XY בניית מחולל אותות
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
הודעות ריענון מהיר והרחבות כתיבה לקובץ Low-Level דגימת אות Low-Level
Chapter 5 SubVIs.
LabVIEW 7.1 寒假短期教學課程 歐陽丞修 2006/02/06.
Word offers a number of features to help you streamline the formatting of documents. In this chapter, you will learn how to use predesigned building blocks.
Electronics II Physics 3620 / 6620
Structures- case, sequence, formula node
EET 2259 Unit 9 Arrays Read Bishop, Sections 6.1 to 6.3.
Introduction to LabVIEW
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
EET 2259 Unit 11 Charts and Graphs
EET 2259 Unit 2 Virtual Instruments
Chapter 8 Using Document Collaboration and Integration Tools
EET 2259 Unit 4 SubVIs Read Bishop, Chapter 4.
הודעות ריענון מהיר והרחבות - Shift Register Feedback Node המשך
Presentation transcript:

Week 3 Labview exercises

ECE 206 Lab 5 Build the following circuit using your DAQ. Since the DAQ probe cannot read voltages greater than 10 V, use a potentiometer to get a 10V power source. Build a Labview program that sweeps the input in .1 V increments from 0V to 3 V. You might find the “Merge” VI helpful. Store your voltages in excel, and plot Vout vs Vin in excel. Your plot should look like the one below. Upload your Labview code and excel file onto the google drive.

Simulation Design a labview program that will simulate the inverter transistor. Store your voltages in excel, and plot Vout vs Vin in excel. Upload your Labview code and excel file onto the google drive. Your plot should look like the one below. In the program I wrote, some of the VI’s I Used were: “Select”, “In Range and Coerce”, and “Formula”.

ECE 206 Lab 4 Build the following circuits using your DAQ. Use a signal generator to generate the sine wave inputs and the MyDAQ to read both the input and outputs. Store your voltages in excel, and plot Vout and Vin on the same axes in excel. (Also have plots in your front panel). Upload your Labview code and excel file onto the google drive.

Dynamic Data Watch video to help with graphing

Simulation Simulate the following circuits in one labview VI (use tabs and case structures for the different circuits. Make plots Vo on the front panel and Vo and Vi in excel.

Back to Labview Enums give users a list of items from which to select. Enums (can be used with case structures instead of tab control) Enums give users a list of items from which to select. Each item represents a pair of values. String 16-bit Integer 7

Watch the video Do the diode of the previous slide but instead of using tabs use enums

Documenting Block Diagram Code Owned labels: Explain data contents of wires and objects. Move with object. Have transparent backgrounds. Select Visible Items»Label from the shortcut menu to create. Free labels: Describe algorithms. Have pale yellow backgrounds. Double-click in any open space to create.

Arrays An array: Is a collection of data elements that are of same type. Has one or more dimensions. Contains up to (231)–1 elements per dimension, memory permitting. Accesses elements by its index. Note: The first element is index 0. Arrays are lists of elements of the same data type. They are analogous to arrays in traditional languages. Arrays can have one or more dimensions. Arrays can have up to 2^31 elements per dimension. Actual array sizes that students can create is limited by memory. Elements are accessed by an index. The index ranges from 0 to N-1 (N = number of elements in the array). Arrays are zero-indexed (first element is zero) in each dimension. A 2D array is analogous to a spreadsheet or table. Example: If your data contains temperature readings and time stamps, one column is time values and the other column is readings. Be careful to specify the element you really want. Example: The first element in an array is array (0), not array(1).

Arrays – 1D and 2D Examples ID array One row of 10-elements 1.2 3.2 8.2 8.0 4.8 5.1 6.0 1.0 2.5 1.7 0 1 2 3 4 5 6 7 8 9 Index numbers 2D array Five-row by seven-column table of 35 elements 0 1 2 3 4 5 6 1 2 3 4

Viewing Arrays on the Front Panel The elements at index 0 are not shown because element 1 is selected in the index display. First element at index 1 Second element at index 2 The element selected in the index display always refers to the element shown in the upper-left corner of the element display. 12

Creating an Array Control For a new array: Select an Array control from the Controls palette on the front panel. Place a data object, such as a numeric control, into the array shell. Add a second dimension, if necessary, by resizing the index. From a block diagram terminal or wire: Right-click the object and select Create»Control or Create»Indicator. Creating array controls in LabVIEW: You can place any data type in an array shell except an array. You cannot have an array of arrays; use a 2D array instead. Emphasize that this is a two-step process. Students often place only empty array shells on the front panel. Remind them they must place a data type inside the array shell. Demonstrate the following on your computer: Create a numeric array. Point out index and data object components. Show how to create a 2D array. Show how to display multiple array elements. Show that index elements always reference the upper-leftmost object in the array display. Show how elements in an array are initially grayed out, indicating that a portion of the array has not been defined.

2D Arrays 2D arrays: Store elements in a grid. Require a column index and a row index to locate an element, both of which are zero-based. Create a multidimensional array on the front panel by right-clicking the index display and selecting Add Dimension from the shortcut menu. Resize the index display until you have as many dimensions as you want.

Auto-Indexing Auto-Indexing Enabled Wire becomes thicker Allows For Loops and While Loops to accumulate arrays at their boundaries. Is the default behavior for For Loops. Is disabled by default for While Loops. Is enabled/disabled by right-clicking on a tunnel. Produces arrays that are always equal in size to the number of iterations of the loop. 1D Array 0 1 2 3 4 5 Auto-Indexing Disabled Wire remains the same size For Loops and While Loops can index and accumulate arrays at their boundaries. This is known as auto-indexing. The indexing point on the boundary is called a tunnel. The For Loop default is auto-indexing enabled. The While Loop default is auto-indexing disabled. Only one value (the last iteration) is passed out of the While Loop by default. Examples: Enable auto-indexing to collect values within the loop and build the array. All values are placed in the array upon exiting the loop. Disable auto-indexing if you are interested only in the final value. Only one value (last iteration) is passed out of the loop

Waveform Graph Is a graphical display of data. Displays one or more plots of evenly sampled measurements. Is used to plot pre-generated arrays of data. Can display plots with any number of data points.

Charts vs. Graphs – Single-Plot

Auto-Indexing with a Conditional Tunnel Right-click on a tunnel and select Tunnel Mode»Conditional. You can determine what values LabVIEW writes to the loop output tunnel based on a condition you specify by right-clicking the loop output tunnel and selecting Tunnel Mode»Conditional from the shortcut menu. Because of the conditional tunnel, the Values less than 5 array contains only the elements 2, 0, 3, and 1 after this loop completes all iterations.

Creating 2D Arrays Inner loop creates column elements. 0 1 2 3 4 5 You can use two nested For Loops to create a 2D array. Auto-indexing must be enabled for both loops. Explain the different line thicknesses in the wire connecting the Random Number function to the 2D Array Indicator. Demonstrate on your computer: How to change indexing and line thickness. When you see Enable indexing in the shortcut menu it means that indexing is currently disabled. The menu choice is the opposite of the current indexing mode. Students get confused about this feature. Inner loop creates column elements. Outer loop stacks column elements into rows.

Arrays Simulate circuit 1 and store Vout in an array. Graph Vout using Waveform graph (not waveform chart) and using x-y graph

Understanding Modularity – SubVIs SubVI — A VI within another VI SubVIs correspond to subroutines in text-based programming languages. The upper-right corner of the front panel and block diagram displays the icon for the VI. This icon identifies the VI when you place the VI on a block diagram.

Understanding Modularity – SubVIs Repeated code can become subVIs.

Understanding Modularity – SubVIs

Understanding Modularity – SubVIs Function Code Calling Program Code function average (in1, in2, out) { out = (in1 + in2)/2.0; } main average (point1, point2, pointavg) SubVI Block Diagram Calling VI Block Diagram Every VI displays an icon in the upper-right corner of the front panel and block diagram windows. The icon is a graphical representation of a VI and identifies the subVI on the block diagram of the calling VI. The icon and connector pane correspond to the function prototype in text-based programming languages.

B. Icon Characteristics of a Good Icon Using the Icon Editor

Icon An icon is a graphical representation of a VI. If you use a VI as a subVI, the icon identifies the subVI on the block diagram of the VI.

Characteristics of a Good Icon Good icons convey the functionality of the VI using: Relevant graphics Descriptive text, if necessary

Creating Icons - Icon Editor Open the Icon Editor using one of these methods: Right-click the icon in the upper-right corner of the front panel or block diagram and select Edit Icon. Double-click the icon. After you build a VI, customize the icon so you can identify the VI when you use it as a subVI on a block diagram. Create icons using the Icon Editor dialog box. Alternatively, you can drag a graphic file, such as a .bmp or .jpg, from your file system to the icon in the upper-right corner of the VI.

Icon Editor Use the editing tools to modify an icon manually.

Icon Editor Use the Glyphs tab to display glyphs you can include in the icon.

Icon Editor Use the Icon Text tab to specify the text to display in the icon.

Icon Editor Use the Templates tab to display icon templates you can use as a background for the icon.

C. Connector Pane Patterns Standards

Connector Pane The connector pane is displayed next to the icon in the upper right corner of the front panel. Each rectangle on the connector pane represents a terminal. Use the terminals to assign inputs and outputs. Select a different pattern by right-clicking the connector pane and selecting Patterns from the shortcut menu.

Connector Pane – Standards Use this connector pane layout as a standard. Top terminals are usually reserved for references, such as a file reference. Bottom terminals are usually reserved for error clusters.

D. Using SubVIs Using on Block Diagram Terminal Settings Handling Errors Creating from a Section of Block Diagram

Using SubVIs Options to place a subVI on the block diagram: Drag the VI from the Project Explorer to the block diagram. Click Select a VI on the Functions palette and then navigate to the VI. Drag the icon from an open VI to the block diagram of another VI.

SubVI Define a subVI called diode which outputs .7V for Vi1>Vi2 and outputs Vi1-Vi2 for Vi1<Vi2. Simulate the circuits below and graph Vout using Waveform graph (not waveform chart) and using x-y graph. Your program may or may not correspond to the circuit.