' | SUBROUTINES |
' These subroutines are also used by other example programs.
' | Get ASCII response from 4071 |
'Wait for an incoming char, then collect incoming stuff until we get a
'800 mS Rx char
'Returns with a$ = received stuff
GetResponse1:
IF | LOC(1) = 0 THEN GOTO GetResponse1 | ' Wait for incoming char | |
a$ = "" |
|
| |
GetRespLoop1: |
|
| |
a$ = a$ + INPUT$(LOC(1), #1) | ' Get all waiting chars in Rx buffer | ||
' Now wait for a | |||
CALL Delay(.8) | ' Do a 800 mS delay | ||
IF LOC(1) <> 0 THEN GOTO GetRespLoop1 | ' If something came in during | ||
RETURN |
| ' our | |
|
| ||
|
| ||
' | Wait for a command prompt from 4071 |
' Returns A$ = all stuff received before the command prompt.
PromptWait:
' If we have no chars in Rx buffer, wait until we have 1 or more
a$ = ""
PromptWaitLoop:
IF LOC(1) = 0 THEN GOTO PromptWaitLoop
a$ = a$ + INPUT$(LOC(1), #1) ' Get all waiting chars in Rx buffer
IF INSTR(a$, ">") THEN GOTO GotPrompt
GOTO PromptWaitLoop
'Here we got a prompt. Exit GotPrompt:
RETURN
75
BK Precision 4071 User Manual Rev.2.2