Chapter 9 Checking for Errors in LabWindows/CVI
©
National Instruments Corporation 9-3 LabWindows/CVI Programmer Reference Manual
After your program detects an error, it must take some action to either correct the situation or
prompt the user to select a course of action. The following example shows a simple error
response function.
void ErrorCheck (char *errMsg, int errVal, char *errString)
{char outputMsg[256];
int response;
Fmt (outputMsg, "%s (Error = %d).\n%s\nContinue? ",
errMsg,errVal,errString);
response = ConfirmPopup ("ErrorCheck", outputMsg);
if (response == 0)
exit (-1);
}
Status Reporting by LabWindows/CVI Libraries and Instrument Drivers
This section describes how LabWindows/CVI libraries and instrument drivers report errors.
Notice that libraries that return their status code using global variables or separate functions
sometimes report additional status information through return values.

User Interface Library

The User Interface Library routines return a negative value when they detect an error. Some
functions, such as LoadPanel, return positive values for a successful completion. This
library uses a common set of error codes, which the LabWindows/CVI User Interface
Reference Manual and the function panel help list. You can use the function
GetUILErrorString to get the error message associated with each User Interface Library
error code.

Analysis/Advanced Analysis Libraries

The Analysis and Advanced Analysis Library functions return a negative value when they
detect an error. This library uses a common set of error codes, which the LabWindows/CVI
Standard Libraries Reference Manual, the LabWindows/CVI Advanced Analysis Reference
Manual, and the function panel help list. You can use the function
GetAnalysisErrorString to get the error message associated with each Analysis Library
error code.

00ProRef.book : 06chap09.fm Page 3 Monday, March 9, 1998 3:23 PM