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

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

Advertisement

Programming Example s
Measuring Harmonic Distortion (RS-232)
exit(0) ;
}
/*Perform a peak search * /
viPrintf(viESA,"CALC :MARK :MAX\n") ;
/* Place the signal at the reference level using th e
marker-to-reference level command and take sweep * /
viPrintf(viESA,"CALC :MARK :SET :RLEV\n") ;
/*Trigger a sweep * /
viPrintf(viESA,"INIT :IMM\n " ) ;
/*Check for operation complete * /
viQueryf(viESA, "*OPC?\n", "%d", &lOpc) ;
if (!lOpc )
{
printf("Program Abort! Error occurred : last command was not completed! \n") ;
exit(0) ;
}
/*Perform a peak search * /
viPrintf(viESA,"CALC :MARK :MAX\n") ;
/*Increase timeout to 60 sec* /
viSetAttribute(viESA,VI ATTR TMO VALUE,60000) ;
/*Perform activate signal track * /
viPrintf(viESA,"CALC :MARK :TRCK :STAT ON\n") ;
/*Perform narrow span and wait * /
viPrintf(viESA,"SENS :FREQ :SPAN 10e4\n") ;
/*Take a sweep and wait for the sweep completion* /
TakeSweep() ;
/*De activate the signal track * /
viPrintf(viESA,"CALC :MARK :TRCK :STAT OFF\n") ;
/*Reset timeout to 3 sec* /
viSetAttribute(viESA,VI ATTR TMO VALUE,3000) ;
/*Set units to dBm* /
viPrintf(viESA,"UNIT :POW DBM\n") ;
/*Perform a peak search * /
viPrintf(viESA,"CALC :MARK :MAX\n") ;
Chapter 3
3-83

Advertisement

Table of Contents
loading

Table of Contents