HP ESA-E Series Programmer's Manual page 148

Esa spectrum analyzers
Table of Contents

Advertisement

Programming Examples
Measuring Harmonic Distortion (RS-232)
calculation).*/
viPrintf(viESA,"CALC:MARK:Y?\n");
viScanf(viESA,"%lf",&dFundaAmptdV);
dFundamental = dMarkerFreq;
/*Change the center frequency step size equal to the
marker frequency. */
viPrintf(viESA,"CALC:MARK:SET:STEP \n");
/*Measure each harmonic amplitude as follows: */
for ( lNum=2;lNum<=lMaxHarmonic;lNum++)
{
/*Measuring the Harmonic No#[%d] message */
printf("Measuring the Harmonic No [%d] \n",lNum );
/*Set the span to 20 MHz*/
viPrintf(viESA,"SENS:FREQ:SPAN 20 MHZ \n");
/*Increment the center frequency. The new center
frequency should
roughly equal the frequency of the next harmonic. */
viPrintf(viESA,"SENS:FREQ:CENT UP \n");
/*Take a sweep and wait for the sweep completion*/
TakeSweep();
/*Perform a peak search and wait for completion */
viPrintf(viESA,"CALC:MARK:MAX;*OPC?\n");
viScanf(viESA,"%d",&lOpc);
dFundamental = dMarkerFreq;
/*Change the center frequency step size equal to the
marker frequency. */
viPrintf(viESA,"CALC:MARK:SET:STEP \n");
/*Measure each harmonic amplitude as follows: */
for ( lNum=2;lNum<=lMaxHarmonic;lNum++)
{
/*Measuring the Harmonic No#[%d] message */
printf("Measuring the Harmonic No [%d] \n",lNum );
/*Set the span to 20 MHz*/
viPrintf(viESA,"SENS:FREQ:SPAN 20 MHZ \n");
/*Increment the center frequency. The new center
frequency should roughly equal the frequency of the next
harmonic. */
viPrintf(viESA,"SENS:FREQ:CENT UP \n");
/*Take a sweep and wait for the sweep completion*/
TakeSweep();
3-84
Chapter 3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents