
Calibration Programs
B-10
Program B-4. Calibration Program for Use with Fluke 5700A Calibrator (Turbo C Version) Continued
if(i==3) ieeewt("output 04;out 0.2 v,0 hz\n");
printf("%s\n",msg[i]);
if (i<6) keypress();
if (i<6) delay(5000);
ieeeprtf("output 16;%s;*opc\n",cmd[i]);
calend(i);
}
ieeewt("output 04;stby\n");
errcheck();
printf("Enter calibration date (mm/dd/yy): ");
scanf("%s",date);
ieeeprtf("output 16;:cal:unpr:pre:date '%s’\n",date);
printf("Enter calibration due date (mm/dd/yy): ");
scanf("%s",date);
ieeeprtf("output 16;:cal:unpr:pre:ndue '%s’\n",date);
ieeewt("output 16;:cal:unpr:pre:save\n");
printf("Calibration completed.\n");
}
void keypress()
/* Wait for keypress. */
{
printf("Press any key to continue.\n");
while(kbhit()==0);
getch();
}
int calend(n)
/* Check for cal end. */
int n;
{
char status[40];
int stat;
printf("Waiting for cal step %d completion.\n",n+1);
do {
ieeewt("status\n");
ieeerd(status);
}
while (status[11]==’0’);
ieeewt("output 16;*esr?\n");
ieeewt("enter 16\n");
ieeescnf("%d",&stat);
ieeewt("spoll 16\n");
ieeescnf("%d",&stat);
}
void errcheck()
/* Check for error. */
{
char errbuf[100];
ieeewt("output 16;:syst:err?\n");
ieeewt("enter 16\n");
ieeerd(errbuf);
if (atoi(errbuf) !=0){
printf("%s\n",errbuf);
printf("Calibration aborted.\n");
exit (1);
}
}
void checkopt()
/* Check for 1801. */
{