ibrd(counter, reading, 29L);
for (j=0; j<8; j++) {
Result.c[j] = reading[3+j];
}
if (i%50 == 0) printf(“Result %d: %e\n”, i, Result.d);
}
Stop = clock();
printf (“Total time %d ms (%f samples /s)\n”, Stop- Start,
(double)1000.0/(Stop-Start)*1000);
ibwrite(counter, “DISP:ENAB ON”);
do {
ibwrite(counter, “syst:err?”);
ibrd(counter, buf, 100L); buf[ibcnt]=0;
printf(“End error: %s\n”, buf);
} while (atoi(buf)!=0);
ibonl(counter, 0);
}
/********************
* Support functions *
********************/
void ibwrite(int counter, const char *string) {
ibwrt(counter, string, strlen(string));
}
void sleep (long mswait) {
time_t EndWait = clock() + mswait *
(CLOCKS_PER_SEC/1000);
while (clock() < EndWait);
}
Programming Examples
4-10 Fast Measurements (Ex. #3)