Specifications

302 Chapter 18
PSA Programming Examples
Using C with the CALCulate:DATA:COMPress? RMS Command
PSA Programming Examples
/* Turn the Display of the instrument back on */
viPrintf(viPSA,"DISP:ENAB 1\n");
/*save result data to an ASCII file*/
fDataFile=fopen("C:\\calccomp.txt","w");
fprintf(fDataFile,"Calccomp.exe Output\nAgilent Technologies 2001\n\n");
fprintf(fDataFile,"Power of %d GSM/EDGE bursts:\n\n",lNumberPoints);
for (i=0;i<lNumberPoints;i++)
{
/* Convert RMS voltage for each burst to Mean Power in dBm */
adPowerArray[i]=10*log10(10*adDataArray[i]*adDataArray[i]);
fprintf(fDataFile,"\tPower of burst[%d] = %.2lf
dBm\n",i+1,adPowerArray[i]);
}
fclose(fDataFile);
/*print message to the standard output*/
printf("The %d burst powers were saved to C:\\calccomp.txt
file.\n\n",lNumberPoints);
viClose (viPSA);
viClose (defaultRM);
}