Lesson 3
Troubleshooting and Debugging VIs
Fix a broken VI, debug incorrect results and behavior of a
running VI, and display errors generated by functions while
a VI is running.
A. Correcting Broken VIs
B. Debugging Techniques
C. Error Handling
1
LESSON 3 Debugging and Troubleshooting
A. Correcting Broken VIs
Recognize an unexecutable VI and restate common
problems.
2
A. Correcting Broken VIs
Common Causes of Broken VIs
3
A. Correcting Broken VIs
Identify Problems and Fix Broken VIs
4
LESSON 3 Debugging and Troubleshooting
B. Debugging Techniques
Identify the LabVIEW tools for debugging and select the tool
appropriate to the situation.
• Debugging Tools Review
• Breakpoints
• Undefined or Unexpected Data
5
B. Debugging Techniques
Debugging Tips
Refer to the LabVIEW Core 1 Participant Guide for the Debugging Techniques job aid.
6
LESSON 3 Troubleshooting and Debugging
Activity 3-1
Review Debugging Tools
Select the LabVIEW debugging tool you would use in different scenarios.
7
B. Debugging Techniques
Breakpoints
8
B. Debugging Techniques
Retain Wire Values
• Allows you to probe wire values after a VI runs
9
B. Debugging Techniques
Undefined or Unexpected Data
10
LESSON 3 Troubleshooting and Debugging
Exercise 3-1
Debugging
Use debugging tools and troubleshooting techniques to fix a broken VI that
returns unexpected data.
11
LESSON 3 Troubleshooting and Debugging
Exercise 3-1
Debugging
• If you have a VI with a broken Run arrow, what should you do first?
• After you fixed your broken Run arrow, your VI results show unexpected data.
What can you do next?
12
LESSON 3 Debugging and Troubleshooting
C. Error Handling
Describe the difference between automatic and manual error
handling.
• Error Handling Review • Error Clusters
• Automatic vs. Manual Error • Errors and Warnings
Handling
• Merge Errors Function
13
C. Error Handling
Error Handling Review
Error Handling – Anticipation, detection and resolution of
warnings and errors
Automatic Error Handling – At run time, LabVIEW suspends
execution, highlights node, and displays Error dialog box
Manual Error Handling – You control when dialog boxes
appear, propagate errors with error clusters, terminate error
chain with Simple Error Handler VI
14
LESSON 3 Troubleshooting and Debugging
Demonstration
Automatic vs. Manual Error Handling
Demonstrate the difference between automatic and manual error
handling.
15
C. Error Handling
Disable Automatic Error Handling
16
C. Error Handling
Error Clusters
17
C. Error Handling
Errors and Warnings
Error Warning
• Status = TRUE (8) • Status = FALSE (4)
• Code = Non-zero • Code = Non-zero
18
C. Error Handling
Merge Errors
19
C. Error Handling
Errors and Warnings Recommendations
20
LESSON 3 Troubleshooting and Debugging
Activity 3-2
Lesson Review
Refer to the participant guide to answer questions about what you have learned
in this lesson and then discuss the answers as a group.
21
Lesson Review
1. Which of the following will result in a
broken run arrow?
a. A subVI is broken
b. The diagram includes a divide by zero
c. A required subVI input is unwired
d. A Boolean terminal is wired to a numeric indicator
22
Lesson Review
1. Which of the following will result in a
broken run arrow?
a. A subVI is broken
b. The diagram includes a divide by zero
c. A required subVI input is unwired
d. A Boolean terminal is wired to a numeric indicator
23
Lesson Review
2. Which of the following are the
components and data types of the error
cluster?
a. Status: Boolean
b. Error: String
c. Code: 32-bit integer
d. Source: String
24
Lesson Review
2. Which of the following are the
components and data types of the error
cluster?
a. Status: Boolean
b. Error: String
c. Code: 32-bit integer
d. Source: String
25
Lesson Review
3. All errors have negative error codes and
all warnings have positive error codes.
a. True
b. False
26
Lesson Review
3. All errors have negative error codes and
all warnings have positive error codes.
a. True
b. False
27
Lesson Review
4. Merge Errors function concatenates error
information from multiple sources.
a. True
b. False
28
Lesson Review
4. Merge Errors function concatenates error
information from multiple sources.
a. True
b. False
29