Specifications
294 Chapter 18
PSA Programming Examples
Using C to Make a Power Calibration Measurement for a GSM Mobile
Handset
PSA Programming Examples
/*check opening session sucess*/
if(viStatus)
{
printf("Could not open a session to GPIB device at address 18!\n");
exit(0);
}
/* Set I/O timeout to ten seconds */
viSetAttribute(viVSA,VI_ATTR_TMO_VALUE,10000);
viClear(viVSA);//send device clear to instrument
/*print message to the standard output*/
printf("Enter number of bursts per frame (1,2,4 or 8): ");
scanf( "%ld",&lbursts);
/* Send setup commands to instrument */
viPrintf(viVSA,"%s\n",basicSetup);
/* Calculate sweep time and set it*/
burstinterval = 4.6153846 / 1000.00 / lbursts;
sweeptime= burstinterval * 75.0;
viPrintf(viVSA,":WAV:SWE:TIME %fs\n",sweeptime);
/* Clear status event register */
viQueryf(viVSA,"STAT:OPER:EVENT?\n","%ld",<hrowaway);
/* Initiate the waveform measurement and get the instrument ready
to calculate the mean RMS I/Q voltage in each burst
(We will convert these discreate values into Mean dBm Power values) */
viPrintf(viVSA,"INIT:IMM\n");
/* Serial poll the instrument to determine when it is waiting for
trigger and the GSM phone can be told to send its 75 bursts. */