Chapter 3 155
ProgrammingExamples
Determine if an Error has Occurred
Determine if an Error has Occurred
/******************************* *****************************/
/* Determine if an error has occ urred */
/* */
/* This example is for the E44xx B ESA Spectrum Analyzers */
/* and E740xA EMC Analyzers. */
/* */
/* This C programming example do es the following. */
/* The SCPI instrument commands used are given as */
/* reference. */
/* */
/* - Opens a GPIB session at add ress 18 */
/* - Clears the Analyzer */
/* *CLS */
/* - Resets the Analyzer */
/* *RST */
/* - Sets the service request ma sk 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 unca librated state */
/* - When an interrupt occurs, p oll all instruments */
/* - Report the nature of the in terrupt on the ESA analyzer */
/* - Pause 5 seconds to observe the analyzer */
/* - Sets the service request ma sk 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, p oll all instruments */
/* - Report the nature of the in terrupt on the ESA analyzer */
/* - Clear the analyzer status r egisters */
/* *SRE 0 */
/* *ESE 0 */
/* STAT:QUES:ENAB 0 */