National Instruments 320685D-01 ユーザーズマニュアル

ページ / 211
Chapter 9
Checking for Errors in LabWindows/CVI
©
 National Instruments Corporation
9-7
LabWindows/CVI Programmer Reference Manual
Formatting and I/O Library function that performed file I/O. The 
GetFmtIOErrorString
 
function converts this code into an error string. Refer to the LabWindows/CVI Standard 
Library Reference Manual
 for more information.
Utility Library 
Utility Library functions report error codes as return values. You can check each individual 
function description in the LabWindows/CVI Standard Libraries Reference Manual or in the 
LabWindows/CVI function panel help to determine the error conditions that can occur in each 
function.
ANSI C Library 
Some of the ANSI C library functions report error codes as return values. Some functions also 
set the global variable 
errno
. Generally, the functions do not clear 
errno
 when they return 
successfully. To learn more about these values, you can consult a publication such as C: A 
Reference Manual
 cited in the Related Documentation section of About This Manual. Also, 
you can use the LabWindows/CVI function panel help to determine the error conditions that 
can occur in each function.
LabWindows/CVI Instrument Drivers 
Instrument drivers from National Instruments use a standard status reporting scheme. 
Functions report error codes as return values, and you can check each function individually 
in the LabWindows/CVI function panel help to determine the error conditions that can occur 
in each function.
Instrument drivers that comply with the VXIplug&play standard contain two error reporting 
functions. 
Prefix_error_query
, where 
Prefix
 is the instrument prefix, allows you to 
query the error queue in the physical instrument. If the instrument does not have an error 
queue, 
Prefix_error_query
 returns the 
VI_WARN_NSUP_ERROR_QUERY
 warning code 
from the VISA Library. 
Prefix_error_message
 translates the error and warning codes 
that the other instrument driver functions return into descriptive strings. 
IVI instrument drivers are VXIplug&play compliant and so contain the 
Prefix_error_query
 and 
Prefix_error_message
 functions. In addition, IVI 
instrument driver functions sometimes also provide a secondary error code or an elaboration 
string to give you additional information about an error condition. You can use 
Prefix_GetErrorInfo
 to obtain the primary error code, secondary error code, and the 
elaboration string for the first error that occurred on a particular instrument session or in the 
current thread since you last called 
Prefix_GetErrorInfo
. You also can use the 
Prefix_GetAttribute
 function to obtain each of these data items, individually, for the 
most recent function call on a particular instrument session.
00ProRef.book : 06chap09.fm  Page 7  Monday, March 9, 1998  3:23 PM