Specifications
Chapter 18 299
PSA Programming Examples
Using C with the CALCulate:DATA:COMPress? RMS Command
PSA Programming Examples
":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: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,&viPSA);
/*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(viPSA,VI_ATTR_TMO_VALUE,10000);
viClear(viPSA);//send device clear to instrument
/*print message to the standard output*/
printf("Enter number of bursts (1 to 450) to calculate mean power for: ");
scanf( "%ld",&lbursts);