Specifications

Chapter 18 293
PSA Programming Examples
Using C to Make a Power Calibration Measurement for a GSM Mobile
Handset
PSA Programming Examples
long i = 0;
long lOpc = 0L;
double sweeptime = 0;
double burstinterval= 0;
unsigned long lBytesRetrieved;
ViReal64 adDataArray[100];
char sBuffer[80]= {0};
char *basicSetup = // measurement setup commands for VSA/PSA
":INST:SEL BASIC;"// Put the instrument in Basic Mode
"*RST; "// Preset the instrument
"*CLS; "//Clear the status byte
":STAT:OPER:ENAB 32;" //Enable Status Operation
":DISP:ENAB 0;"// Turn the Display off (improves Speed)
":FORM REAL,64;"// Set the ouput format to binary
":FORM:BORD SWAP;"// set the binary byte order to SWAP (for PC)
":CONF:WAV;"// Changes measurement to Waveform
":INIT:CONT 0;"// Puts instrument in single measurement mode
":CAL:AUTO OFF;"//Turn auto align off
":FREQ:CENTER 935.2MHz;"//Set Center Freq to 935.2MHz
":WAV:ACQ:PACK MED;"//Set DataPacking to Medium
":WAV:BAND:TYPE FLAT;"//Select Flattop RBW Filter
":WAV:DEC:FACT 4;"//Set Decimation Factor to 4
":WAV:DEC:STAT ON;"//Turn Decimation On
":DISP:WAV:WIND1:TRAC:Y:RLEV 5;" //Set referance level to 5 dBm
":WAV:BWID:RES 300kHz;"//Set Res bandwith filter to 300kHz
":POW:RF:ATT 5;"//Set 5dB of internal attenuation
":WAV:ADC:RANG P0;"//Set ADC Range to P0, This is
//necessary to prevent autoranging
":WAV:TRIG:SOUR IF;"//Set Trigger source to IF burst
":TRIG:SEQ:IF:LEV -20;";//Set IF Trig level to -20dB
/*open session to GPIB device at address 18 */
viStatus=viOpenDefaultRM (&defaultRM);
viStatus=viOpen (defaultRM, "GPIB0::18", VI_NULL,VI_NULL,&viVSA);