Agilent Technologies ESA-E Series Programmer's Manual page 103

Esa spectrum analyzers
Hide thumbs Also See for ESA-E Series:
Table of Contents

Advertisement

Programming Examples
Reading Trace Data Using 32-bit Real Format (RS-232 )
/*Increase timeout to 60 sec* /
viSetAttribute(viESA,VI ATTR
TMO
VALUE,60000) ;
/*Set RS-232 interface to terminate when the buffer is empty* /
viSetAttribute(viESA,VI ATTR ASRL END IN,VI ASRL END NONE) ;
/*Get trace header data and trace data* /
viPrintf(viESA,"TRAC :DATA? TRACE1\n") ;
viRead (viESA,(ViBuf)cResult,iSize,&lRetCount) ;
/*Reset timeout to 3 sec* /
viSetAttribute(viESA,VI ATTR
TMO
VALUE,3000) ;
/*Extract the trace data* /
memcpy(dTraceArray,cResult+iHeaderBytes,(size_t)1NUmberBytes) ;
/*Save trace data to an ASCII file* /
fTraceFile=fopen("C :\\temp\\ReadTrace32Rs232 .txt","w") ;
fprintf(fTraceFile,"ReadTrace32Rs232 .exe Output\nHewlett-Packard 1999\n\n") ;
fprintf(fTraceFile,"The %d trace data points of th e
spectrum :\n\n",(lNumberBytes/4)) ;
for ( long i=0 ;i<lNumberBytes/iBytesPerPnt ;i++ )
fprintf(f racer`•iie,"\teanpiituae of point[%a] = % .21 f
dBm\n",i+1,dTraceArray[i]) ;
fclose(fTraceFile) ;
/*Close the session* /
viClose(viESA) ;
viClose(defaultRM) ;
}
Chapter 3
3-43

Advertisement

Table of Contents
loading

Table of Contents