LabVIEW for Physicists 24 th October 2002 Ben Jeffery.

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.
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
LabVIEW and G Graphical Programming Language By: Ramtin Raji Kermani.
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
Room: Rapson Hall 54 Time: 4-5 PM.
Jeff Beltramo NHTI-Concord’s Community College FRC Team 1922.
1. 2 LabVIEW for FRC Doug Norman National Instruments January 6, 2012.
Developing User Interfaces with Event-driven Programming
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.
Virtual Instrumentation With LabVIEW. Course Goals Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build.
National Instruments Confidential. 2 LabVIEW Development Tips and Tricks Revealed Carl Ljungholm - LabVIEW Product Support Engineer Travis Hailey - LabVIEW.
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.
Virtual Instrumentation With LabVIEW
TIBCO Designer TIBCO BusinessWorks is a scalable, extensible, and easy to use integration platform that allows you to develop, deploy, and run integration.
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.
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.
Course contents 1.Labview basics – virtual instruments, data flow, palettes 2.Structures – for, while, case,... – editing techniques 3.Controls&Indicators.
Tips and Tricks to Speed LabVIEW Development Useful Nuggets to Save You Time ni.com/labviewzone.
LabView Basics The Fighting Pi Controls Group. About LabView LabView is a highly adaptable programming GUI (Graphic User Interface) LabView compiles the.
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
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.
Part I MVRT 2011 – 2012 Season Introduction to LabVIEW.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
Department of Electrical and Computer Engineering The Tektronix MSO4000 series of oscilloscopes are mixed-signal oscilloscopes that contain both digital.
Samuel Alberg Thrysøe, PhD, PostDoc, Kontakt info: Tlf:
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:
1 Extend is a simulation tool to create models quickly, with all the blocks you need and without even having to type an equation. You can use a series.
Digital Electronics and Computer Interfacing Tim Mewes 4. LabVIEW - Advanced.
An Overview of LabVIEW by: The Software User-Interface Group!
Lab 1 : Introduction to LabView 1 Southern Methodist University Bryan Rodriguez.
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.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
Introduction to LabVIEW. Overview Objectives Background Materials Procedure Report/Presentation Closing.
Week 3 Data Structures and Common Tools. Common Tools in Labview Automatic Tool Selector Using the Operating Tool Using the Positioning Tool to Select.
EE 200 Design Tools Laboratory 14
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.
Lesson 2: Introduction to Control programming using Labview
Chapter 5 SubVIs.
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
Structures- case, sequence, formula node
Introduction to LabVIEW
EET 2259 Unit 5 Loops Read Bishop, Sections 5.1 and 5.2.
EET 2259 Unit 2 Virtual Instruments
Presentation transcript:

LabVIEW for Physicists 24 th October 2002 Ben Jeffery

What is it? Laboratory Virtual Instrument Engineering Workbench. Development environment for the G language. Produced by National Instruments for all major operating systems. Originally developed for communication with lab devices. A really useful tool.

Why use LabVIEW? Easy to Learn - Intuitive. Easy to Use. No Syntax. Source code reads like schematic. Speed of development. Ready made controls for many instruments. Support. Easy and instant debugging. Power – Instant Parallel threads. No memory concerns. (Within Reason) As versatile as text-based languages. Fun. Honest!

Disadvantages: Cost £1000 minimum. Hard to master advanced techniques. Code can become an impenetrable mess if youre not careful! Creating highly customized applications can become time consuming.

The Language Building an application Front Panel Source Diagram Programming Structures Built-in Functions User Vis Tips Overview:

The G Language: Completely graphical programming language. Data travels along wires. Source code is a diagram of nodes and wires. Flow of data controls execution. Not flow of code! Position on diagram is irrelevant. Being an expert in C can be a disadvantage…

A New Way of Thinking: DataflowNOTCodeflow UnlockCAL(HeaterMat); GetTempCAL(HeaterMat); SetTempCAL(HeaterMat); LockCAL(HeaterMat); Guiding Principle: A node does not run until data sits at all its wired inputs. Data Dependency

Building an Application: Two parts to make: 1.Front Panel 2.Source Diagram Always start with the front panel. Draw a pencil block diagram of the main functions of the diagram. Make this diagram in G code. Done. Applications are called virtual instruments (VIs)

The Front Panel: Each item on the front panel has a corresponding node on the source diagram. Contains both controls and indicators. How the user interacts with G. Many ready made controls means quick and easy construction of simple front panels. There is scope for customisation of the controls but this is mainly cosmetic.

Controls are sources for data Indicators are sinks for data Controls and Indicators: Front panel objects are either controls or indicators. The corresponding nodes are identified as shown. Constants are sources for data that do not appear on the front panel Indicator Controls Constant

Making the Front Panel: The best way to show this is in LabVIEW: Use tab controls instead of cluttering the panel. Set limits on data entry to save programmatic checking. Keep to a consistent style. Dont go wild with the colours. Add text boxes when explanation is needed. Use schematic representation if a physical system is involved. Remember someone else might need to understand it in your absence! Tips:

Building the diagram: Double clicking any control on the front panel will take you to its node on the source diagram and vice-versa. Clicking window, show diagram (Ctrl-E) will also display the source diagram.

Building the diagram: Nodes are placed in a similar way to controls on the front panel. An extra tool is used on the source diagram: The Wiring Tool: The most used, and most infuriating tool in LabVIEW. Avoid crossing wires. Click to join nodes together:

Types of Node: Types of nodes: Indicators and Controls Functions: Built in Functions User VIs (sub-routines) Structures All have one or more terminals that usually only accept one data type.

Types of Wire: Usual data types: 8,16,32 bit Integers (Signed and Unsigned) Single, Double and Extended floating point Complex Boolean String Arrays Clusters (Combination of any above) As terminals accept only defined data types, so wires have defined types. This is indicated by colour and style.

Program Control: Run Once: Program executes until all data is sunk. Run Continuously: Run Once occurs repeatedly. Abort Execution: Immediate halt. Pause Execution: Useful for debugging.

Lets see some LabVIEW Well start with a simple example to get a feel for programming in LabVIEW:

A Closer Look Weve covered most of the basics of the environment. Now lets look at methods and techniques of programming. Structures Built In Functions User Vis Clusters Programming Tips

Structures: How you control data flow Case Structure While Loop (with shift registers) For Loop Sequence Formula Node Events Structure Understanding the operation of these is vital.

Case: Similar to the Case statement in C Contains one or more frames. The frame that executes depends on what is wired to the selection terminal. Many data types can be wired to the selector. Lets see it in LabVIEW:

While: Similar to the While statement in C Contains one frame that is repeated Test for continuance is performed after execution so frame always executes once. i terminal gives number of current iteration (first frame is 0) stop terminal can be continue if true or stop if true selected from context menu.

Shift Registers: Selected via right-clicking the frame. Enables the result of an iteration to be passed to the next iteration. Can be used for any data type The results of older iterations can be accessed by making the left terminal larger. The initial value is set by wiring to the left terminal and the final iterations value is output at the right terminal. Results are kept between runs of a vi.

For Loop: Similar to the while loop but is executed a set number of times (wired to the N terminal) If 0 is wired to the terminal the frame does not run, do outputs will be invalid. Input arrays can be indexed automatically and if N is not wired the number of iterations will be the size of the largest input array. Shift registers can also be used here.

Sequence: Used to order events where no data dependency exists. Can have more than one frame but this should ALWAYS be avoided. (Like goto in C)

Formula Node: Used to avoid large numbers of arithmetic functions Has one or more inputs and outputs Uses C type syntax

Event Structure: Handles windows events Used for customisation of user interface Allows very fancy tricks! LabVIEW 6.1 only

Built in Functions: Over 100 built in functions Use the context help window to find what you need.

Built in Functions: Low Level Boolean Logic Arithmetic Comparisons These functions accept different data types and often arrays can be directly wired. Mid Level Array Manipulation (Transpose, interpolate, subset...) String Manipulation (Search, format, replace...) Time and Date

High Level File I/O Device communication (GPIB, serial etc…) Network communication (TCP, UDP, IrDA) Waveform manipulation (FFT, Filters, Analysis) Math Sound and Graphics Program Control Advanced: Semaphores, Queues, Occurrences. Built in Functions: So check before you build your own

User Vis: For often used routines or to prevent an excess of code on your diagram create a user vi Create the vi as if it were a stand alone program Right click the icon to access the wiring and icon menu. Show connector and select a pattern of terminals and then use the wiring tool to select controls and indicators to be terminals. Edit the icon Place the vi where you need it using select a vi off the function pallet. Lets see that in LabVIEW:

Clusters: Collection of one or more items of data Best used as Named Clusters In this way you can carry related data in one wire and extract only the data you need when you need it. Also reduces the need for many terminals in a user vi.

The Error Cluster: LabVIEW standard, used in many built in VIs Boolean Int String Passed along to each vi. If status is true the vi does not run as the preceding one gave an error. Lets illustrate this with an example:

Programming Tips: Use a left to right layout Use named clusters for both neatness and ease of variable selection. If functions need to happen in a sequence establish a data dependency, so that the functions are connected in a chain. This is easily done using the error cluster. Remember that functions not connected and in the same frame will run in parallel. Make user VIs so that your code is modular. Experiment