HP ESA-E Series Programmer's Manual page 136

Esa spectrum analyzers
Table of Contents

Advertisement

Programming Examples
Measuring Harmonic Distortion (HP-IB)
}
void main()
{
/*program variable*/
ViStatus viStatus
double dFundamental = 0.0;
float fHarmV[10] ={0.0};
float fHarmDbm[10]={0.0};
float fRelAmptd[10]={0.0};
float fFundaAmptdDbm=0.0;
double dFundaAmptdV=0.0;
double dMarkerFreq = 0.0;
double dPrcntDistort =0.0;
double dSumSquare =0.0;
long
lMaxHarmonic =0L;
long
Num=0L;
/*Setting default values*/
lMaxHarmonic = 5;
dFundamental = 50.0;
/* Open an HP-IB session at address 18*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM,"GPIB0::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 analyzer*/
viClear(viESA);
/*Reset the analyzer*/
viPrintf(viESA,"*RST\n");
/*Display the program heading */
printf("\n\t\t Harmonic Distortion Program \n\n" );
/* Check for the analyzer model number and route the
50 MHz signal accordingly*/
Route50MHzSignal();
3-72
= 0;
Chapter 3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents