D-4 Calibration Program
IF I=0 OR I=4 OR I=7 OR I=9 OR I=13 OR I=16 THEN ' Prompt for test connections.
READ Msg$
PRINT Msg$
GOSUB KeyCheck
END IF
I$ = STR$(I): C1$ = C$ + RIGHT$(I$, LEN(I$) - 1)
SELECT CASE I ' Build command string.
CASE 0, 9
Cmd$ = C1$ + " 14"
CASE 1, 2, 5, 6, 8, 10, 11, 14, 15, 17
GOSUB ReadDMM
Cmd$ = C1$ + " " + Reading$
CASE 3, 7, 12, 16
Cmd$ = C1$
CASE 4, 13
Cmd$ = C1$ + " 1.9"
END SELECT
PRINT #1, "OUTPUT 16;"; Cmd$; ";*OPC" ' Send command string to 2306.
GOSUB ErrCheck
GOSUB CalEnd
NEXT I
LINE INPUT "Enter calibration date (yyyy,mm,dd): "; D$
PRINT #1, "OUTPUT 16;:CAL:PROT:DATE "; D$
PRINT #1, "OUTPUT 16;:CAL:PROT:SAVE" ' Save calibration constants.
PRINT #1, "OUTPUT 16;:CAL:PROT:LOCK" ' Lock out calibration.
GOSUB ErrCheck
PRINT "Calibration completed."
PRINT #1, "LOCAL 16 17"
CLOSE
END
'
KeyCheck: ' Check for key press routine.
WHILE INKEY$ <> "": WEND ' Flush keyboard buffer.
PRINT : PRINT "Press any key to continue (ESC to abort program)."
DO: I$ = INKEY$: LOOP WHILE I$ = ""
IF I$ = CHR$(27) THEN GOTO EndProg ' Abort if ESC is pressed.
RETURN
'
CalEnd: ' Check for cal step completion.
DO: PRINT #1, "SRQ?" ' Request SRQ status.
INPUT #2, S ' Input SRQ status byte.
LOOP UNTIL S ' Wait for operation complete.
PRINT #1, "OUTPUT 16;*ESR?" ' Clear OPC.
PRINT #1, "ENTER 16"
INPUT #2, S
PRINT #1, "SPOLL 16" ' Clear SRQ.
INPUT #2, S
RETURN
'
Test Equipment Depot - 800.517.8431 - 99 Washington Street Melrose, MA 02176
TestEquipmentDepot.com