Skip to content Skip to navigation

OpenStax-CNX

You are here: Home » Content » LabVIEW Environment

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • NSF Partnership display tagshide tags

    This module is included inLens: NSF Partnership in Signal Processing
    By: Sidney BurrusAs a part of collection: "LabVIEW Graphical Programming Course"

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • National Instruments display tagshide tags

    This module is included in aLens by: National InstrumentsAs a part of collection: "LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module is included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

  • eScience, eResearch and Computational Problem Solving

    This module is included inLens: eScience, eResearch and Computational Problem Solving
    By: Jan E. OdegardAs a part of collection: "LabVIEW Graphical Programming Course"

    Click the "eScience, eResearch and Computational Problem Solving" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

LabVIEW Environment

Module by: National Instruments. E-mail the author

Summary: In this section, you will learn about the LabVIEW environment.

When you launch LabVIEW, the navigation dialog box appears that includes introductory material and common commands.

Figure 1: LabVIEW Dialog Box
Figure 1 (LabVIEWdialogbox.png)

The LabVIEW dialog box includes the following components:

  • A menu with standard items such as File>>Exit.
  • A set of buttons for creating and opening VIs, configuring data acquisition devices, and finding helpful information.
    • Click the New button to create a new VI. Click the arrow on the New button to choose to open a blank VI or to open the New dialog box.
    • Click the Open button to open an existing VI. Click the arrow on the Open button to open recent files.
    • Click the Configure button to configure your data acquisition devices. Click the arrow on the Configure button to configure LabVIEW.
    • Click the Help button to launch the LabVIEW Help. Click the arrow on the Help button for other Help options, including the NI Example Finder.

Creating and Saving a VI

When you click the New button in the LabVIEW dialog box, the New dialog box appears. You also can select File>>New to display this dialog box. When you select a template in the Create new list, previews of the VI appear in the Front panel preview and the Block diagram preview sections, and a description of the template appears in the Description section. Figure 2 shows the New dialog box and the SubVI with Error Handling VI template.

Figure 2: New Dialog Box
Figure 2 (newdialogbox.png)

Click the OK button to open the template. You also can double-click the name of the template VI in the Create new list to open the template. If no template is available for the task you want to create, you can start with a blank VI and create a VI to accomplish the specific task. In the LabVIEW dialog box, click the arrow on the New button and select Blank VI from the shortcut menu or press the Ctrl-N keys to open a blank VI.

note:

You also can open a blank VI by selecting Blank VI from the Create new list in the New dialog box or by selecting File>>New VI.

Open/Templates

Use the New dialog box to create different components in LabVIEW to help you build an application. You can start with a blank VI to write a VI from scratch, or start with a template to simplify the programming. The New dialog box includes the following components:

  • Create new: Displays templates you can use to start building VIs and other LabVIEW documents. Select from the following templates and click the OK button to start building a VI or other LabVIEW document.
    • Blank VI: Opens a blank front panel and blank block diagram.
    • VI from Template: Opens a front panel and block diagram with components you need to build different types of VIs.
    • Other Document Types: Opens the tools you use to build other LabVIEW objects.
  • Browse for Template: Displays the Browse dialog box so you can navigate to a VI, control, or template. If you previously have browsed for and selected a template from this dialog box, use the pull-down menu of the Browse button to select a template to reopen it.
  • Front panel preview: Displays the front panel for the VI template you selected in the Create new list.
  • Block diagram preview: Displays the block diagram for the VI template you selected in the Create new list.
  • Description: Displays a description of the template you selected in the Create new list if the template includes a description.

Opening an Existing VI

You load a VI into memory by selecting File>>Open. In the Choose the VI to open dialog box that appears, navigate to the VI you want to open.

The VIs you edit in this course are located in the C:\Exercises\LabVIEW Basics I directory.

As the VI loads, a status dialog box similar to Figure 3 might appear.

Figure 3
Figure 3 (loading.png)

The Loading section lists the subVIs of the VI as they are loaded into memory. Number Loaded is the number of subVIs loaded into memory so far. You can cancel the load at any time by clicking the Stop button.

If LabVIEW cannot immediately locate a subVI, it begins searching through all directories specified by the VI Search Path. You can edit the VI Search Path by selecting Tools>>Options and selecting Paths from the top pull-down menu. The Searching section lists directories or VIs as LabVIEW searches through them. You can have LabVIEW ignore a subVI by clicking the Ignore SubVI button, or you can click the Browse button to search for the missing subVI.

Saving VIs

Select Save, Save As, Save All, or Save with Options from the File menu to save VIs as individual files or group several VIs together and save them in a VI library. VI library files end with the extension .llb. National Instruments recommends that you save VIs as individual files, organized in directories, especially if multiple developers are working on the same project.

LabVIEW uses the native file dialog boxes so they act similar to other applications on the computer. You can disable this feature by selecting Tools>>Options and selecting Miscellaneous from the top pull-down menu. If you disable native file dialogs, LabVIEW uses its own platform-independent file dialog boxes with some convenient features, such as providing a list of recent paths and reducing the steps necessary to save VIs in VI libraries.

Moving VIs Across Platforms

You can transfer VIs from one platform to another, such as from Mac OS to Windows. LabVIEW automatically translates and recompiles the VIs on the new platform.

Because VIs are files, you can use any file transfer method or utility to move VIs between platforms. You can port VIs over networks using FTP, Z or XModem protocols, or similar utilities. Such network transfers eliminate the need for additional file translation software. If you port VIs using magnetic media, such as floppy disks or a moveable external hard drive, you need a generic file transfer utility program, such as the following:

  • (Windows) MacDisk and TransferPro transfer Mac OS files to the PC format and vice versa.
  • (Mac OS) DOS Mounter, MacLink, and Apple File Exchange convert PC files to the Mac OS format and vice versa.
  • (Sun) PC File System (PCFS) converts PC files to the Sun format and vice versa.

note:

Certain operating system-specific VIs are not portable between platforms, such as DDE (Dynamic Data Exchange) VIs, ActiveX VIs, and AppleEvents.

Refer to the Porting and Localizing LabVIEW VIs Application Note, available by selecting Help>>Search the LabVIEW Bookshelf, for more information about porting VIs.

Menus

The menus at the top of a VI window contain items common to other applications, such as Open, Save, Copy, and Paste, and other items specific to LabVIEW. Some menu items also list shortcut key combinations.

(Mac OS) The menus appear at the top of the screen.

(Windows and UNIX) The menus display only the most recently used items by default. Click the arrows at the bottom of a menu to display all items. You can display all menu items by default by selecting Tools>>Options and selecting Miscellaneous from the top pull-down menu.

note:

Some menu items are unavailable while a VI is in run mode.
  • The File menu contains items used for basic file operations, such as opening, closing, saving, and printing files.
  • The Edit menu contains items that allow you to search for and modify LabVIEW files and their components.
  • The Operate menu contains items you use to control the operation of VIs.
  • The Tools menu contains items for configuring LabVIEW, your projects, and your VIs.
  • The Browse menu contains items that allow you to view aspects of the current VI and its hierarchy.
  • The Window menu contains items that allow you to configure the appearance of the current windows and palettes. You also can access the Error List window and view the contents of the clipboard.
  • The Help menu contains items to explain and define LabVIEW features and other components, provide full LabVIEW documentation, and access National Instruments technical support.

Front Panel and Block Diagram Windows

When you open a blank VI, an untitled front panel window appears. This window displays the front panel and is one of the two LabVIEW windows you use to build a VI. The other window contains the block diagram. The illustration in Figure 4 shows a front panel and its corresponding block diagram with front panel and block diagram components.

Figure 4: 1. Toolbar, 2. Owned Label, 3. Numeric Control, 4. Free Label, 5. Numeric Control Terminal, 6. Knob Terminal, 7. Numeric Constant, 8. Multiply Function, 9. Icon, 10. Knob Control, 11. Plot Legend, 12. XY Graph, 13. Wire Data Path, 14. XY Graph Terminal, 15. Bundle Function, 16. SubVI, 17. For Loop Structure
Figure 4 (usetemp.png)

Front Panel Toolbar

Use the toolbar buttons to run and edit a VI. The toolbar in Figure 5 appears on the front panel.

Figure 5
Figure 5 (fptoolbar.png)

run.png 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 subVI if you create a connector pane for the VI.

runtop.png 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 subVI.

runsubvi.png If the VI that is running is a subVI, the Run button appears as shown at left.

brokrun.png 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 lists all errors and warnings.

contrun.png 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.

abortexe.png 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 top-level 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.

pause.png Click the Pause button, shown at left, to pause a running VI. When you click the Pause button, LabVIEW highlights on the block diagram the location where you paused execution, and the Pause button appears red. Click the button again to continue running the VI.

font.png Select the Text Settings pull-down menu, shown at left, to change the font settings for the selected portions of the VI, including size, style, and color.

align.png Select the Align Objects pull-down menu, shown at left, to align objects along axes, including vertical, top edge, left, and so on.

distrbut.png Select the Distribute Objects pull-down menu, shown at left, to space objects evenly, including gaps, compression, and so on.

resizeobjects.png Select the Resize Objects pull-down menu, shown at left, to resize multiple front panel objects to the same size.

reorder.png Select the Reorder pull-down menu, shown at left, when you have objects that overlap each other and you want to define which one is in front or back of another. Select one of the objects with the Positioning tool and then select from Move Forward, Move Backward, Move To Front, and Move To Back.

helpbutton.png Select the Show Context Help Window button, shown at left, to toggle the display of the Context Help window.

enter.png Type appears to remind you that a new value is available to replace an old value. The Enter button disappears when you click it, press the Enter key, or click the front panel or block diagram workspace.

Block Diagram Toolbar

When you run a VI, buttons appear on the block diagram toolbar that you can use to debug the VI. The toolbar in Figure 6 appears on the block diagram.

Figure 6
Figure 6 (fptoolbar.png)

exehilit.png Click the Highlight Execution button, shown at left, to display an animation of the block diagram execution when you click the Run button. see the flow of data through the block diagram. Click the button again to disable execution highlighting.

stepinto.png Click the Step Into button, shown at left, to open a node and pause. When you click the Step Into button again, it executes the first action and pauses at the next action of the subVI or structure. You also can press the Ctrl and down arrow keys. Single-stepping through a VI steps through the VI node by node. Each node blinks to denote when it is ready to execute. By stepping into the node, you are ready to single-step inside the node.

stepover.png Click the Step Over button, shown at left, to execute a node and pause at the next node. You also can press the Ctrl and right arrow keys. By stepping over the node, you execute the node without single-stepping through the node.

stepout.png Click the Step Out button, shown at left, to finish executing the current node and pause. When the VI finishes executing, the Step Out button becomes dimmed. You also can press the Ctrl and up arrow keys. By stepping out of a node, you complete single-stepping through the node and go to the next node.

warnbtn.png The Warning button, shown at left, appears if a VI includes a warning and you placed a checkmark in the Show Warnings checkbox in the Error List window. A warning indicates there is a potential problem with the block diagram, but it does not stop the VI from running.

Palettes

LabVIEW has graphical, floating palettes to help you create and run VIs. The three palettes include the Tools, Controls, and Functions palettes. You can place these palettes anywhere on the screen.

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.

Select Window>>Show Tools Palette to display the Tools palette.

note:

Press the Shift key and right-click to display a temporary version of the Tools palette at the location of the cursor.
Figure 7: Tools Palette
Figure 7 (toolspal.png)

If automatic tool selection is enabled and you move the cursor over objects on the front panel or block diagram, LabVIEW automatically selects the corresponding tool from the Tools palette. You can disable automatic tool selection and select a tool manually by clicking the tool you want on the Tools palette.

autotool.png If you want to use the Tab key to cycle through the four most common tools on the Tools palette, click the Automatic Tool Selection button, shown at left, on the Tools palette to disable automatic tool selection. Press the Shift-Tab keys or click the Automatic Tool Selection button to enable automatic tool selection again. You also can manually select a tool on the Tools palette to disable automatic tool selection. Press the Tab or Shift-Tab keys or click the Automatic Tool Selection button on the Tools palette to enable automatic tool selection again. If automatic tool selection is disabled, you can press the spacebar to switch to the next most useful tool.

operate.png opertext.png Use the Operating tool, shown at left, to change the values of a control or select the text within a control. The Operating tool changes to the icon shown at left when it moves over a text control, such as a numeric or string control.

position.png Use the Positioning tool, shown at left, to select, move, or resize objects. The Positioning tool changes to resizing handles when it moves over the edge of a resizable object.

labeling.png lblcurs.png Use the Labeling tool, shown at left, to edit text and create free labels. The Labeling tool changes to the following icon when you create free labels.

wiring.png Use the Wiring tool, shown at left, to wire objects together on the block diagram.

objshort.png Use the Object Shortcut Menu, shown at left, tool to access an object shortcut menu with the left mouse button.

scroll.png Use the Scrolling tool, shown at left, to scroll through windows without using scrollbars.

brkpoint.png Use the Breakpoint tool, shown at left, to set breakpoints on VIs, functions, nodes, wires, and structures to pause execution at that location.

probe.png Use the Probe tool, shown at left, to create probes on wires on the block diagram. Use the Probe tool to check intermediate values in a VI that produces questionable or unexpected results.

colorcpy.png Use the Color Copy tool, shown at left, to copy colors for pasting with the Coloring tool.

coloring.png Use the Coloring tool, shown at left, to color an object. It also displays the current foreground and background color settings.

Controls and Functions Palettes

The Controls and Functions palettes contain subpalettes of objects you can use to create a VI. When you click a subpalette icon, the entire palette changes to the subpalette you selected. To use an object on the palettes, click the object and place it on the front panel or block diagram.

The Controls palette, shown in Figure 8, is available only on the front panel. The Controls palette contains the controls and indicators you use to build the front panel. Refer to the Front Panel section for more information about the using the Controls palette on the front panel. The controls and indicators located on the Controls palette depend on the palette view currently selected.

Figure 8: Controls Palette
Figure 8 (controlspal.png)

The Functions palette, shown in the Figure 9, is available only on the block diagram. The Functions palette contains the VIs and functions you use to build the block diagram. Refer to the Block Diagram section of this lesson for more information about using the Functions palette on the block diagram. The VIs and functions located on the Functions palette depend on the palette view currently selected. The VIs and functions are located on subpalettes based on the types of VIs and functions.

Figure 9: Functions Palette
Figure 9 (functionspal.png)

Changing Palette Views

Use the Options button on the Controls or Functions palette toolbar to change to another palette view or format:

  1. options.png Click the Options button, shown at left, on the Controls or Functions palette toolbar to display the Controls/Functions Palettes page of the Options dialog box.
  2. Select a palette view from the Palette View pull-down menu.
  3. Select a format from the Format pull-down menu, such as Standard, All Icons, All Text, or Icons and Text.
  4. Click the OK button. The Controls and Functions palettes change to the palette view and format you selected.

Searching for Controls, VIs, and Functions

Use the following navigation buttons on the Controls and Functions palettes to navigate and search for controls, VIs, and functions:

  • Up to Owning Palette: up.png Navigates up one level in the palette hierarchy.
  • Search: search.png Changes the palette to search mode. In search mode, you can perform text-based searches to locate controls, VIs, or functions on the palettes. For example, if you want to find the Random Number function, click the Search button on the Functions palette toolbar and start typing Random Number in the text box at the top of the palette. LabVIEW lists all matching items that either start with or contain the text you typed. You can click one of the search results and drag it to the block diagram, as shown in Figure 10.
Figure 10
Figure 10 (searchdrag.png)

Double-click the search result to highlight its location on the palette. You then can click the Up to Owning Palette button to view the hierarchy of where the object resides.

Shortcut Menus

The most often-used menu is the object shortcut menu. All LabVIEW objects and empty space on the front panel and block diagram have associated shortcut menus. Use the shortcut menu items to change the look or behavior of front panel and block diagram objects. To access the shortcut menu, right-click the object, front panel, or block diagram. The shortcut menu for a meter is shown in Figure 11.

Figure 11: Meter Shortcut Menu
Figure 11 (shortcutmenu.png)

Property Dialog Boxes

Front panel objects also have property dialog boxes that you can use to change the look or behavior of front panel objects. Right-click a front panel object and select Properties from the shortcut menu to access the property dialog box for an object. Figure 12 shows the property dialog box for the meter in the previous figure. The options available on the property dialog box for an object are similar to the options available on the shortcut menu for that object.

Figure 12: Meter Property Dialog Box
Figure 12 (meterproperty.png)

Content actions

Download module as:

Add module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks