![HP E4401B Programmer'S Manual Download Page 139](http://html.mh-extra.com/html/hp/e4401b/e4401b_programmers-manual_161548139.webp)
Chapter 3
3-75
Programming Examples
Measuring Harmonic Distortion (HP-IB)
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; lNum2=MaxHarmonic; iNum+l)
{
/*Measuring the Harmonic No#[%d] message */
printf("Measuring the Harmonic No [%d] \n",iNum );
/*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);
/*Activate signal track */
viPrintf(viESA,"CALC:MARK:TRCK:STAT ON \n");
/*Zoom down to a 100 kHz span */
viPrintf(viESA,"SENS:FREQ:SPAN 10e4; \n");
/*Take a sweep and wait for the sweep completion*/
TakeSweep();
/* Signal track off */
viPrintf(viESA,"CALC:MARK:TRCK:STAT OFF ;\n");
/*Perform a peak search and wait for completion*/
viPrintf(viESA,"CALC:MARK:MAX \n");
/*Set Marker Amplitude in volts*/
viPrintf(viESA,"UNIT:POW V; \n");
Summary of Contents for E4401B
Page 6: ...vi ...
Page 14: ...xiv Contents ...
Page 64: ...2 34 Chapter2 HP ESA Status Registers Using the Analyzer Status Registers ...
Page 65: ...3 1 3 Programming Examples ...
Page 151: ...4 1 4 Programming Command Cross References ...
Page 286: ...5 132 Chapter5 Language Reference UNIT Subsystem ...
Page 287: ...6 1 6 HP 8590 HP ESA Spectrum Analyzers Programming Conversion Guide ...
Page 292: ...1 HP 8590 HP ESA Spectrum Analyzers Conversion Guide ...
Page 368: ...7 1 7 Error Messages ...
Page 393: ...7 26 Chapter7 Error Messages 201 to 799 Device Specific Errors ...