Agilent Technologies E4406A VSA Satellite Radio User Manual


 
146 Chapter 3
Programming Examples
Making an ACPR Measurement in cdmaOne (Option BAC)
ViStatus viStatus = 0;
char sTraceInfo [1024]= {0};
FILE *fTraceFile;
unsigned long lBytesRetrieved;
/*open session to GPIB device at address 18 */
viStatus=viOpenDefaultRM (&defaultRM);
viStatus=viOpen (defaultRM, "GPIB0::18::INSTR", VI_NULL,VI_NULL, &viVSA);
/*check opening session sucess*/
if(viStatus)
{
printf("Could not open a session to GPIB device at address 18!\n");
exit(0);
}
/*increase timeout to 60 sec*/
viSetAttribute(viVSA,VI_ATTR_TMO_VALUE,60000);
/*print message to the standard output*/
printf("Getting ACPR measurement results...\nPlease wait...\n\n");
//switch to CDMA MODE
viPrintf(viVSA, "INST CDMA\n");
/* Reset device */
viPrintf(viVSA, "*RST\n");
/*set the analyzer in single mode*/
viPrintf(viVSA, "INIT:CONT 0\n");
/*trigger an ACPR measurement*/
viPrintf(viVSA, "READ:ACPR?;*WAI\n");
/*Get the data into a buffer*/
viRead (viVSA,(ViBuf)sTraceInfo,1024,&lBytesRetrieved);
/*set the analyzer in continuous mode*/
viPrintf(viVSA, "INIT:CONT 1\n");
/*save the data to a file*/
fTraceFile=fopen("C:\\ACPR.txt","w");
fprintf(fTraceFile,"ACPR.exe Output\nAgilent Technnologies 2001\n\n");
fprintf(fTraceFile,"The ACPR Measurement
Result\n----------------------------\n");
fprintf(fTraceFile,sTraceInfo);
fclose(fTraceFile);