National Instruments Confidential. 2 LabVIEW Development Tips and Tricks Revealed Carl Ljungholm - LabVIEW Product Support Engineer Travis Hailey - LabVIEW.

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 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.
LabView Academy 5. óra. Témakörök SubVI Modularitás Icon Connector Pane.
Lesson 2 Navigating LabVIEW
Based on LabVIEW 2011 Student Edition
TP4: S TATE M ACHINE D ESIGN P ATTERN  Definition  Infrastructure  Transition Code  Conclusion.
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.
Computing Fundamentals Module Lesson 5 — File Management with Windows Explorer Computer Literacy BASICS.
Foundation Level Course
Developing User Interfaces with Event-driven Programming
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.
Create slices and hotspots Create links in Web pages Create rollovers from slices Create basic animation Add tweening symbol instances to create animation.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
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 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.
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.
Course contents 1.Labview basics – virtual instruments, data flow, palettes 2.Structures – for, while, case,... – editing techniques 3.Controls&Indicators.
Introduction to Basic LabVIEW Design Patterns
Chapter 4 Code Editor Goals and Objectives Program more efficiently? How can you speed up your development process? Do you want to learn useful shortcuts.
Virtual Instrumentation With LabVIEW. Section I LabVIEW terms Components of a LabVIEW application LabVIEW programming tools Creating an application in.
Tips and Tricks to Speed LabVIEW Development Useful Nuggets to Save You Time ni.com/labviewzone.
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
6 Copyright © 2004, Oracle. All rights reserved. Working with Data Blocks and Frames.
Biomedical Measurements & Analysis using LabVIEW
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
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.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Part I MVRT 2011 – 2012 Season Introduction to LabVIEW.
LabView instrumentoinnissa, 55492, 3op Labview in instrumentation Lecturer: Heikki Ojala, room C204a
LabVIEW – 2 Windows ► Front Panel- User Interface ► Block Diagram- Programming View.
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.
Computing Fundamentals Module Lesson 10 — File Management with Windows Explorer Computer Literacy BASICS.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
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.
CS320n –Visual Programming More LabVIEW Foundations.
Workshop 2 of 4 Welcome!. Survey While You Wait ni.com/duke >> Recent Documents >> LabVIEW Workshop Participation Survey.
LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs 參考 NI 官方教材: LabVIEW Intermediate II for 7.
Digital Electronics and Computer Interfacing Tim Mewes 2. LabVIEW Basics part II.
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.
LabVIEW Core 1 Key messages for the instructor:
EET 2259 Unit 3 Editing and Debugging VIs
“Optimize Your VI Performance”
Course Learning Map Lesson # Lesson Title Lesson 3 Lesson 2 Lesson 1
EET 2259 Unit 3 Editing and Debugging VIs
Presentation transcript:

National Instruments Confidential

2 LabVIEW Development Tips and Tricks Revealed Carl Ljungholm - LabVIEW Product Support Engineer Travis Hailey - LabVIEW Product Support Engineer

National Instruments Confidential Challenge Starting with an existing VI Add TCP communication

National Instruments Confidential Challenge Starting with an existing VI Add TCP communication How much time will it take??

National Instruments Confidential Merge VIs Reuse common pieces of code VIs on Functions palette can be configured to be merged when dropped Enabled by customizing palette Example: Dropping a Wait Until Next ms Multiple with delay already wired

National Instruments Confidential LabVIEW Development Tips and Tricks Program Architecture Building Applications Debugging Memory Management Performance Miscellaneous

7National Instruments Confidential Program Architecture

National Instruments Confidential Program Architecture - General Separate time-critical code from UI updates and data transfer Use templates from the New dialog –Producer/Consumer (Data) –Master/Slave Use subVIs! –Easier to test/debug –Can use VI Profiler

National Instruments Confidential Functional Global Variables Uninitialized shift registers store values Use in subVI to retain data between calls FGV can store data or be more complex –Enum input controls action Read or Write Initialize, Write, Close

National Instruments Confidential Databases (One-Element Queue) A queue containing one element can serve the same purpose Allows multiple subVIs with different connector panes to use same data Queue acts as a semaphore

11National Instruments Confidential Building Applications

National Instruments Confidential Passing Command Line Arguments Command line arguments can be passed to LabVIEW Use – (two dashes) to mark beginning of user arguments Read arguments using Application property For an executable all arguments can be passed to the VI –Option in Application Builder Application.Command Line Arguments

National Instruments Confidential Stripping Paths

14National Instruments Confidential Debugging

National Instruments Confidential Custom Probe Use your own indicator for probes –Can have a break condition –Can contain code Right-click wire and choose Custom Probe>New

National Instruments Confidential History Probe Combining custom probes and functional global variables gives a history probe Past values stored in shift register Display past values, calculate min/max/average

17National Instruments Confidential Memory Management

National Instruments Confidential Memory Management - General LabVIEW handles memory management automatically –You do not need to code when to allocate or deallocate memory –You have less control over when memory operations occur Performance can be improved by paying attention to memory

National Instruments Confidential Finding Memory Allocations Use to avoid unnecessary memory copies Shows a dot where memory is allocated Tools>Advanced>Show Buffer Allocations Can NOT remove all allocations

National Instruments Confidential The “Inplace” Algorithm A pass in the compilation of a VI where LabVIEW can discover opportunities to re-use a data allocation Rules: –LabVIEW is “by value” semantics –The data value at the source of a signal is always delivered to every destination –Many nodes in LabVIEW are natively “inplace”: they will modify the location of their input to produce their output –If the value on the input is no longer needed by other nodes, its location can contain the new value –If the value is still needed, a copy is made –The nodes of the diagram are “ordered” as this algorithm runs

National Instruments Confidential Hiding the Dots with Inplaceness (Avoiding memory allocations) Inplaceness allows reuse of memory Occurs when – Input and output have same datatype and size – Overwritten data is not needed Replace Array Subset is inplace Build Array is not inplace Use shift registers

National Instruments Confidential Wiring a Call Library Function The way you wire to a Call Library Function tells LabVIEW how to handle the data InputOutputInterpretation YesNoData not modified by DLL NoYesData allocated by DLL Yes Data allocated by LabVIEW and modified by DLL

23National Instruments Confidential Performance

National Instruments Confidential Improving SubVI Performance Inputs are marked as required –More efficient since new inputs always provided Terminals are outside of structure –New output data always provided –No need to reread controls Inplaceness is used between input and output terminals –Allows inplaceness in parent VI –Inplaceness can traverse hierarchy

National Instruments Confidential Performance Effects of Property Nodes Control and indicator property nodes are slow –Control properties require a thread swap to the UI thread to execute –Property nodes can not run in parallel –Many will force UI updates on completion of that node Write many properties with one node, or defer panel updates

National Instruments Confidential Do I have VI documentation? Do I have avoidable Coercion Dots? Do I have Debugging Enabled? Do I have Waits in While loops? Did I leave any Breakpoints? Do I have clean and forward Wiring? Are my VIs locked or Password protected? Do I have Wires under objects? Do I have Error Handling? Do I have Hidden Objects in my Structures? Do I have Default Icons? Do I have Broken VIs? VI Analyzer Checks Your Code 58 different tests !!

National Instruments Confidential VI Analyzer Checks Your Code Improve the overall quality/reliability of VIs Encourage good programming practices (documentation, etc.) Reduce code maintenance time by quickly finding stylistic and functional problems View results through interactive interface or in text- based format (HTML, ASCII)

28National Instruments Confidential Miscellaneous

National Instruments Confidential Custom Shaped SubVIs Make subVI icons smaller Leave white space in icon for all three color depths Example: –Probe error cluster –Clear error

National Instruments Confidential CTRL and Mouse Tricks Hold down the CTRL key and… Double-click subVI to open block diagram Drag a rectangle to create space Click terminal of two-terminal primitive to swap wires Shift+Ctrl to get Scroll tool and pane diagram or front panel Use scrollwheel on a case structure to scroll through cases Access second most useful tool with AutoTool More shorcuts in the online help – search for “Keyboard Shortcuts”

National Instruments Confidential Can You Do This? Get the strings of an enum? (with out VI Server) Sort clusters? Merge Errors (no subVI)?

National Instruments Confidential Want Additional Tips??? LabVIEW Help contains many tips In particular…

National Instruments Confidential Additional Resources LabVIEW Performance and Memory Management App NoteLabVIEW Performance and Memory Management The Need for Speed, vol 7, number 4 ( Managing Large Data Sets in LabVIEW Optimizing LabVIEW Applications II LabVIEW Development Guidelines, Ch 6, LabVIEW Style Guide, describes good VI design and implementation practices LabVIEW Books