/****************************************************************************/ 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);

}

}

Comments 1. Packed Reading Format. Packed digitizer readings are signed, 16-bit numbers preceded by the ANSI/IEEE Standard 488.2-1987 Definite Length Arbitrary Block header. Packed readings are always a number between -1.0230 (-2046) and +1.0235 (2047), and must be converted to voltages by the user.

2.Line Feed Following Packed Readings. Packed readings preceded by the arbitrary block header are also followed by a line feed (LF) character. When readings are retrieved from the digitizer, the LF remains in the output buffer. If the line feed is not removed with an additional "IOENTERS" statement, error -410 "Query INTERRUPTED" occurs the next time data is read from the digitizer.

3.Channel Labels. A numeric label identifying a set of readings can be specified using the four least significant bits of each reading. The label, which is any number from 0 to 15, is assigned using the DIAGnostic:CHANnel<chan >:LABel command. The label is included with the reading bits when data is returned in the PACKed,16 format. The assigned label is ignored when the data format is ASCii,9 or REAL,64. If no label is assigned, the four least significant bits of the reading are ’0’s. See "How Readings are Stored" in Chapter 3 for more information.

62 Using the Digitizer

Chapter 2

Page 62
Image 62
HP E1429A manual Iooutputsaddr, Systerr?