Agilent Technologies Model A.08.xx Water Dispenser User Manual


 
Chapter 3 161
Programming Examples
Measuring Harmonic Distortion (GPIB)
Measuring Harmonic Distortion (GPIB)
/************************************************************/
/* Measuring Harmonic Distortion (GPIB) */
/* */
/* 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 */
/* - Set the input port to the 50 MHz reference */
/* CAL:SOUR:STAT ON */
/* - Set the analyzer center frequency 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 sweep 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 sweep completion */
/* INIT:IMM;*WAI */
/* - Perform the peak search */
/* CALC:MARK:MAX */
/* - Change VISA timeout to 60 seconds */
/* - Activate signal track */
/* CALC:MARK:TRCK:STAT ON */
/* - Perform narrow span and wait */
/* SENS:FREQ:SPAN 10e4 */
/* - Check for operation complete */
/* *OPC? */
/* - De-activate signal track */
/* CALC:MARK:TRCK:STAT OFF */