EasyManua.ls Logo

Keithley 2002

Keithley 2002
114 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
Loading...
Calibration Programs
B-16
keypress();
break;
}
if (i!=0 && i!=14 && i!=15 && i!=26 && i!=28) settle();
if (i>2 && i<9)
fprintf(ieeeout,"output 16;%s%s;*opc\n",cmd[i],buf);
else fprintf(ieeeout,"output 16;%s;*opc\n",cmd[i]);
calend(i);
errcheck();
}
printf("Enter calibration date (yyyy,mm,dd): ");
gets(date);
fprintf(ieeeout,"output 16;:cal:prot:date %s\n",date);
errcheck();
printf("Enter calibration due date (yyyy,mm,dd): ");
gets(date);
fprintf(ieeeout,"output 16;:cal:prot:ndue %s\n",date);
errcheck();
fprintf(ieeeout,"output 16;:cal:prot:save\n");
errcheck();
fprintf(ieeeout,"output 16;:cal:prot:lock\n");
fprintf(ieeeout,"output 16;:syst:pres\n");
fprintf(ieeeout,"local 4 16\n");
printf("Calibration completed.\n");
fclose(ieeein);
fclose(ieeeout);
}
void keypress() /* Wait for keypress. */
{
printf("\nPress any key to continue (ESC to abort).\n");
while(kbhit()==0);
if (getch()==27) endpgm();
}
int calend(n) /* Check for cal end. */
int n;
{
int stat;
printf("Performing calibration step #%d.\n",n+1);
do {
fprintf(ieeeout,"srq?\n");
fscanf(ieeein,"%d",&stat);
}
while (stat==0);
fprintf(ieeeout,"output 16;*esr?\n");
fprintf(ieeeout,"enter 16\n");
fscanf(ieeein,"%d",&stat);
fprintf(ieeeout,"spoll 16\n");
fscanf(ieeein,"%d",&stat);
}
void errcheck() /* Check for error. */
{
char errbuf[100];
fprintf(ieeeout,"output 16;:syst:err?\n");
fprintf(ieeeout,"enter 16\n");
fgets(errbuf,100,ieeein);
if (atoi(errbuf) !=0) printf("\n%s\n",errbuf);
}
void chkswit() /* Check cal switch. */
{
int swit;
fprintf(ieeeout,"output 16;:cal:prot:llev:swit?\n");
fprintf(ieeeout,"enter 16\n");
fscanf(ieeein,"%d",&swit);
if (swit==0){
printf("Calibration is locked.\n"
"To unlock, hold in CAL while turning on "
"power, then restart program.\n");
exit (1);

Table of Contents

Other manuals for Keithley 2002

Related product manuals