13-18
IM 253421-01E
13.2 Sample Program
GOTO DISPDATA
ELSEIF C$ = "3" THEN
WRT$ = "CR2"
CALL IBWRT(DEV%, WRT$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt error")
GOTO DISPDATA
ELSEIF C$ = "4" THEN
WRT$ = "CR3"
CALL IBWRT(DEV%, WRT$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt error")
GOTO DISPDATA
ELSEIF C$ = "5" THEN
WRT$ = "CR6"
CALL IBWRT(DEV%, WRT$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt error")
GOTO DISPDATA
ELSEIF C$ = "S" THEN
WRT$ = "END"
CALL IBWRT(DEV%, WRT$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt error")
GOTO ENDRANGE
ELSEIF C$ = "C" THEN
WRT$ = "CAN"
CALL IBWRT(DEV%, WRT$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt error")
GOTO ENDRANGE
END IF
GOTO RANGESEL
DISPDATA:
GOSUB ODDISP
IF RTN = 0 THEN GOTO RANGESEL
IF RTN = 1 THEN GOTO ENDRANGE
ENDRANGE:
RETURN
' adjust sensor range
SHUNT:
CAL2WRT:
WRT$ = "CAL2"
CALL IBWRT(DEV%, WRT$)
IF (ibsta% AND EERR) THEN CALL gpiberr("Ibwrt error")
GOSUB ODDISPEX
IF RTN = 0 THEN GOTO CAL2WRT
IF RTN = 1 THEN GOTO ENDSHUNT
ENDSHUNT:
RETURN
' wait input from keyboard
WAITING:
C$ = ""
FOR J = 0 TO 500
C$ = INKEY$: IF C$ <> "" THEN GOTO PRTCOMMAND
NEXT J
PRTCOMMAND:
IF C$ <> "" THEN PRINT C$
RETURN