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

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

Advertisement

Programming Examples
Measuring Harmonic Distortion (GPIB )
}
els e
{
/* For the analyzers having frequency limits >= 3GHz, prompt the user* /
/* to connect the amplitude reference output to the input* /
printf ( "Connect AMPTD REF OUT to the INPUT \n") ;
printf ("
Press Return to continue \n") ;
scanf( "%c",&cEnter) ;
/*Externally route the 50MHz Signal* /
viPrintf(viESA,"CAL :SOUR :STAT ON \n") ;
}
}
void TakeSweep( )
{
/*Take a sweep and wait for the sweep completion* /
viPrintf(viESA,"INIT :IMM\n") ;
viQueryf(viESA, "*OPC?\n", "%d", &lOpc) ;
if (llOpc )
{
printf("Program Abort! Error occurred : last command was not completed! \n") ;
exit(0) ;
}
}
void main( )
{
/*Program Variables* /
ViStatus viStatus
= 0 ;
double dFundamental = 0 .0 ;
double dHarmFreq =0 .0 ;
float fHarmV[10] ={0 .0} ;
float fHarmDbm[10]={0 .0} ;
float fRelAmptd[10]={0 .0} ;
float fFundaAmptdDba==0 .0 ;
double dFundaAmptdV=0 .0 ;
double dMarkerFreq = 0 .0 ;
double dPrcntDistort =0 .0 ;
double dSumSquare =0 .0 ;
long 1MaxHarmonic =OL ;
long lNum=OL ;
/*Setting default values* /
lMaxHarmonic =5 ;
dFundamental =50 .0 ;
3-72
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents