Agilent Technologies Model A.08.xx Water Dispenser User Manual


 
Chapter 3 179
Programming Examples
Making Faster Measurements (multiple measurements)
*/
int iNumTraces = NUM_TRACES,/* number of traces to average
*/
iRbw = RBW, /* resolution bandwidth */
iNumPoints = NUM_POINTS,/* actual number of trace points per sweep
*/
iSpan = SPAN, /* Analyzer Frequency Span in MHz */
iCenter = CENTER; /* Analyzer Center frequency in MHz
*/
int iResult =0;
unsigned long lRetCount; /* the number of bytes transferred in one trace record
*/
double dDelta, dTimePer, dPower;
struct timeb start_time, stop_time, elapsed_time;
char cCommand[100];
char cBuffer[100];
char cEnter;
double dPwrAvgArray[MAX_POINTS];
ViUInt32 iHeaderLength, /* header is "#nyyy..." n is number of chars in yyy,
*/
/* yyy is the total data length in bytes */
iArrayLength, /* iArrayLength is number of bytes of data
*/
iTermLength = 1, /* the response message includes a LF character
*/
iBlockSize, /* number of bytes expected in one trace definite block
*/
iTotalRetCount; /* total number of bytes actually transferred
*/
ViSession defaultRM, viESA;
/* reserve space for the header, data and terminator */
ViChar cInBuffer[sizeof("#nyyyyl") + (MAX_POINTS * DATA_LENGTH) ];
ViChar cOutBuffer[sizeof("TRAC:DATA TRACE2,#nyyyyl") + (MAX_POINTS * DATA_LENGTH
) ];
/****************** Calculate length byte in block header
***********************/
int HeaderLength(int iArrayLength) {
int iHeaderLength;