![HP E4401B Скачать руководство пользователя страница 149](http://html.mh-extra.com/html/hp/e4401b/e4401b_programmers-manual_161548149.webp)
Chapter 3
3-85
Programming Examples
Measuring Harmonic Distortion (RS-232)
/*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");
/*Take a sweep and wait for the sweep completion*/
TakeSweep();
/*Query and read the marker amplitude in volts*/
/*Store the result in the fHarmV array.*/
viQueryf(viESA,"CALC:MARK:Y?\n","%1f",
&fHarmV[lNum]);
/*Change the amplitude units to dBm */
viPrintf(viESA,"UNIT:POW DBM; \n");
/*Take a sweep and wait for the sweep completion*/
TakeSweep();
/* Read the marker amplitude */
viQueryf(viESA,"CALC:MARK:Y?\n","%1f",
&fHarmDbm[lNum]);
}
/*Sum the square of each element in the fHarmV array and
calculate the relative amplitude of each harmonic relative to
the fundamental*/
for (lNum=2;lNum<=lMaxHarmonic;lNum++)
{
dSumSquare= dSum (pow (double(fHarmV[lNum])
,2.0));
/* Relative Amplitude */
fRelAmptd[lNum] = fHarmDbm[lNum] - fFundaAmptdDbm ;
}
Содержание E4401B
Страница 6: ...vi ...
Страница 14: ...xiv Contents ...
Страница 64: ...2 34 Chapter2 HP ESA Status Registers Using the Analyzer Status Registers ...
Страница 65: ...3 1 3 Programming Examples ...
Страница 118: ...3 54 Chapter3 Programming Examples Entering Amplitude Correction Data Close the session viClose viESA viClose defaultRM ...
Страница 151: ...4 1 4 Programming Command Cross References ...
Страница 286: ...5 132 Chapter5 Language Reference UNIT Subsystem ...
Страница 287: ...6 1 6 HP 8590 HP ESA Spectrum Analyzers Programming Conversion Guide ...
Страница 292: ...1 HP 8590 HP ESA Spectrum Analyzers Conversion Guide ...
Страница 368: ...7 1 7 Error Messages ...
Страница 393: ...7 26 Chapter7 Error Messages 201 to 799 Device Specific Errors ...