Agilent Technologies E4406A VSA Satellite Radio User Manual


 
138 Chapter 3
Programming Examples
Saving ASCII Trace Data in an ASCII File
/*query the spectrum trace data*/
viPrintf(viVSA, "FETCH:SPEC7?\n");
/*save the spectrum trace data to buffer*/
viRead (viVSA,(ViBuf)sTraceBuffer,1024*100,&lBytesRetrieved);
/*set the analyzer back to continuous mode*/
viPrintf(viVSA, "INIT:CONT 1\n");
/*save trace data to an ASCII file*/
fTraceFile=fopen("C:\\TraceASC.txt","w");
fprintf(fTraceFile,"TraceASC.exe Output\nAgilent Techonologies 2001\n\n");
fprintf(fTraceFile,"Please refer to the PROGRAMMERS GUIDE to read about:
FETCH:SPEC[n]\n\n");
fprintf(fTraceFile,"The trace information: n=1\n----------------------------\n");
fprintf(fTraceFile,sTraceInfo);
fprintf(fTraceFile,"\n\nThe averaged spectrum trace data:
n=7\n----------------------------\n\n");
fprintf(fTraceFile,sTraceBuffer);
fprintf(fTraceFile,"\n----------------------------\nEnd of the trace data");
fclose(fTraceFile);
/*print message to the standard output*/
printf("The spectrum information was saved to C:\\TraceASC.txt file\n\n");
/* Close session */
viClose (viVSA);
viClose (defaultRM);
}