EasyManua.ls Logo

Agilent Technologies E4406A VSA Series - Page 135

Agilent Technologies E4406A VSA Series
420 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 3 135
Programming Examples
Saving ASCII Trace Data in an ASCII File
/*query the spectrum trace information*/
viPrintf(viVSA, "FETCH:SPEC1?\n");
/*save the info trace to buffer*/
viRead (viVSA,(ViBuf)sTraceInfo,256,&lBytesRetrieved);
/*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 instrument back to continuous mode*/
viPrintf(viVSA, "INIT:CONT 1\n");
/*save trace data to an ASCII file*/
fTraceFile=fopen("C:\\HPE4406ATraceASCII.txt",
"w");
fprintf(fTraceFile,"HPE4406ATraceASCII.exe
Output\nHewlett-Packard 1998\n\n");
fprintf(fTraceFile,"Please refer to the PROGRAMMER'S
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:\\HPE4406ATraceASCII.txt file\n\n");
/* close session */
viClose (viVSA);
viClose (defaultRM);
}

Table of Contents

Other manuals for Agilent Technologies E4406A VSA Series

Related product manuals