Specifications
Chapter 16 177
ESA/PSA Programming Examples
Using C to Make a Power Suite ACPR Measurement on a cdmaOne Signal
ESA/PSA Programming Examples
int iSwpPnts = 401;
double freq,value;
static ViChar *cToken ;
long lCount=0L;
char sTraceInfo [1024]= {0};
FILE *fDataFile;
unsigned long lBytesRetrieved;
char *psaSetup = // PSA setup initialization
"*RST;*CLS;" // Reset the device and clear status
":INIT:CONT 0;"// Set analyzer to single sweep mode
":RADIO:STANDARD IS95";// Set the Radio Standard to IS95
/*open session to GPIB device at address 18 */
viStatus=viOpenDefaultRM (&defaultRM);
viStatus=viOpen (defaultRM, "GPIB0::18::INSTR", 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);
}
/*Increase timeout to 20 sec*/
viSetAttribute(viPSA,VI_ATTR_TMO_VALUE,20000);
/*Send setup commands to instrument */
viPrintf(viPSA,"%s\n",psaSetup);
/*Get the center freq from user*/
printf("What is the center carrier frequency in MHz?\n");
scanf( "%lf",&freq);
/*Set the center freq*/
viPrintf(viPSA,"freq:center %lf MHZ\n",freq);
/*Perform an ACPR measurement*/