Modout And Out Of Memory; Retransmitting Received Data; Terminal Program - 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
MODOUT and Out of Memory
As
t'10DOUT
places echoed data into the HP-75,
t'10DOUT
will use as much memory as it needs, until
there is no more memory available. As long as it has data to transmit,
t'10DOUT
will continue to read
data from the receive buffer to prevent it from overflowing. However, all the echoed data that is read
after the HP-75 runs out of memory is thrown away, since there is no place to put it.
In the previous example, if the HP-75 ran out of memory after thi, s is sam would be lost. The next
I
t'10DOUT
would empty the buffer, and would read pie before running out of memory and losing more
echoed data. If echoed data is important to you, make sure you have sufficient memory available for
it,
and read it as soon as it appears.
If
you need to know how much data is saved by
t'10DOUT,
save the available memory (use
t'lEt'l)
before
executing
t'10DOUT,
and compare that with the available memory after executing
t"IODOUT
(e.g.,
t'l= t'l Et'l
I~
t'10DOUT D$
I~
D I ::;p t'l-t'lEt'l;
II
b';::It
€-S
s.:3' .... E·d b'::1 t'10DOUT")
Retransmitting Received Data
t'10D HU
reads the data from the modem receive buffer, and copies it into the HP-75 buffer behind any
data that may already be there from
t·10DOUT.
Because
t'lODOUT
clears this buffer before it does
anything else, the statement
t'10DOUT
t'10D HU
will not retransmit the data just received by the
modem-it will retransmit random, unknown data. If you need to retransmit received data, you could
use
t'"I$=t'10D
I
t'~$
I~
t'1CIDOUT t'l$,
but this requires
t'1:t
to be dimensioned large enough to hold the
input string,
A better solution is
t'10DOUT
I'KID
I
t,U:~,:"
",
which requires no variables to be
dimensioned.
If
you use
t'1CIDOUT t'1CID I
t'~$:~,:
II II
to echo received data back to the host, you should be aware of the
possibility of getting into an infinite loop. This may occur because more than just data appears in the
receive buffer-responses also appear, and those responses can set up an infinite loop. For example, if the
%CONNECT
response is retransmitted, the modem will interpret it as
%C,
the
COUNT
command. The modem
expects to see
%C,
a space, a number, and a carriage return.
Since
';CONNECT
followed by carriage return is not a valid syntax for the
C
command, the
%ABORT
response would be reported by the modem, and placed in the receive buffer. Upon retransmission, that
response would be interpreted as
%A,
the
ANSWER
command.
It
would be processed correctly, but its
response could be
%BAD ANS,
causing
%B,
the
BREAK
command, to be retransmitted with invalid syntax,
resulting in
%ABORT.
The situation soon becomes unwieldy.
When you retransmit received data, be sure to strip out all
characters of modem responses. To facilitate this, the exact sequence of response characters is given in
appendix D.
Terminal Program
Any terminal program, when stripped to its bare essentials, must perform three operations:
1)
Read input from the keyboard
2) Transmit the keyboard input to the host
3) Display data received from the host
24
I

Advertisement

Table of Contents
loading

Table of Contents