500INPUT "ENTER VALUE OF CURRENT SHUNT BEING USED",Shunt_val
510OUTPUT @Ps;"CAL:CURRENT:LEVEL MIN"
520INPUT "ENTER VOLTAGE MEASUREMENT FROM EXTERNAL VOLTMETER",Volt_read
530Current=Volt_read/Shunt_val
540OUTPUT @Ps;"CAL:CURRENT ";Current
550OUTPUT @Ps;"CAL:CURRENT:LEVEL MAX"
560INPUT "ENTER VOLTAGE MEASUREMENT FROM EXTERNAL VOLTMETER",Volt_read
570Current=Volt_read/Shunt_val
580OUTPUT @Ps;"CAL:CURRENT ";Current
590GOSUB Save_cal
600IF Err_found THEN
610 | INPUT "ERRORS have occurred, REPEAT CURRENT |
CALIBRATION (Y OR N)?",Resp$ | |
620 | IF TRIM$(UPC$(Resp$[ l,l ]))="Y" THEN GOTO |
Current_cal | |
630 | END IF |
640 | IF Err_found THEN |
650 | PRINT "CURRENT CALIBRATION NOT SAVED" |
660 | ELSE |
670 | PRINT "CURRENT CALIBRATION COMPLETE" |
680END IF
690STOP
700 | Save_cal: | ! SAVE CALIBRATION CONSTANTS |
710 |
| REPEAT |
720 |
| OUTPUT @Ps;"SYSTEM:ERROR?" |
730 |
| ENTER @Ps;Err_num,Err_msg$ |
740 |
| IF Err_num<>0 THEN |
750 |
| PRINT "ERROR: ";Err_msg$ |
760 |
| Err_found=l |
770 |
| END IF |
780 |
| UNTIL Err_num=0 |
790 |
| IF NOT Err_found THEN |
800 |
| INPUT "SAVE CALIBRATION CONSTANTS (Y OR N)?",Resp$ |
810 |
| IF TRIM$(UPC$(Resp$[1,1]))="Y" THEN |
820 |
| OUTPUT @Ps;"CAL:SAVE" |
830 |
| END IF |
840 |
| END IF |
850 |
| OUTPUT @Ps;"CAL:STATE 0" |
860 |
| RETURN |
870 | END |
|
Figure A-2. Agilent BASIC Calibration Program (continued)
40 Calibration