Jump to content

Debugging: Difference between revisions

From LabVIEW Wiki
Bryan (talk | contribs)
Add tips and tricks
Line 38: Line 38:
More to come
More to come


== Articles ==
== Tips and tricks ==
* Use conditional probes to break code execution when a specified condition is met.
* To edit a VI that is set to run when opened, open the VI from the block diagram of another VI.
* Select '''Edit > Remove Breakpoints from Hierarchy''' to quickly remove all breakpoints in the hierarchy.
* A call list will appear in the toolbar on the block diagram of a subVI while it is paused or suspended. This list contains all the callers the VI. Choose an entry to highlight the subVI in the caller.
 
== External links ==
[https://forums.ni.com/t5/WAsatch-Front-LabVIEW-WAFL-User/Basics-of-Debugging-LabVIEW/gpm-p/3816405 Basics of Debugging LabVIEW] - by Quentin Alldredge, Q Software Innovations, LLC
[https://forums.ni.com/t5/WAsatch-Front-LabVIEW-WAFL-User/Basics-of-Debugging-LabVIEW/gpm-p/3816405 Basics of Debugging LabVIEW] - by Quentin Alldredge, Q Software Innovations, LLC



Revision as of 12:11, 15 May 2020

Debugging Basics

Block Diagram Toolbar

Basic debugging tools come integrated into every block diagram window in the toolbar. See Debugging Tools in LabVIEW .[1]

  • Broken Run Button - appears broken when the VI you are creating or editing contains errors
  • Highlight Execution - displays an animation of the block diagram execution when you run the VI
  • Retain Wire Values - save the wire values at each point in the flow of execution so that when you place a probe on the wire you can immediately retain the most recent value of the data that passed through the wire
  • Step Into - opens a node and pauses
  • Step Over - executes a node and pauses at the next node
  • Step Out - finishes executing the current node and pauses

Breakpoints

Like other software languages, breakpoints allow the developer to pause the execution of the code at a specified point. This is helpful when the developer knows the code works to that point but the wants to use the other debugging to past that point to discover the problem. See more on Managing Breakpoints.[2]

Probes

Use Probes to check intermediate values on a wire as a VI runs. Use the Probe tool if you have a complicated block diagram with a series of operations, any one of which might return incorrect data. Use the Probe tool with execution highlighting, single-stepping, and breakpoints to determine if and where data is incorrect. If data is available, the probe immediately updates and displays the data during execution highlighting, single-stepping, or when you pause at a breakpoint. When execution pauses at a node because of single-stepping or a breakpoint, you also can probe the wire that just executed to see the value that flowed through that wire.[3]

Conditional Disable Structure/Conditional Symbols

More to come

Suspend When Called

More to come

Debug Window

More to come

Error Handling

More to come

Desktop Execution Trace Toolkit

More to come

Advanced Debugging

More to come

Tips and tricks

  • Use conditional probes to break code execution when a specified condition is met.
  • To edit a VI that is set to run when opened, open the VI from the block diagram of another VI.
  • Select Edit > Remove Breakpoints from Hierarchy to quickly remove all breakpoints in the hierarchy.
  • A call list will appear in the toolbar on the block diagram of a subVI while it is paused or suspended. This list contains all the callers the VI. Choose an entry to highlight the subVI in the caller.

External links

Basics of Debugging LabVIEW - by Quentin Alldredge, Q Software Innovations, LLC

References

  1. "Debugging Tools in LabVIEW" by National Instruments ([1]http://www.ni.com/getting-started/labview-basics/debug)
  2. "Managing Breakpoints" by National Instruments (http://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/breakpoints/)
  3. "Using the Probe Tool" by National Instruments (http://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/using_the_probe_tool/)