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

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

Advertisement

Programming Examples
Making Faster Measurements (multiple measurements )
/* select the byte order ; low-byte first for Intel platforms
1* To further increase measurement rate, :FORM :BORD NORM coul d
/* be used instead . The byte ordering would then need to b e
/* done within this program .
viPrintf(viESA, " :FORM :BORD SWAP\n") ;
/* pre-calculate amount of data to be transferred per measurement
*/
iTermLength = 1 ;
iArrayLength = iNumPoints * DATA LENGTH ;
iHeaderLength = HeaderLength(iArrayLength) ;
iBlockSize = iHeaderLength + iArrayLength + iTermLength ;
}
/****************
Write binary trace data to ESA
*************** /
void write binary_trace(char *cScpiCommand, int *ipTraceData)
{
/* trace data must point to an integer array of size NUM POINTS
*/
memcpy(&cOutBuffer[strlen(cScpiCommand)], ipTraceData, iArrayLength) ;
memcpy(&cOutBuffer, cScpiCommand, strlen(cScpiCommand)) ;
/* Add a <newline> to the end of the data, This isn't necessar y
/* if the GPIB card has been configured to assert EOI when the las t
/* character is sent, but it ensures a valid terminator is provided .
cOutBuffer[iArrayLength + strlen(cScpiCommand)] = OxOA;
iBlockSize = (strlen(cScpiCommand) + iArrayLength + 1) ;
viWrite(viESA,(ViBuf) cOutBuffer, iBlockSize, &lRetCount ) ;
}
/***** Measure and calculate power-average of multiple measurement s
void average()
{
int i=0, iLoop=0 ;
int iArray[NUM POINTS] ;
long lOpc =0L ;
double dLogTen = log(10 .0) ;
setup() ;
iTotalRetCount = lRetCount = 0 ;
/* start the timer
ftime( &start_time ) ;
/* Now run through the event loop iNumTraces times
******* /
*/
3-92
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents