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

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

Advertisement

Programming Example s
Using Marker Delta Mode and Marker Minimum Searc h
long lOpc =0L ;
/* Open an HP-IB session at address 18* /
viStatus=viOpenDefaultRM(&defaultRM) ;
viStatus = viOpen(defaultRM,"GPIBO : :18",VI NULL,VI NULL,&viESA) ;
if(viStatus )
{
printf("Could not open a session to HP-IB device at address 18!\n") ;
exit(0) ;
}
/*Clear the instrument* /
viClear(viESA) ;
/*Reset the instrument* /
viPrintf(viESA,"*RST\n") ;
/*Display the program heading * /
printf("\n\t\t Marker Delta Program \n\n" ) ;
/*Check for the instrument model number and route the 50MHz signal accordingly* /
Route50MHzSignal() ;
/*Set the analyzer to single sweep mode* /
viPrintf(viESA,"INIT :CONT (An") ;
/*Prompt the user for the start frequency* /
printf("\t Enter the Start frequency in MHz ") ;
/*The user enters the start frequency* /
scanf("%lf",&dStartFreq) ;
/*Prompt the user for the stop frequency* /
printf("\t Enter the Stop frequency in MHz ") ;
/*The user enters the stop frequency* /
scanf("%lf",&dStopFreq) ;
/*Set the analyzer to the values given by the user* /
viPrintf(viESA,"SENS :FREQ :STAR %lf MHZ \n ; :SENS :FREQ :STOP %l f
MHZ\n",dStartFreq,dStopFreq) ;
/*Trigger a sweep* /
viPrintf(viESA,"INIT :IMM\n") ;
/*Check for operation complete* /
viQueryf(viESA, "*OPC?\n", "%d", &lOpc) ;
3-18
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents