Error Handling - Agilent Technologies 8163A Programming Manual

Lightwave multimeter lightwave measurement system lightwave multichannel system
Hide thumbs Also See for 8163A:
Table of Contents

Advertisement

Error Handling

Agilent 8163A Lightwave Multimeter, Agilent 8164A Lightwave Measurement System, & Agilent 8166A Lightwave Multichannel
System, Third Edition
N O T E
You can find a partial list of the type definitions and constant definitions
for the visatype.h in the Agilent 816x VXIplug&play Instrument
Driver Online Help.
Error Handling
Events and errors within a instrument control program can be detected
by polling (querying) the instrument. Polling is used in application
development environments (ADEs) that do not support asynchronous
activities where callbacks can be used.
Programs can set up and use polling as shown below.
1 Declare a variable to contain the function completion code.
ViStatus errStatus;
Every driver function returns the completion code ViStatus.
If the function executes with no I/O errors, driver errors, or
instrument errors, ViStatus is 0 (VI_SUCCESS).
If an error occurs, ViStatus is a negative error code.
Warnings are positive error codes, and indicate the operation
succeeded but special conditions exist.
2 Enable automatic instrument error checking following each function
call.
hp816x_errorQueryDetect
(instrumentHandle, VI_TRUE);
When enabled, the driver queries the instrument for an error condition
before returning from the function.
If an error occurred, errStatus (Step 1) will contain a code
indicating that an error was detected
(hp816x_INSTR_ERROR_DETECTED).
3 Check for an error (or event) after each function.
errStatus = hp816x_cmd(instrumentHandle,
"SENS1:POW:RANG");
check(instrumentHandle, errStatus);
After the function executes, errStatus contains the completion
code.
The completion code and instrument ID are passed to an error
checking routine. In the above statement, the routine is called 'check'.
The Agilent 816x VXIplug&play Instrument Driver
169

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a8166a

Table of Contents