0% found this document useful (0 votes)
2 views

LabVIEW_04_Error handling

The document discusses error handling in LabVIEW, emphasizing the importance of error checking in VIs and subVIs. It outlines three methods for error handling: automatic, manual, and error clustering, detailing how errors are reported and managed. Additionally, it provides an example of modifying a VI to incorporate error clusters for better error management.

Uploaded by

xt7510
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

LabVIEW_04_Error handling

The document discusses error handling in LabVIEW, emphasizing the importance of error checking in VIs and subVIs. It outlines three methods for error handling: automatic, manual, and error clustering, detailing how errors are reported and managed. Additionally, it provides an example of modifying a VI to incorporate error clusters for better error management.

Uploaded by

xt7510
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

04.

Error handling
Error checking

■ Error checking is a key element of a VI or subVI.


■ If an error arises, it is important to know why and where the error occurred.
■ If an error occurs, you may want to avoid suspending the execution of the VI and instead to
respond programmatically by taking another course of action within the code.
■ Most I/O functions return errors and supply mechanisms to handle them appropriately.
■ There are three ways to tackle error checking and error handling


– automatic error handling
– manual error handling
伝送
– error clustering 江 Error
&江 潤
Automatically error handling

■ By default, LabVIEW automatically


handles errors by
– suspending execution
– highlighting the subVI

– displaying an error dialog box
■ Each error has a numeric code and a
corresponding error message.


■ You can disable automatic error
handling for VI: File VI properties
Category: execution deselecting
“Enable automatic error handling

béanun 䥲糕核
Manually error handling 学 ⼿动

Vtoer
xteser

-
Manually error handling -- function

Functions generally return errors


with numeric error codes.
Manually error handling -- VIs

VIs return
errors with an
error cluster.
Error cluster

■ Status is a Boolean value that reports TRUE if an error occurred.


■ Code is a 32-bit signed integer that identifies the error numerically. A non-zero error
code coupled with a status of FALSE signals a warning rather than an error.
■ Source is a string that identifies where the error occurred.
Manually error handling -- VIs

8 ,
Manually error handling -- VIs

VIs read an error cluster


from other VIs.

VIs send an error


cluster to other VIs.
Example
■ For the VI “Temperature” developed in the former chapter, modify the part of code for
displaying the temperature into a subVI. Add error in cluster and error out cluster into
the subVI.

Aubvi 不合有 任何 的啊 直接inlont



相連
enor

You might also like