HP (Hewlett-Packard) B Network Router User Manual


 
/* Read value from offset register */
IOENTER(CMD_MOD, &a24offst);
/* Multiply offset value by 256 for 24-bit address value */
a24offst *= 256.;
return (long)a24offst;
}
/****************************************************************************/
void rst_clr(long address)
{
/* Reset and clear the instruments */
IOOUTPUTS(address, "*RST;*CLS", 9);
}
/****************************************************************************/
void check_error(char *array, long address)
{
char into[161];
intlength = 160;
IOOUTPUTS(address, "SYST:ERR?", 9); /* Query error register */
IOENTERS(address, 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 %s\n\n", into, array);
length = 160;
IOOUTPUTS(address, "SYST:ERR?", 9);
IOENTERS(address, into, &length);
}
exit(1);
}
}
98 Usin
g
the Di
g
itizer Chapter 2