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

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

Advertisement

Programming Examples
Reading Trace Data using ASCII Format (GPIB)
void main( )
{
/*Program Variable* /
ViStatus viStatus = 0 ;
/*Dimension cResult to 13 bytes per sweep point, 8192 sweep points maximum* /
ViChar VI FAR cResult[106496] = {0} ;
FILE *fTraceFile ;
static ViChar *cToken ;
int iNum =0 ;
int iSwpPnts = 401 ;
long lCount=OL ;
long lOpc=O ;
/*iNum set to 13 times number of sweep points, 8192 sweep points maximum* /
iNum =106496 ;
lCount =0 ;
/* 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 . This will set number of sweep points to default of 401* /
viPrintf(viESA,"*RST\n") ;
/*Display the program heading */
printf("\n\t\t Read in Trace Data using ASCII Format (HPIB) Program \n\n " ) ;
/* Check for the instrument model number and route the 50MHz signal accordingly* /
Route50MHzSignal() ;
/*Query number of sweep points per trace (firmware revision A .04 .00 and later)* /
/*For firmware revisions prior to A .04 .00, the number of sweep points is 401* /
iSwpPnts = 401 ;
viQueryf(viESA,"SENSE :SWEEP :POINTS?\n","%d",&iSwpPnts) ;
/*Set the analyzer center frequency to 50MHz* /
viPrintf(viESA,"SENS :FREQ :CENT 50 MHz\n") ;
/*Set the analyzer to 50MHz Span* /
3-26
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents