![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/5/d7/5d720816-19b5-4859-9a46-b543c4868a04/5d720816-19b5-4859-9a46-b543c4868a04-bg9b.png)
Chapter 3 155
Programming Examples
Determine if an Error has Occurred
Determine if an Error has Occurred
/************************************************************/
/* Determine if an error has occurred */
/* */
/* This example is for the E44xxB ESA Spectrum Analyzers */
/* and E740xA EMC Analyzers. */
/* */
/* This C programming example does the following. */
/* The SCPI instrument commands used are given as */
/* reference. */
/* */
/* - Opens a GPIB session at address 18 */
/* - Clears the Analyzer */
/* *CLS */
/* - Resets the Analyzer */
/* *RST */
/* - Sets the service request mask to assert SRQ when */
/* either a measurement is uncalibrated or an error */
/* message has occurred. */
/* STAT:QUES:ENAB 512 */
/* STAT:QUES:INT:ENAB 8 */
/* *ESE 35 */
/* *SRE 104 */
/* - Set the center frequency to 500MHz and span to 100MHz */
/* SENS:FREQ:CENT 500 MHZ */
/* SENS:FREQ:SPAN 100 MHZ */
/* - Set the analyzer to an uncalibrated state */
/* - When an interrupt occurs, poll all instruments */
/* - Report the nature of the interrupt on the ESA analyzer */
/* - Pause 5 seconds to observe the analyzer */
/* - Sets the service request mask to assert SRQ when */
/* either a measurement is uncalibrated or an error */
/* message has occurred. */
/* *ESE 35 */
/* *SRE 96 */
/* - Send an illegal command to the ESA */
/* IDN (illegal command) */
/* - When an interrupt occurs, poll all instruments */
/* - Report the nature of the interrupt on the ESA analyzer */
/* - Clear the analyzer status registers */
/* *SRE 0 */
/* *ESE 0 */
/* STAT:QUES:ENAB 0 */