Decoding The Query Response - 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

e
j
Software Usage and Examples
If there are any command characters in !:;$, line 1
a
uses the length of !:;$ as the argument for U.
However, the U command expects the number of bytes to be in
hex,
not decimal, so this approach only
works for strings up to 9 characters long. To provide the
U
command a hex argument, you must either
write a decimal-to-hex conversion routine or use the conversions in the HP-75 I/O ROM. Alternatively,
you could send the string in blocks of fixed length, preceding each block with U
block length.
Or you
could send the string in blocks of variable length, with each block consisting of all the data between
command characters. Each command character would then be sent using U 1 or by sending it twice, as
shown below:
10 P=PO!:;
C:;$,
"~.~"::'
I~
IF t·lOT P
THEt·~
:::0
20
t'm
D 0 U T
!:;
$ [ 1 , P H:
II
~.~
"
I~
!:; $:
=
S
$: [
P
+
1]
I~
Ci
0 T 0 1 0
:::0 t'10DOUT
!:;$
Line 1
a
locates a command character.
The string up to and including the command character is
transmitted, followed by a second command character. Then the string is set to be the substring from past
the location of the command character to the end of the string.
This process is repeated for each
command character in the string until there are no more, at which time the rest of the string is
transmitted.
Note: because the previous examples do not read the modem receive buffer with
t'10D I
t'~$
after each
t'1ODOUT,
any echoed data saved by
t'lODOUT
will be lost, and modem responses may fill up the receive
buffer and haIt data transmissions.
Decoding the QUERY Response
The
Q (QUERY)
command asks the modem for information on ring count, data communication status, and
operating mode. This status information is placed in the modem receive buffer for
t'1OD I
t·~$
to read in
the form of a two or three byte string. The first byte is a hex digit
(a-F)
that represents the current ring
count. The second byte identifies whether the modem is on-hook or off-hook, and in voice or data
communica tion:
Character
H
C
N
Meaning
On-hook
Off-hook, carrier detected
(data communication)
off-hook, VOICE mode
(not data communication)
If the modem is in
VOICE
mode, then a third byte, a
V,
is returned after the first two bytes.
If command echoing is enabled
(E
0) and the command character is
%,
the
Q
command is echoed into the
receive buffer as %q
GR(..t
Then, the query response is preceded by a command character and followed
by a
~R i("~.
If respoI1.sesare long (L 0), the query response will end with ¢R(..r
%OK
OR
.~~
(see appendix
D,"HP S2718A Errors and Responses"). The entire response is as follows: ....
.......
. .................. .
47
1
I

Advertisement

Table of Contents
loading

Table of Contents