HP 8163A Series Programming Manual page 160

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

Advertisement

The HP 816x VXIplug&play Instrument Driver
void check (ViSession instrumentHandle, ViStatus errStatus)
{
/* variables for error code and message */
ViInt32 inst_err;
ViChar err_message[256];
/* VI_SUCCESS is 0 and is defined in VISATYPE.h */
if(VI_SUCCESS > errStatus)
{
/* hp816x_INSTR_ERROR_DETECTED defined in hp816x.h */
if(hp816x_INSTR_ERROR_DETECTED == errStatus)
{
/* query the instrument for the error */
hp816x_error_query(instrumentHandle, &inst_err, err_message);
/* display the error */
printf("Instrument Error : %ld, %s\n", inst_err, err_message);
}
else /* driver error */
{
/* get the driver error message */
hp816x_error_message(instrumentHandle, errStatus, err_message);
/* display the error */
printf("Driver Error : %ld, %s\n", errStatus, err_message);
}
/* optionally reset the instrument, close the instrument handle */
hp816x_reset(instrumentHandle);
hp816x_close(instrumentHandle);
exit(1);
}
return;
160
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'.
4 Create a routine to respond to the error or event. This example queries whether
an error has occured, checks if the error is an instrument error and then checks
if the error is a driver error.
HP 8163A Lightwave Multimeter, HP 8164A Lightwave Measurement System,
& HP 8166A Lightwave Multichannel System User's Guide, E1299
Error Handling

Advertisement

Table of Contents
loading

This manual is also suitable for:

8164a series8166a series

Table of Contents