Chapter 3
129
Programming Examples
Using Markers
viPrintf(viVSA, "CALC:SPEC:MARK1:MAX\n");
/*query the 50 MHz signal amplitude*/
viPrintf(viVSA, "CALC:SPEC:MARK1:Y?\n");
/*get the 50 MHz signal amplitude*/
viScanf (viVSA,"%lf",&dPeakPower);
/*assign marker 2 to the average trace of the spectrum*/
viPrintf(viVSA, "CALC:SPEC:MARK2:TRAC ASP\n");
/*assign the marker function NOISE to marker 2 */
viPrintf(viVSA, "CALC:SPEC:MARK2:FUNC NOISE\n");
/*position marker 2 on the noise floor*/
viPrintf(viVSA, "CALC:SPEC:MARK2:X 50.2E6\n");
/*query NOISE marker*/
viPrintf(viVSA, "CALC:SPEC:MARK2:FUNC:RES?\n");
/*get the the NOISE marker reading*/
viPrintf (viVSA,"%lf",&dNoiseMarker);
/*put the instrument back to continuous mode*/
viScanf (viVSA,"INIT:CONT 1\n");
/*calculate the difference between the marker peak and
the NOISE marker*/
dResult = fabs(dNoiseMarker - dPeakPower);
/*print result to the standard output*/
printf("The Peak Marker measured = %.2lf
dBm\n",dPeakPower);
printf("The Noise Marker at 50.2 MHz measured = %.2lf
dBm/Hz\n",dNoiseMarker);
printf("The difference between the Peak and the Noise
Floor = %.2lf dBc/Hz\n\n",dResult);
/* close session */
viClose (viVSA);
viClose (defaultRM);
}
Summary of Contents for E4406A VSA Series
Page 4: ...4 ...
Page 59: ...59 2 Programming Fundamentals ...
Page 124: ...124 Chapter2 Programming Fundamentals Using the LAN to Control the Analyzer ...
Page 125: ...125 3 Programming Examples ...
Page 164: ...164 Chapter3 Programming Examples Using Java Programming Over Socket LAN ...
Page 165: ...165 4 Programming Command Cross References ...
Page 379: ...379 6 Error Messages ...
Page 412: ...412 Chapter6 Error Messages Error Message Descriptions ...