EasyManuals Logo

Agilent Technologies EMC Series Programmer's Guide

Agilent Technologies EMC Series
349 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
Page #183 background imageLoading...
Page #183 background image
Chapter 3 183
Programming Examples
Making Faster Measurements (multiple measurements)
dPower = exp( dLogTen * (iArray[iLoop]/10000.0));
if(i > 0) {
dPwrAvgArray[iLoop] += ((dPower - dPwrAvgArray[iLoop])/(i+1));
}
else {
dPwrAvgArray[iLoop] = dPower;
}
}
} /* end of event loop */
/* stop the timer */
ftime( &stop_time );
/* Calculate elapsed time */
if (start_time.millitm > stop_time.millitm) {
stop_time.millitm += 1000;
stop_time.time--;
}
elapsed_time.millitm = stop_time.millitm - start_time.millitm;
elapsed_time.time = stop_time.time - start_time.time;
/* This is measurement time in milliseconds */
dDelta = (1000.0 * elapsed_time.time) + (elapsed_time.millitm);
/* show measurement statistics */
dTimePer=dDelta/((float)iNumTraces);
printf("\tPower average of %i %i-point traces performed in %3.1f
seconds\n",iNumTraces,iNumPoints,dDelta/1000);
printf("\t%6.1f milliseconds per averaged measurement\n",dTimePer);
printf("\t%6.1f averaged measurements per second\n",1000.0/dTimePer);
printf("\t%i bytes transferred per trace, %i bytes total\n\n",lRetCount,
iTotalRetCount);
return;
}
/******************************** Main ******************************/
void main(void) {
int iLoop;
int iAvgArray[NUM_POINTS];
ViStatus viStatus;
/* Open a GPIB session at address 18 */
viStatus = viOpenDefaultRM(&defaultRM);
viStatus = viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA);
if(viStatus)
{

Table of Contents

Other manuals for Agilent Technologies EMC Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies EMC Series and is the answer not in the manual?

Agilent Technologies EMC Series Specifications

General IconGeneral
BrandAgilent Technologies
ModelEMC Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals