Agilent Technologies Model A.08.xx Water Dispenser User Manual


 
Chapter 3 147
Programming Examples
Entering Amplitude Correction Data
/*No of amplitude corrections points */
iNoOfPoints = 4;
/* Open a GPIB session at address 18*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA);
if(viStatus)
{
printf("Could not open a session to GPIB device at address 18!\n");
exit(0);
}
/*Clear the instrument*/
viClear(viESA);
/*Reset the instrument*/
viPrintf(viESA,"*RST\n");
/*Display the program heading */
printf("\n\t\t Amplitude Correction Program \n\n" );
/*Set the stop frequency to 1.5 GHz */
viPrintf(viESA,"SENS:FREQ:STOP 1.5 GHz\n");
/* Check for the instrument model number and route the 50MHz signal accordingly*/
Route50MHzSignal();
/* Purge any currently-loaded amplitude correction factors*/
viPrintf(viESA,"SENS:CORR:CSET1:DEL \n");
/* Enter amp cor frequency/amplitude pairs:
0 Hz, 0 dB, 100 MHz, 5 dB, 1 GHz, -5 dB, 1.5GHz,10*/
viPrintf(viESA,"SENS:CORR:CSET1:DATA ");
viPrintf(viESA,"0, 0.0,");
viPrintf(viESA,"100.E6, 5.0,");
viPrintf(viESA,"1.E9, -5.0,");
viPrintf(viESA,"1.5E9, 10 \n");
/* Activate amplitude correction. Notice that the noise floor slopes
up from 0 Hz to 100 MHz, then downward by 10 dB to 1 GHz, then upwards
again by 15 dB to 1.5 GHz.*/
viPrintf(viESA,"SENS:CORR:CSET1:STATE ON \n");
viPrintf(viESA,"SENS:CORR:CSET:ALL:STAT ON \n");
/*Query the analyzer for its amplitude correction factors */
viQueryf(viESA,"SENS:CORR:CSET1:DATA?" , "%s" , &cResult);