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

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

Advertisement

Programming Example s
Reading Trace Data Using ASCII Format (RS-232 )
ViChar VI FAR cResult[106496] = {0} ;
FILE *fTraceFile ;
static ViChar *cToken ;
int iNum =0 ;
int iSwpPnts = 401 ;
long lCount=OL ;
long lOpc=OL ;
/*iNum set to 13 times number of sweep points, 8192 sweep points maximum* /
iNum =106496 ;
1Count =0 ;
/* Open a serial session at COM1 * /
viStatus=viOpenDefaultRM(&defaultRM) ;
if (viStatus =viOpen(defaultRM,"ASRL1 : :INSTR",VI_NULL,VI_NULL,&viESA) 1 =
VI_SUCCESS )
{
printf("Could not open a session to ASRL device at COM1!\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\tRead in Trace Data using ASCII Format (RS232) 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* /
viPrintf(viESA,"SENS :FREQ :SPAN 50 MHz\n") ;
/*set the analyzer to single sweep mode* /
viPrintf(viESA,"INIT :CONT 0 \n") ;
3-36
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents