Detecting Connection With A Host Computer - HP 82718A Expansion Pod Reference Manual

For use with the hp-75
Hide thumbs Also See for HP 82718A Expansion Pod:
Table of Contents

Advertisement

Software Usage and Examples
20 IF t'lOD I
~'4$#
/I
~·~OK
/I
A~·m
t'10D I
~'4$#
/I
~'A
THE~'4
20
The first
t'lOD H4$
would read the buffer and empty it, comparing the data to
%OK.
The secona
t'1OD I N$
would not have any data to read. Consequently, whenever data appeared in the buffer, it
would be examined to see if it contained
%OK
or
%4;,
but not both.
If
you know that the modem is reporting long responses (the default behavior), the simplest routine is:
10 MODEM OFF
~
MODEM ON
20 IF t'10D H4::t#
/I
~·~OK
/I
THE~'4
2(1
If short responses are known, substitute
%4
for
%OK.
This is almost the same as the original "obvious" approach to waiting for the modem to be ready. As
you
now understand, there are two reasons it works:
(1)
the modem was off before it was turned on, and (2) the
modem is reporting long responses. There are actually two additional reasons it works. These will be
discussed under "Reading Modem Responses."
If
you always want to force the modem into a known state, you can use the following routine.
I
~.~
I T I AL I ZE
/ I :
t'1ODt'1/1
takes about 18 s to execute, and then turns the modem off.
10 UU T I AL I ZE
/ I :
t'10Dt'1/1
I~
t'10DEt'1 ot·4
20 I F MOD I
H~ttf
/I
~·~OK
/I
THE~'4
20
Detecting Connection With a Host Computer
Once the modem is on, and a number has been dialed, the connection with the host computer needs to be
detected. The example below uses
CAPf::: I EP?
for this task.
10 t'10DOUT
II
~'~d
1 (:::00) 555-1212/1
:~.:CHP::t.::
1:::::'
! D i .:.1 t. he nur'lbet-
17 !
18
I
If carrier not. found aft.er 80 s, halt the prograM
19
I
20 Ot·4 T H1EF.: # 1, :::0 D I ::;P
/I
~'40
connect. i on
II
I:E!
STOP
80 IF NOT CAPRIER? THEN 80 ! Loop waiting for carrier
40 OFF TIMER # 1 ! When carrier found, st.op the t.iMer
5(1
[I
I SP
/I
Connect. i on est ab 1 i shed
II
The program dials whatever number is specified on line 10. Note that the parentheses and dash in the
dial string improve readability but do not cause an error. The program then loops on line 30 waiting for
a carrier to be detected.
A
timer is set on line 20 to halt the program after 30 s of waiting for the carrier. The 30 s includes the
time it takes the modem to process the dial command and actually perform the dialing. If pulse dialing or
20

Advertisement

Table of Contents
loading

Table of Contents