NI LabView READ THIS DOCUMENT CAREFULLY AND FOLLOW THE INSTRIUCTIONS IN THE EXERCISES

Similar documents
Introduction to LabVIEW

The LabVIEW Programming Environment and Basic Operations

Introduction to LabVIEW

Learn the three palettes. Learn how data is passed in LabVIEW. Create a subvi using two different methods.

LabVIEW. Table of Contents. Lesson 1. Pre-reqs/Technical Skills Basic computer use

Lesson 1 Introduction to LabVIEW. TOPICS LabVIEW Environment Front Panel Block Diagram Dataflow Programming LabVIEW Help and Manuals Debugging a VI

Virtual Instruments with LabVIEW

Linear Control Systems LABORATORY

Getting Started with LabVIEW Virtual Instruments

Lesson 4 Implementing a VI

LabVIEW programming I

Lab 4 - Data Acquisition

Virtual Instrumentation With LabVIEW

A. Front Panel Design Lesson 4 Implementing a VI

LabVIEW programming I

LabVIEW TM Basics I Introduction Course Manual

Introduction to LabVIEW Exercise-1

Exercise 0 - Open and Run a Virtual Instrument (Slide 12)

Lab 1: Getting familiar with LabVIEW: Part I

Virtual Instrumentation With LabVIEW

Basic Data Acquisition with LabVIEW

OpenStax-CNX module: m Thermometer VI * National Instruments

Read Temperature Data

ME 365 EXPERIMENT 3 INTRODUCTION TO LABVIEW

LabVIEW basics. BME MIT János Hainzmann, Károly Molnár, Balázs Scherer, Csaba Tóth

LabVIEW Express VI Development Toolkit User Guide

Dept. of Electrical, Computer and Biomedical Engineering. Data Acquisition Systems and the NI LabVIEW environment

Small rectangles (and sometimes squares like this

Faculty of Computing, Engineering and Technology. Real Time Systems 1 CE LabVIEW David D. Hodgkiss & Staffordshire University 1

Exercise 5: Basic LabVIEW Programming

Hands-on Lab 1: LabVIEW NI-DAQ Basics 1

LabVIEW & FRC. BAA Fall Education Day 2015

Labview. Masood Ejaz

Certified LabVIEW Associate Developer Exam. Test Booklet

Above Threshold Warning of Temperature Data

Shift Register: Exercise # 1: Shift Register Example VI. 1. Build the following front panel. Figure (8.1): Shift register exercise front panel

Concept: Debugging. Goal. Description. Implementation. Use the debugging tools built into LabVIEW.

Table 1. Inputs and Outputs

LabVIEW TM Core 1 Course Manual

University of Pennsylvania. Department of Electrical and Systems Engineering. ESE Undergraduate Laboratory. Introduction to LabView

ME 224: EXPERIMENTAL ENGINEERING. Lecture 2

Introduction to National Instruments LabVIEW and Data Acquisition (DAQ)

PHYC 500: Introduction to LabView. Exercise 1 (v 1.3) M.P. Hasselbeck, University of New Mexico

CLAD Sample Exam 03. C. A control that output a cluster of the controls / indicators on the tabs.

Engineering Innovation Center LabVIEW Basics

LabView instrumentoinnissa, 55492, 3op Labview in instrumentation

Originally released in 1986, LabVIEW (short for Laboratory Virtual Instrumentation

PHYC 500: Introduction to LabView. Exercise 8 (v 1.3) M.P. Hasselbeck, University of New Mexico. Arrays, XY Graphs, Disk I/O

CLAD Sample Exam 06. B. Panel Resize. C. Panel Close? D. Value Change

Certified LabVIEW Associate Developer Exam. Test Booklet

ECE 202 LAB 1 INTRODUCTION TO LABVIEW

Today. 4/5/11 Physics 262 Lecture 10 Questions about Exams Homework. Lab: Continue project. Lecture. Review your exams and review practice exam again.

CLAD Sample Exam 04. B. When you create an Array constant on the Block Diagram, it is not visible on the Front Panel.

Homework Assignment 9 LabVIEW tutorial

Introduction to LabVIEW

OVERVIEW GOALS KEY TERMS

c01.qxd p /18/01 11:03 AM Page 1 Fundamentals

BE/EE189 Design and Construction of Biodevices Lecture 2. BE/EE189 Design and Construction of Biodevices - Caltech

Training material. Introduction to LabVIEW

Certified LabVIEW Associate Developer Examination

Computer Interfacing Using LabView

AOE 3054 LabView Programming

LabVIEW Academy. 12. óra event, property node

Certified LabVIEW Associate Developer Examination

ENGR 1000, Introduction to Engineering Design

CLAD_80.questions.

Tutorial: Getting Started with the LabVIEW Simulation Module

ni.com Preparing for the CLAD Exam

LabView programming 練習

CISE 318: Computer Control Systems Laboratory Exercises

LabVIEW Basics. Based on LabVIEW 2011 Student Edition

PHYC 500: Introduction to LabView. Exercise 16 (v 1.2) Controlling hardware with DAQ device. M.P. Hasselbeck, University of New Mexico

National Instruments Corporation 1 Introduction to LabVIEW Hands-On

Application State Machine

B. Including the Event Structure within a loop. C. Configuring a Timeout case within the Event Structure

Introduction to LabVIEW TM

Part 1. Creating an Array of Controls or Indicators

National Instruments Corporation 1 Introduction to LabVIEW Hands-On

Engineering Project-I. Module 1: Familiarization of LabVIEW and the Vernier Toolkit

LABVIEW LAB SKILLS ACTIVITY 1 PROGRAMING ENVIRONMENT

Basic Concepts. Launching MultiAd Creator. To Create an Alias. file://c:\documents and Settings\Gary Horrie\Local Settings\Temp\~hh81F9.

ENGR 1000, Introduction to Engineering Design

Step-by-Step Data Acquisition Part II Exercise 2: Generating an Analog Output Waveform

BE/EE189 Design and Construction of Biodevices Lecture 1. BE/EE189 Design and Construction of Biodevices - Caltech

Introduction to LabVIEW. Modified Powerpoint file taken from ma/courses/es110/

NAME EET 2259 Lab 3 The Boolean Data Type

INTRODUCTION TO LABVIEW

Introduction to LabVIEW. By Finn Haugen, TechTeach

2. The LabView Environment Two panes will open, one is the Front panel, and one is the Block Diagram

Learn LabVIEW 2010 / 2011 Fast

Arrays are lists of elements of the same data type. They are analogous to arrays in traditional languages.

LabVIEW Demonstration Guide

CPM-200 User Guide For Lighthouse for MAX

Application of Skills: Microsoft Excel 2013 Tutorial

Using LabVIEW. with. BiPOM Boards. Quick Start Guide. Document Revision: Date: 18 September, 2009

EKT 314/4 LABORATORIES SHEET

ECE 463 Lab 1: Introduction to LabVIEW

NI LabVIEW RIO Evaluation Kit [ Tutorial ]

Experiment 1: Introduction to Labview 8.0 (tbc 1/7/2007, 1/13/2009,1/13/2011)

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

Transcription:

NI LabView READ THIS DOCUMENT CAREFULLY AND FOLLOW THE Introduction INSTRIUCTIONS IN THE EXERCISES According to National Instruments description: LabVIEW is a graphical programming platform that helps engineers scale from design to test and from small to large systems. It offers unprecedented integration with existing legacy software, IP, and hardware while capitalizing on the latest computing technologies. LabVIEW provides tools to solve today s problems and the capacity for future innovation faster and more effectively (National Instruments, 2013) NI LabVIEW software is the foundation of the National Instruments products. The software integrates a huge number of tools necessary for building any measurement, data acquisition or control application. LabVIEW software makes easier the integration software- hardware bringing together a flexible and friendlier platform to measure and control systems on time and cost friendly. CompactRIO CompactRIO is a reconfigurable embedded control and acquisition system. The CompactRIO system s rugged hardware architecture includes I/O modules, a reconfigurable FPGA chassis, and an embedded controller. Additionally, CompactRIO is programmed with NI LabVIEW graphical 1

LABVIEW Environment LabVIEW (short for Laboratory Virtual Instrumentation Engineering Workbench) is a platform and development environment for a visual programming language from National Instruments. The graphical language is named "G". Originally released for the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms including Microsoft Windows, UNIX, Linux, and Mac OS X. The latest version of LabVIEW is version LabVIEW 2013. Visit National Instruments at www.ni.com. LabVIEW contains a comprehensive set of tools for acquiring, analysing, displaying, and storing data, as well as tools to help you troubleshoot your code. The code files have the extension.vi, which is an abbreviation for Virtual Instrument. LabVIEW programs are called Virtual Instruments, or VIs, because their appearance and operation imitate physical instruments. LabVIEW contains a comprehensive set of tools for acquiring analysing, displaying, and storing data, as well as tools to help you troubleshoot your code. When opening LabVIEW, you first come to the Getting Started window. 2

In order to create a new LabVIEW project, select Create project and then select Blank VI, an untitled front panel window appears. This window displays the front panel; this is one of the two LabVIEW windows you use to build a VI. The other window contains the block diagram. Front Panel When you have created a new VI or selected an existing VI, the Front Panel and the Block Diagram for that specific VI will appear In LabVIEW, you build a user interface, or front panel, with controls and indicators. Controls are knobs, push buttons, dials, and other input devices. Indicators are graphs, LEDs, and other displays. You build the front panel with controls and indicators, which are the interactive input and output terminals of the VI, respectively. Controls are knobs, push buttons, dials, and other input devices. Indicators are graphs, LEDs, and other displays. Controls simulate instrument input devices and supply data to the block diagram of the VI. Indicators simulate instrument output devices and display data the block diagram acquires or generates. The Block Diagram After you build the user interface, you add code using VIs and structures to control the front panel objects. The block diagram contains this code. In some ways, the block diagram resembles a flowchart. 3

After you build the front panel, you add code using graphical representations of functions to control the front panel objects. The block diagram contains this graphical source code. Front panel objects appear as terminals, on the block diagram. Block diagram objects include terminals, sub VIs, functions, constants, structures, and wires, which transfer data among other block diagram objects. The Figure below shows a front panel and its corresponding block diagram with front panel and block diagram components. 4

The different components are as follows: 1. Toolbar 2. Owned Label 3. Numeric Control 4. Free Label 5. Numeric Control Terminal 6. Knob Terminal 2.4 LABVIEW PALETTES: Controls Palette 7. Numeric Constant 8. Multiply Function 9. Icon 10. Knob Control 11. Plot Legend 12. XY Graph 10 13. Wire Data Path 14. XY Graph Terminal 15. Bundle Function 16. Sub VI 17. For Loop Structure The Controls and Functions palettes contain sub palettes of objects that you can use to create a VI. When you click a sub palette icon, the entire palette changes to the sub palette you selected. To use an object on the palettes, click the object and place it on the front panel or 5

block diagram. The Controls palette is available only on the front panel. The Controls palette contains the controls and indicators you use to build the front panel. To get the control pallet just click on the right button of the mouse on the front panel. Function Palette The Functions palette is available only on the block diagram. The Functions palette contains the VIs and functions you use to build the block diagram. To get the Function pallet just click on the right button of the mouse on the Block Diagram. 6

Tools Palette You can create, modify, and debug VIs using the tools located on the floating Tools palette. The Tools palette is available on both the front panel and the block diagram. A tool is a special operating mode of the mouse cursor. The cursor corresponds to the icon of the tool selected in the Tools palette. Use the tools to operate and modify front panel and block diagram objects. The tools palette can be accessed holding the shift key and the right button of the mouse or from the VI menu 2.5 Toolbar Below we see the LabVIEW Toolbar: The behaviours of the different buttons are as follows: 7

Click the Run button to run a VI. LabVIEW compiles the VI, if necessary. You can run a VI if the Run button appears as a solid white arrow. The solid white arrow, shown above, also indicates you can use the VI as a sub VI if you create a connector pane for the VI. While the VI runs, the Run button appears as shown at left if the VI is a top-level VI, meaning it has no callers and therefore is not a sub VI. If the VI that is running is a sub VI, the Run button appears as shown at left. The Run button appears broken, shown at left, when the VI you are creating or editing contains errors. If the Run button still appears broken after you finish wiring the block diagram, the VI is broken and cannot run. Click this button to display the Error list window, which contains all errors and warnings. Click the Run Continuously button, shown at left, to run the VI until you abort or pause execution. You also can click the button again to disable continuous running. While the VI runs, the Abort Execution button, shown at left, appears. Click this button to stop the VI immediately if there is no other way to stop the VI. If more than one running toplevel VI uses the VI, the button is dimmed. 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, shown at left, to pause a running VI. When you click the Pause button, LabVIEW highlights the location of the block diagram where you halted the execution, and the Pause button appears red. Click the button again to continue running the VI. Highlight execution, use this function to slow down the data flow and check the data running through the code. You can use it to debug the code and edit any error. 8

Controls and Functions Palettes The Controls and Functions palettes contain sub palettes of objects you can use to create a VI. When you click a sub palette icon, the entire palette changes to the sub palette you selected. To use an object on the palettes, click the object and place it on the front panel or block diagram. Controls Palette The Controls palette is available only on the front panel. The Controls palette contains the controls and indicators you use to create the front panel. Select Window» Show Controls Palette or right-click the front panel workspace, it displays the Controls palette. Tack down the Controls palette by clicking the thumbtack on the top left corner of the palette. By default, the Controls palette starts in the Express view. Numeric Controls and Indicators The two most commonly used numeric objects are the numeric control and the numeric indicator, as shown in the following illustration. To enter or change values in a numeric control, click the increment and decrement buttons with the Operating tool or double-click the number with either the Labelling tool or the Operating tool, type a new number, and press the <Enter> key. Boolean Controls and Indicators 9

Use Boolean controls and indicators to enter and display Boolean (True or False) values. Boolean objects simulate switches, push buttons, and LEDs. The most common Boolean objects are the vertical toggle switch and the round LED, as shown in the following example. Express VIs, VIs, and Functions LabVIEW uses coloured icons to distinguish between Express VIs, VIs, and functions on the block diagram. By default, icons for Express VIs appear on the block diagram as expandable nodes with icons surrounded by a blue field. Icons for VIs have white backgrounds, and icons for functions have pale yellow backgrounds. By default, most functions and VIs on the block diagram appear as icons that are not expandable, unlike Express VIs. Express VIs Use Express VIs for common measurement tasks. Express VIs are nodes that require minimal wiring because you configure them with dialog boxes. You can save the configuration of an Express VI as a subvi. VIs When you place a VI on the block diagram, LabVIEW considers the VI to be a subvi. When you double-click a subvi, its front panel and block diagram appear, rather than a dialog box in which you can configure options. The front panel includes controls and indicators. The block diagram includes wires, front panel icons, functions, possibly subvis, and other LabVIEW objects. The upper right corner of the front panel and block diagram displays the icon for the VI. This is the icon that appears when you place the VI on the block diagram. You can create a VI to use as a subvi. 10

Functions Functions are the fundamental operating elements of LabVIEW. Functions do not have front panels or block diagrams but have connector panes. Double-clicking on a function only selects the that particular function. Nodes Nodes are objects on the block diagram that have inputs and/or outputs and perform operations when a VI runs. They are similar to statements, operators, functions, and subroutines in text-based programming languages. Nodes can be functions, subvis, or structures. Structures are process control elements, such as Case structures, For Loops, or While Loops. Expandable Nodes versus Icons You can display VIs and Express VIs as icons or as expandable nodes. Expandable nodes appear as icons surrounded by a coloured field. SubVIs appear with a yellow field, and Express VIs appear with a blue field. Use icons, such as the Basic Function Generator VI icon shown at left, if you want to conserve space on the block diagram. Use expandable nodes, such as the Basic Function Generator VI expandable node shown at left, to make wiring easier and to aid in documenting block diagrams. By default, subvis appear as icons on the block diagram, and Express VIs appear as expandable nodes. To display a subvi or Express VI as an expandable node, right-click the subvi or Express VI and select View As Icon from the shortcut menu to remove the checkmark. You can resize the expandable node to make wiring even easier, but it also takes a large amount of space on the block diagram. Complete the following steps to resize a node on the block diagram. 1. Move the Positioning tool over the node. Resizing handles appear at the top and bottom of the node. 11

2. Move the cursor over a resizing handle to change the cursor to the resizing cursor. 3. Use the resizing cursor to drag the border of the node down to display additional terminals. 4. Release the mouse button. To cancel a resizing operation, drag the node border past the block diagram window before you release the mouse button. The following figure shows the Basic Function Generator VI as a resized expandable node. Terminals Front panel objects appear as terminals on the block diagram. The terminals represent the data type of the control or indicator. You can configure front panel controls or indicators to appear as icon or data type terminals on the block diagram. By default, front panel objects appear as icon terminals. For example, a knob icon terminal, shown at left, represents a knob on the front panel. The DBL at the bottom of the terminal represents a data type of double-precision, floatingpoint numeric. To display a terminal as a data type on the block diagram, right-click the terminal and select View as Icon from the shortcut menu to remove the checkmark. A DBL data type terminal, shown at left, represents a double-precision, floating-point numeric control or indicator. 12

Wires Data is transferred among block diagram objects through wires. Wires are similar to variables in text-based programming languages. In Figure 1-9, wires connect the control and indicator terminals to the Add and Subtract functions. Each wire has a single data source, but you can wire it to many VIs and functions that read the data. Wires are different colours, styles, and thicknesses, depending on their data types. A broken wire appears as a dashed black line with a red X in the middle. The following examples are the most common wire types. In LabVIEW, you use wires to connect multiple terminals together to pass data in a VI. The wires must be connected to inputs and outputs that are compatible with the data that is transferred with the wire. For example, you cannot wire an array output to a numeric input. In addition the direction of the wires must be correct. The wires must be connected to only one input and at least one output. For example, you cannot wire two indicators together. The components that determine wiring compatibility include the data type of the control and/or indicator and the data type of the terminal. DATA TYPES Numeric: This data type contains either an integer or floating point numbers Boolean: This data type contains logical combinations of TRUE/FALSE, AND, OR, NOT, Etc. String: Contains alpha-numeric characters only Cluster. Encloses several data types. Cluster data types appear brown if all elements in the cluster are numeric or pink if all elements of the cluster are of different types. These data types can be in eitherscalar,1d Arrayor2D Array form. 13

Dataflow Programming LabVIEW follows a dataflow model for running VIs. A block diagram node executes when all its inputs are available. When a node completes execution, it supplies data to its output terminals and passes the output data to the next node in the dataflow path. Visual Basic, C++, JAVA, and most other text-based programming languages follow a control flow model of program execution. In control flow, the sequential order of program elements determines the execution order of a program. For a dataflow programming example, consider a block diagram that adds two numbers and then subtracts 50.00 from the result of the addition. In this case, the block diagram executes from left to right, not because the objects are placed in that order, but because the Subtract function cannot execute until the Add function finishes executing and passes the data to the Subtract function. Remember that a node executes only when data are available at all of its input terminals, and it supplies data to its output terminals only when it finishes execution. In the following example, consider which code segment would execute first the Add, Random Number, or Divide function. You cannot know because inputs to the Add and Divide functions are available at the same time, and the Random Number function has no inputs. In a situation where one code segment must execute before another and no data dependency exists between the functions, use other programming methods, such as error clusters, to force the order of execution. 14

Help The Context Help window (Ctrl +H) displays basic information about LabVIEW objects when you move the cursor over each object. The Context Help window is visible by default. To toggle display of the Context Help window, select Help-Show Context Help, press the Ctrl-H keys, or click the Show Context Help Window button on the toolbar. When you move the cursor over front panel and block diagram objects, the Context Help window displays the icon for subvis, functions, constants, controls, and indicators, with wires attached to each terminal. When you move the cursor over dialog box options, the Context Help window displays descriptions of those options. In the window, required connections are bold, recommended connections are plain text, and optional connections are dimmed or do not appear. The Figure below shows an example of the Context Help window. 15

Exercises Exercise 1 (Convert C to F) Create VI that take a numeric value representing degrees Celsius and Convert it to degrees Fahrenheit. Exercise 2: Create a simple Calculator Create a simple calculator that Add and Subtract 2 numbers like this: Start the program with the Run button. 16

Exercise 3: Create a Thermometer with using a Selector (VI) Create a simple LabVIEW application (VI) with a Front Panel with some Controls and Indicators. Create the logic by connecting the Terminals on the Block Diagram. The Front Panel could look something like this: The Block Diagram could look something like this: Start the program with the Run button. 17

Exercise 4: Create a Temperature History monitoring using with While loop. Exercise 5: Create below VI Create a VI which its output is random number between 0-100 when a selector key is on and 0 when the selector key is off. Hints: Use Case Structure. 18

Source: Labview Basic introduction Course manual: http://www.unife.it/ing/informazione/sistemi-acquisizione-dati/manuale-diprogrammazione-labview/manuale-labview-8-0-inglese List of tutorials for LabVIEW http://labviewwiki.org/labview_tutorial Tutorial labview (upscale) http://www.upscale.utoronto.ca/generalinterest/labview.html 19