Tips Tricks and Techniques for Efficient LabVIEW Development

Presented by Nick Golas Telephonics Corp.

IEEE I&M Society LI Section & Long Island LabVIEW Users Group (LILUG) Thursday 12/06/2007

Use the Right Tool Automatically
Use the Automatic Tool Selection in the Tools Palette to avoid manually switching among many tools
Operate Value Tool Position/Size/Select Tool Edit Text Tool Connect Wire Tool Automatic Tool Selection Tools Palette

Access the Tools Palette Quickly
Hold the <Shift> key and right-click to display a temporary version of the Tools Palette at the location of the cursor

5.Easily Scroll Through Structures You can use Ctrl + Mouse Scroll to scroll through: Case Structures Event Structures Stacked Sequence Structures Diagram Disable Structures Filename: Easily Scroll Through Structures LV8.vi Ctrl + Mouse Scroll Wheel .

Use Commas to Separate Values All Values Less or Equal to 4 All Values Greater or Equal to 4 20 and all values that are not set in other cases 20.20 -1. Default .3.. All Numbers from 1 through 20 Inclusively -1.4 4.8 .Case Structure with Integer Selector Using the Labeling tool enter a single value or lists and ranges of values in the case selector label Some Examples: Numeric Range Lists Open-ended Ranges Default 1.3 and 8...

vi .5 Example Build String.Retain Wire Data Values in Wires Select Retain Wire Values on the toolbar to have LabVIEW store the last data item that flowed through any wire in the VI Use the Probe Data tool available on the Tools Palette to click on the wire of interest and obtain the last value through Filename: LV 8.

Quickly Find the Right Palette Right-click on an object in the block diagram to get its palette shortcut .

vi . select Advanced >> Show Last Element Both horizontal and vertical scrollbars available (depending on view) Filename: Navigate Arrays LV8.5.Navigate Large Arrays Easily Right-click on an array and select Visible Items >> Horizontal Scrollbar To view last element.

Drag and Drop to Save Time Drag an image into your VI icon Select a file and drag into a path constant Take a URL from Internet Explorer and drag into a string constant Drag items from disk or Project Explorer into a LabVIEW block diagram .

20 or later Check If File or Folder Exists Recursive File List Get File Extension Compare Two Paths Checks whether a file or folder exists Obtain a listing of files and folders in a directory or LLB Retrieve the file extension of a file you specify Get the relative path from one file to the next Create unique file path in the temporary directory Generate Temporary File Path MD5 Checksum File Compute the MD5 message-digest of a file .Utilize Advanced File I/O Functions Note: These New File I/O VIs are available in LabVIEW 8.

Demystify the LabVIEW Color Picker Part I Grayscale Earth Tones/Muted Highlights Transparent More Colors Grayscale Bar – Select pure black. one or two per panel to help draw attention to small objects Transparent . pure white.Colors for medium to large size objects Highlight Bar – Used these colors sparingly.Select a specific color using the color utility on the operating system . or any shade of gray in between.make front panel objects transparent to layer multiple controls and indicators so that they appear in the same place when a user selects a particular option More Colors . Good choice for panel backgrounds Earth Tones/Muted Bar .

Demystify the LabVIEW Color Picker Part II User Row History Row Currently Selected Color System Colors RGB Color Wheel User Row – Contains colors that you can define in Tools>>Options. Handy if you want to use the same RGB colors frequently History Row – Helps you re-use colors that you selected recently System Colors – Allows you to set the appearance of a front panel to match the system colors of any computer that runs the VI Currently Selected Color – Displays the currently selected color.To the right of that it either displays the RGB value or the name for User colors and System colors that is the Currently Selected Color . Objects that have foreground and background colors display the foreground color in the left half of this box and the background color in the right half RGB Color Wheel .

." on the VI's toolbar..5. On the Resize Objects ring choose the "Set Width and Height. which allows you to change the width and height or both of the selected objects On the Distribute Objects ring select the Vertical Centers option to distribute the objects evenly on the Front Panel Filename: Resize LV8. The Resize Objects dialog box appears.Be Precise: Resize Objects Dialog Box On the Front Panel select all objects you want to resize using the position/size/select tool or use <Ctrl-A> in LabVIEW 8.vi .0 or later.

0) Apply consistent fonts and capitalization Maximize the contrast between text color and background color .Design/Architecture – Main & SubVIs Code should not use more than one screen Arrange controls to resemble the connector assignments Use the 4x2x2x4 connector to pass data between VIs (default connector pane starting with LabVIEW 8.

Switch Terminal Wires Easily Using the ‘Switcheroo’ Tool Hold Down Ctrl and Left-Click on Input Terminal Filename: Switcheroo LV7.vi Note: This works only for functions with two inputs when both inputs have already been wired and when using the Auto Tool or Wiring Tool .1.

0 or later .exe Version and VI Path in the VI Title Bar If you are working with multiple versions of LabVIEW place the following line in your LabVIEW.exe Version and the path to the current VI in the VI Title Bar Note: Works in LabVIEW 8.Display the LabVIEW.INI file to identify the version currently used: showExePathInWindowTitle=True It will display the LabVIEW.

vi Note: Works in LabVIEW 8.0 or later .0. you can use defaultConPane=-1 Filename: Determine Connector Pane Pattern LV8.vi If you prefer the LabVIEW 7.0 which is 4x2x2x4 to 5x2x2x2x5 place the following line in your LabVIEW. where the pattern is auto selected to match the number of front panel controls/indicators.x and earlier behavior.0.Change the Default Connector Pane in LabVIEW If you need to change the default con pane for LabVIEW 8.INI file: defaultConPane=4833 The number inside the brackets represents the value obtained from the VI: Determine Connector Pane Pattern LV8.

5 Select the new ‘Connector pane terminals default to Required’ option in Tools >> Options… This option sets new terminals connected on any VI's connector pane to Required (except error controls) instead of Recommended.Connector Pane Terminals Default to Required in LabVIEW 8.vi .5. This applies to connections made using the wiring tool and to subVIs created using Create SubVI. Filename: Connector Pane terminals default to Required in LV8.

vi Note: Works in LabVIEW 8.5.Remove Many Breakpoints Select Edit >> Remove Breakpoints from Hierarchy A Breakpoint Removal Summary will display all breakpoints removed Great tool for removing all breakpoints after debugging a section of code Filename: Write-Read Text File LV8.2 or later .

Add Enumeration Items Easily Press Ctrl while over Enum and click inside in order to use the Edit Text Tool Use Shift + Enter to repeatedly add items This convenient trick also works for Rings Shift + Enter .

INI file to identify the version currently used: MRUFolders=True Access to the last 5 directories used in LabVIEW conveniently Note 1: Works in LabVIEW 8.Change the Windows File Dialog (to contain recently used folders in LabVIEW) Add the following line in your LabVIEW.2 or later Note 2: Overrides TweakUI settings .

Quickly Open a VI Reference (next to current VI on disk) LabVIEW automatically looks in the current directory Right-click on VI and select Call Setup to call it dynamically Call Setup Good Better Note: Works in LabVIEW 8.0 or later Best Note: This method requires a path constant. .

vi .Implement a For Loop Progress Bar Place Progress Bar VI inside a For Loop Opens automatically after a specified amount of time Filename: For Loop Progress Bar LV7.0.

Close LabVIEW Programmatically if EXE Use Filename: Close LabVIEW ONLY When EXE LV7.1.vi .

Automatically returns to the tool you were using before you selected the Color Copy tool. TIP: To draw horizontal or vertical lines. Fill — Fills an outlined area with the foreground color Rectangle — Draws a rectangular border in the foreground color. TIP: Double-click this tool to frame the icon in the foreground color Filled Rectangle — Draws a rectangle with a foreground color frame and filled with the background color. Click each rectangle to access a color picker from which you can select new colors to use . Line — Draws straight lines. press the <Shift> key while you use this tool to drag the cursor. TIP: Double-click this tool to select a different font. copy. press the <Shift> key while you use this tool to drag the cursor Color Copy — Copies the foreground color from an element in the icon. and diagonal lines. TIP: Double-click this tool to frame the icon in the foreground color and fill it with the background color Select — Selects an area of the icon to cut. TIP: To draw horizontal. TIP: While still typing and before selecting another tool you can move the text around pixel by pixelby pressing the arrow keys Foreground/Background — Displays the current foreground and background colors.Icon Tips Part I Icon Editor Tools Pencil — Draws and erases pixel by pixel. TIP: Double-click this tool and press the <Delete> key to delete the entire icon Text — Enters text into the icon. vertical. or make other changes. move.

Icon Tips Part II Select the SMALL FONTS font & use CAPS with size 8. control) into the Icon Editor and have it automatically resized to fit area set Holding down the <Ctrl> key will switch to the Color Copy (Eyedropper) selection tool Copy an image to a VI icon by dragging the image file and place it on the icon located in the upper right corner of the Front Panel or Block Diagram . Fit up to 4 lines of text After selecting a rectangle area on the icon paste anything from the clipboard (image. text.

and applications Sample Icons from NI’s Icon Library Collection . toolbars.htm This resource offers you a selection of over 500 pre-made icons that you can download and use for free in your own VIs.Icon Tips Part III National Instruments Icon Library http://www.ni.com/devzone/idnet/library/icon_art_glossary.

and Red Red indicates alarm or emergency Yellow indicates caution or warning Green indicates normal operating conditions . Yellow.Abide by Universal Conventions for Green.

Close Reference now accepts a 1D array of references LabVIEW 8.2 • In LabVIEW 8.LabVIEW 8. you must close multiple references in a For Loop LabVIEW 8.5.5 .5 .Close Arrays of References • In LabVIEW 8.2.

Merge Two VIs • Track changes made to a base VI (Tools >> Merge VIs) • Interactively decide which changes to incorporate .5 .LabVIEW 8.

LabVIEW 8.5 .For Loop with Break LabVIEW 8.5 .2 Run a fixed number of times or until a condition is met LabVIEW 8.

Disables preset alignment positions when moving object labels or Disables preset alignment positions when moving object labels or captions. Performs last distribution operation on objects. Selects multiple objects. Adds a free label to the front panel or block diagram if automatic Adds a free label to the front panel or block diagram if automatic tool selection is enabled. Ctrl-drag a rectangle Selects front panel block diagram items. or Stacked Sequence structure. Moves selected objects one axis. Ctrl-Shift-click (drag)Duplicates selected object and moves it it inin one axis. Ctrl-A Ctrl-Shift-A Ctrl-Shift-A Ctrl-D Ctrl-D Double-click open Double-click open space space Ctrl-mouse wheel Ctrl-mouse wheel Spacebar (drag) Spacebar (drag) Performs last alignment operation on objects. Ctrl-A Selects allall front panel oror block diagram items. Event. Resizes selected object while maintaining center point. Sequence structure. ratio. Performs last alignment operation on objects. Ctrl-click (drag) Duplicates selected object. Ctrl-Shift-click (drag) Shift-resize Shift-resize Ctrl-resize Ctrl-resize Ctrl-Shift-resize Ctrl-Shift-resize Resizes selected object while maintaining aspect ratio. Adds more working space the front panel or block diagram. Scrolls through subdiagrams of a Case. Performs last distribution operation on objects. . adds object toto current selection. Resizes selected object while maintaining aspect ratio. or Stacked Scrolls through subdiagrams of a Case. Moves selected objects inin one axis. Duplicates selected object. Ctrl-drag a rectangle Adds more working space toto the front panel or block diagram. Resizes selected object while maintaining center point. Resizes selected object while maintaining center point and aspect Resizes selected object while maintaining center point and aspect ratio. Event. Moves selected objects several pixels time.LabVIEW Keyboard Shortcuts Object/Movement Object/Movement Execution Execution Shift-click Shift-click Arrow keys Arrow keys Shift-Arrow keys Shift-Arrow keys Shift-click (drag) Shift-click (drag) Selects multiple objects. Moves selected objects one pixel atat aa time. captions. tool selection is enabled. Ctrl-click (drag) Duplicates selected object and moves one axis. Moves selected objects several pixels atat aa time. adds object current selection. Moves selected objects one pixel time.

Displays the subVIs and other nodes that make up the VI you select in the VI Hierarchy window. Prints the window. Steps over node. Displays Search Results window or the Find Project Items dialog box with the previous search results. Enter Shift-Enter Navigating Front Panels and Block Diagrams Ctrl-E Ctrl-# Ctrl-/ Ctrl-T Ctrl-Shift-N Ctrl-I Ctrl-Y Displays block diagram or front panel window. Displays the History window. Tiles front panel and block diagram windows. Opens an existing VI. Quits LabVIEW. blank VI. Saves the VI. Navigating the VI Hierarchy Window Ctrl-D Ctrl-A Ctrl-click VI Redraws the VI Hierarchy window. File Operations Ctrl-N Ctrl-O Ctrl-W Ctrl-S Ctrl-Shift-S Ctrl-P Ctrl-Q Opens a new. Displays the Navigation window. Cycles through LabVIEW windows in the order the windows appear onscreen. Displays the All Windows dialog box. Enables or disables grid alignment. Maximizes and restores window. Finds the next node that matches the search string after initiating a search by typing in the VI Hierarchy window. Shows all VIs in the VI Hierarchy window. Finds the previous node that matches the search string after initiating a search by typing in the VI Hierarchy window. Cycles the opposite direction through LabVIEW windows.LabVIEW Keyboard Shortcuts Navigating the LabVIEW Environment Ctrl-F Ctrl-Shift-F Ctrl-G Ctrl-Shift-G Ctrl-Tab Ctrl-Shift-Tab Ctrl-L Ctrl-Shift-W Finds objects or text. Searches for next instance of object or text. Searches for previous instance of VIs. Displays the VI Properties dialog box. Saves all open files. object. Steps out of node. Debug CtrlCtrlCtrlSteps into node. Displays the Error List window. or text. . Closes the VI.

Navigates into a temporary palette. Moves key focus inside an array or cluster. Navigates the controls or indicators according to tabbing order. SubVIs Double-click subVI Ctrl-doubleclick subVI Drag VI icon to block diagram Shift-drag VI icon to block diagram Ctrl-rightclick block diagram and select VI from palette Displays subVI front panel.LabVIEW Keyboard Shortcuts Tools and Palettes Ctrl Shift Ctrl-Shift over open space Spacebar Shift-Tab Tab Arrow keys Enter Esc Shift-rightclick Switches to next most useful tool. Cuts an object. Pastes an object. Basic Editing Ctrl-Z Ctrl-Shift-Z Ctrl-X Ctrl-C Ctrl-V Undoes last action. Toggles between two most common tools if automatic tool selection is disabled. when used while VI is running. Shift-Tab . when used while VI is running. Displays subVI block diagram and front panel. Navigates out of a temporary palette.Shift-L Ctrl. Enables automatic tool selection. Navigates backward through the controls or indicators. Ctrl-Up arrow Tab Opens front panel of that VI. Cycles through four most common tools if you disabled automatic tool selection by clicking the Automatic Tool Selection button. Ctrl-M Ctrl-Run button Runs the VI. Redoes last action. Otherwise. when used while VI is running. Changes to run or edit mode. Help Ctrl-H Ctrl. when used while VI is running. Displays a temporary version of the Tools palette at the location of the cursor. Switches to Scrolling tool. Ctrl-Shift-Run button Ctrl-Down arrow Places that VI as a subVI on the block diagram with constants wired for controls that have non-default values. Execution Ctrl-R Ctrl-. Switches to Positioning tool. Places that VI as a subVI on the block diagram. when used while VI is running. Displays LabVIEW Help. Copies an object. Stops the VI. Recompiles the current VI.? or <F1> Displays Context Help window Locks Context Help window. Moves key focus outside an array or cluster. Recompiles all VIs in memory. enables automatic tool selection. Navigates temporary Controls and Functions palettes.

such as Western character sets. Wiring Ctrl-B Esc. Selects entire wire. Changes to the current font in the Font dialog box. ring controls and constants. press the <Shift-Enter> keys on the keyboard to disable autosizing if it is enabled. In string constants. Moves forward in string by one word when using text that has characters that use single bytes. function with two inputs Spacebar Switches the direction of a wire between horizontal and vertical. Moves backward in string by one word when using text that has characters that use single bytes. disables automatic wire routing temporarily. Cancels current edit in a string. Tacks down wire without connecting it. or Case structures. Ctrl-Left arrow Home End Ctrl-Home Ctrl-End Cancels a wire you started. such as Western character sets. Changes to the Dialog font in the Font dialog box. Moves to beginning of entire string. If autosizing is disabled. Adds new items when entering items in enumerated type controls and constants. Selects a branch. Moves backward in string by one character when using text that has characters that use multiple bytes. Shift-Enter Esc Ctrl-Enter Fonts Ctrl-= Ctrl-Ctrl-0 Ctrl-1 Ctrl-2 Ctrl-3 Ctrl-4 Increases the current font size. Selects an entire string. or click terminal Single-click wire Double-click wire Triple-click wire A Double-click (while wiring) Spacebar Shift-click Deletes all broken wires in a VI. Moves to beginning of current line in string. Displays the Font dialog box. Moves to end of current line in string. While wiring. Selects one segment. Changes to the System font in the Font dialog box. Changes to the Application font in Font dialog box.LabVIEW Keyboard Shortcuts Text Double-click Triple-click Ctrl-Right arrow Selects a single word in a string. Ends text entry. press the <ShiftEnter> keys on the keyboard to display a scroll bar in the constant. rightclick. Toggles automatic wiring while moving objects. such as Asian character sets. Ctrl-click input on Switches the two input wires [‘Switcheroo’ Function]. Decreases the current font size. Moves forward in string by one character when using text that has characters that use multiple bytes. such as Asian character sets. . Undoes last point where you set a wire. Moves to end of entire string.

ni.com/devzone/cda/tut/p/id/4434 .LabVIEW Resources & Bibliography Weekly LabVIEW Nuggets http://ni.lavag.com/forums and search for “nuggets” LAVA: Favorite Tips and Shortcuts http://forums.org LabVIEW Style Guide http://zone.

php LabVIEW Wiki http://wiki.com/Pages/designer.org .com/ BetterVIEW .lavag.org/blog/pjm_labview/index.Interface Designer's Workshop http://www.LabVIEW Resources & Bibliography Christina's Eyes on VIs Blog http://eyesonvis.blogspot.lavag.bettervi.html G'ossip in G'enerality Blog http://forums.

(2006) ISBN: 0131856723 .LabVIEW Resources & Bibliography Title: The LabVIEW Style Book Author: Peter A. 3rd ed. 1st ed. (2007) ISBN: 0131458353 Buy the PDF eBook its in COLOR the book is NOT Title: LabVIEW for Everyone: Graphical Programming Made Easy and Fun Author: Jeffrey Travis. Blume Publisher: Prentice Hall PTR. Jim Kring Publisher: Prentice Hall PTR.

Instrumentation & Measurement Society page www.aleconsultants.li ALE System Integration website User Group page www.com .Viewgraphs & Examples The Viewgraphs and Examples of the presentation will be available in a few days at: IEEE Long Island Section website.ieee.

Sign up to vote on this title
UsefulNot useful