Agilent Technologies ESA-E Series Programmer's Manual page 133

Esa spectrum analyzers
Hide thumbs Also See for ESA-E Series:
Table of Contents

Advertisement

Programming Example s
Measuring Harmonic Distortion (GPIB )
/* Open a HP-IB session at address 18* /
viStatus=viOpenDefaultRM(&defaultRM) ;
viStatus=viOpen( defaultRM,
"GPIBO :
:18 "
, VINULL,VINULL,
&viESA) ;
if(viStatus )
{
printf("Could not open a session to HP-IB device at address 181\n") ;
exit(0) ;
}
/*Clear the instrument* /
viClear(viESA) ;
/*Reset the instrument* /
viPrintf(viESA,"*RST\n") ;
/*Display the program heading * /
printf("\n\t\t Harmonic Distortion Program \n\n" ) ;
/* Check for the instrument model number and route the 50MHz-signal accordingly* /
Route50MHzSignal() ;
/*Prompt user for fundamental frequency* /
printf("\t Enter the input signal fundamental frequency in MHz ") ;
/*The user enters fundamental frequency* /
scanf("%lf",&dFundamental) ;
/*Set the analyzer center frequency to the fundamental frequency . * /
viPrintf(viESA,"SENS :FREQ :CENT elf MHZ \n ;",dFundamental) ;
/*Set the analyzer to 10MHz Span
*1
viPrintf(viESA,"SENS :FREQ :SPAN 10 MHZ\n") ;
/*Put the analyzer in a single sweep * /
viPrintf(viESA,"INIT :CONT 0 \n") ;
/*Trigger a sweep* /
viPrintf(viESA,"INIT :IMM\n") ;
/*Check for operation complete* /
viQueryf(viESA, "*OPC?\n", "%d", &lOpc) ;
if (IlOpc )
{
printf("Program Abort! Error occurred : last command was not completed !\n") ;
exit (0) ;
}
/*Perform a peak search
*/
Chapter 3
3-73

Advertisement

Table of Contents
loading

Table of Contents