Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » LabVIEW Graphical Programming » Debug Exercise (Main) VI

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.
 

Debug Exercise (Main) VI

Module by: National Instruments. E-mail the author

Summary: Practice debugging techniques.

Exercise 1

Complete the following steps to load a broken VI and correct the error. Use single-stepping and execution highlighting to step through the VI.

1.a) Front Panel

  1. Select File>>Open and navigate to C:\Exercises\LabVIEW Basics I to open the Debug Exercise (Main) VI. The front panel shown in Figure 1 appears.
    Figure 1
    Figure 1 (debugfp.png)
    brokrun.png Notice the Run button on the toolbar appears broken, shown in Media 2, indicating that the VI is broken and cannot run.

1.b) Block Diagram

  1. Select Window>>Show Block Diagram to display the block diagram shown in Figure 2.
    Figure 2
    Figure 2 (debugbd.png)
    randnum.png The Random Number (0-1) function, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, produces a random number between 0 0 and 1 1. multiply.png The Multiply function, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, multiplies the random number by 10.0 10.0. numconst2.png The numeric constant, located on the Functions>>Arithmetic & Comparison>>Express Numeric palette, is the number to multiply by the random number. debugsub.png The Debug Exercise (Sub) VI, located in the C:\Exercises\ LabVIEW Basics I directory, adds 100.0 100.0 and calculates the square root of the value.
  2. Find and fix each error.
    1. Click the broken Run button to display the Error list window, which lists all the errors.
    2. Select an error description in the Error list window. The Details section describes the error and in some cases recommends how to correct the error.
    3. Click the Help button to display a topic in the LabVIEW Help that describes the error in detail and includes step-by-step instructions for correcting the error.
    4. Click the Show Error button or double-click the error description to highlight the area on the block diagram that contains the error.
    5. Use the Error list window to fix each error.
  3. Select File>>Save to save the VI.
  4. Display the front panel by clicking it or by selecting Window>>Show Front Panel.

1.c) Run the VI

  1. Click the Run button to run the VI several times.
  2. Select Window>>Show Block Diagram to display the block diagram.
  3. Animate the flow of data through the block diagram.
    1. exehilit.png Click the Highlight Execution button, shown in Media 8, on the toolbar to enable execution highlighting.
    2. stepinto.png Click the Step Into button, shown in Media 9, to start single-stepping. Execution highlighting shows the movement of data on the block diagram from one node to another using bubbles that move along the wires. Nodes blink to indicate they are ready to execute.
    3. stepover.png Click the Step Over button, shown in Media 10, after each node to step through the entire block diagram. Each time you click the Step Over button, the current node executes and pauses at the next node. Data appear on the front panel as you step through the VI. The VI generates a random number and multiplies it by 10.0 10.0. The subVI adds 100.0 100.0 and takes the square root of the result.
    4. stepout.png When a blinking border surrounds the entire block diagram, click the Step Out button, shown in Media 11, to stop single-stepping through the Debug Exercise (Main) VI.
  4. Single-step through the VI and its subVI.
    1. Click the Step Into button to start single-stepping.
    2. runsubvi.png When the Debug Exercise (Sub) VI blinks, click the Step Into button. Notice the run button on the subVI.
    3. debugbdglyph.png Display the Debug Exercise (Main) VI block diagram by clicking it. A green glyph, shown in Media 13, appears on the subVI icon on the Debug Exercise (Main) VI block diagram, indicating that the subVI is running.
    4. Display the Debug Exercise (Sub) VI block diagram by clicking it.
    5. Click the Step Out button twice to finish single-stepping through the subVI block diagram. The Debug Exercise (Main) VI block diagram is active.
    6. Click the Step Out button to stop single-stepping.
  5. Use a probe to check intermediate values on a wire as a VI runs.
    1. probe.png Use the Probe tool, shown Media 14, to click any wire. A window similar to Figure 3 appears.
      Figure 3
      Figure 3 (probewin.png)
      LabVIEW numbers the Probe window automatically and displays the same number in a glyph on the wire you clicked.
    2. Single-step through the VI again. The Probe window displays data passed along the wire.
  6. Place breakpoints on the block diagram to pause execution at that location.
    1. brkpoint.png Use the Breakpoint tool, shown in Media 16, to click nodes or wires. Place a breakpoint on the block diagram to pause execution after all nodes on the block diagram execute.
    2. Click the Run button to run the VI. When you reach a breakpoint during execution, the VI pauses and the Pause button on the toolbar appears red.
    3. pause.png Click the Continue button, shown Media 17, to continue running to the next breakpoint or until the VI finishes running.
    4. Use the Breakpoint tool to click the breakpoints you set and remove them.
  7. Click the Highlight Execution button to disable execution highlighting.
  8. Select File>>Close to close the VI and all open windows.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection 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

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