HP (Hewlett-Packard) B Network Router User Manual


 
IOOUTPUTS(ADDR, "*RST;*CLS", 9);
}
/****************************************************************************/
void check_error(char *func_tion)
{
char into[161];
intlength = 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);
}
}
Querying
Command Settings
As you configure the digitizer it is often useful to determine command
settings programmatically. This can be done by adding a question mark (?)
at the end of any SCPI command header (except the MEASure command),
and then sending the command without parameters. The following programs
query the parameters of the CONFigure command. Assuming the
CONFigure command was executed as indicated in program CONF.C, the
following query response is returned:
"ARR (20),1.000000,0.000500,(@1)"
where:
(20) = reading count (size parameter)
1.000000 = expected value
0.000500 = reading resolution
(@1) = input port
Chapter 1 Getting Started 43