Chapter 3 161
ProgrammingExamples
Measuring Harmonic Distortion (GPIB)
Measuring Harmonic Distortion (GPIB)
/******************************* *****************************/
/* Measuring Harmonic Distortion (GPIB) */
/* */
/* 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 */
/* - Set the input port to the 5 0 MHz reference */
/* CAL:SOUR:STAT ON */
/* - Set the analyzer center fre quency to the fundamental */
/* SENS:FREQ:CENT freq */
/* - Set the analyzer to 10 MHz span */
/* SENS:FREQ:SPAN 10 MHZ */
/* - Set the analyzer to single sweep mode */
/* INIT:CONT 0 */
/* - Take a sweep and wait for s weep completion */
/* INIT:IMM;*WAI */
/* - Perform the peak search */
/* CALC:MARK:MAX */
/* - Set the marker to reference level */
/* CALC:MARK:SET:RLEV */
/* - Take a sweep and wait for s weep completion */
/* INIT:IMM;*WAI */
/* - Perform the peak search */
/* CALC:MARK:MAX */
/* - Change VISA timeout to 60 s econds */
/* - Activate signal track */
/* CALC:MARK:TRCK:STAT ON */
/* - Perform narrow span and wai t */
/* SENS:FREQ:SPAN 10e4 */
/* - Check for operation complet e */
/* *OPC? */
/* - De-activate signal track */
/* CALC:MARK:TRCK:STAT OFF */