/* Multiply offset value by 256 for 24-bit address value */ a24offst *= 256.;

return (long)a24offst;

}

/****************************************************************************/ void rst_clr(void)

{

/* Reset and clear the digitizer */

IOOUTPUTS(ADDR, "*RST;*CLS", 9);

}

/****************************************************************************/ void check_error(char *func_tion)

{

char

into[161];

 

int

length = 160;

 

IOOUTPUTS(ADDR, "SYST:ERR?", 9);

/* Query error register */

IOENTERS(ADDR, into, &length);

/* Enter error message */

if (atoi(into) != 0) /* Determine if error is present */ /* If errors present, print and exit */

{

while (atoi(into) != 0)

{

printf("Error %s in function %s\n\n", into, func_tion); IOOUTPUTS(ADDR, "SYST:ERR?", 9); IOENTERS(ADDR, into, &length);

}

exit(1);

}

}

Appendix C

Register Programming 403

Page 403
Image 403
HP E1429A manual Void checkerrorchar *function Char Into161 Length =