EasyManua.ls Logo

Fluke 54200 - Page 256

Fluke 54200
386 pages
Print Icon
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...
54200
Users Manual
6-48
SUB RecDat (Rsp%)
SHARED stb%, ErrSts%
Tr = TIMER
RD$ = ""
C$ = ""
DO UNTIL (C$ = CHR$(10) OR (TIMER - Tr > 3))
IF LOC(1) > 0 THEN
C$ = INPUT$(1, #1)
IF C$ <> CHR$(10) THEN
RD$ = RD$ + C$
C$ = ""
END IF
END IF
LOOP
IF (TIMER - Tr > 3) THEN
ErrSts% = 1
PRINT "**** receive timeout ****"
PRINT
ELSE
ErrSts% = 0
IF Rsp% = 0 THEN
stb% = VAL(RD$)
ELSE
PRINT
PRINT "RESPONSE : " + RD$ 'response string
PRINT
END IF
END IF
END SUB
SUB SendCmd (Cmd%, Rsp%)
'Send command string to instrument via serial bus without response
WR$ = CHR$(27) + CHR$(Cmd% + 48)
PRINT #1, WR$ 'output command string
IF Cmd% = 7 THEN 'if statusbyte requested
CALL RecDat(Rsp%) 'get status byte
END IF
END SUB
SUB SendStr (WR$)
'Send command string to instrument via serial bus with response
SHARED stb%
qry = 0 'query flag
WR$ = WR$ + CHR$(10) 'append LF
PRINT #1, WR$ 'output command string
IF INSTR(WR$, "?") > 0 THEN 'check if query command
CALL RecDat(1) 'get response string
END IF
stb% = 0
CALL SendCmd(7, 0) 'ask for status byte
IF (stb% AND 16) THEN 'checks whether MAV is set
qry = 1
END IF
IF (stb% AND 32) THEN 'checks whether ESB is set
BEEP
WR$ = "err?" + CHR$(10) 'error query
PRINT #1, WR$ 'output command string
qry = 1
END IF
IF qry = 1 THEN
CALL RecDat(1) 'get error string

Table of Contents