}

//********************************************************** // error checking routine

void check (ViSession vi, ViStatus errStatus)

{

ViInt32 inst_err;

ViChar err_message[256];

if(VI_SUCCESS > errStatus)

{

if(INSTR_ERROR == errStatus)

{

// query instrument error

hpe1410_dcl(vi);// send a device clear

hpe1410_error_query(vi, &inst_err, err_message);

// display the error

printf("Instrument Error : %ld, %s\n", inst_err, err_message);

}

else

{

// get driver error message

hpe1410_error_message(vi, errStatus, err_message);

// display the error

printf("HP E1410 Driver Error : %ld, %s\n", errStatus, err_message);

}

hpe1410_reset(vi);// reset the multimeter hpe1410_close(vi);// close the multimeter handle

exit(1);

}

return;

}

//************************************************************** // Error handling function

void err_handler (ViSession vi, ViStatus err)

{

char buf[1024]={0}; viStatusDesc(vi,err,buf); printf("ERROR = %s\n", buf); return;

}

Chapter 3

VXI Programming Using the IEEE 1394 Serial Bus 53

Page 53
Image 53
HP E8491A manual Error handling function