Communication
Chapter 4:
Communication Overview
In order for a receipt to be printed, a program must be in place that translates the data
from the host computer into a language that the printer can understand. This program
must tell the printer exactly how to print each character. This chapter describes how to
create such a program or modify an existing one.
Interface
For the printer to communicate with the host, a communication link must be set up.
The 7199 Model supports the industry standard USB communication interface. This
interface has a protocol associated with it that the host computer must understand and
adhere. The printer also supports RS–232C communications.
Only when the interface parameters are matched and the proper protocol is used will
the host and the printer be able to communicate.
The 7199 Ethernet Model supports the Ethernet communication interface.
Sending Commands
Once the communication link is established, commands can be sent to the printer. This
section describes how to send commands to the printer using DOS and BASIC. This
section does not take into account the necessary protocol, but is meant as a general
introduction to how the printer functions.
Using BASIC to Send Commands
In BASIC, printer commands are sent as a string of characters preceded by the LPRINT
command.
Example:
This sends the hexadecimal number 0A to the printer, which causes the printer to print
the contents of its print buffer. Previously sent commands tell the printer exactly how
this data should appear on the paper.
Example:
This sends the Hex numbers 12 41 42 43 0A to the printer. This causes the printer to set
itself to double wide mode (12), load the print buffer with
finally, print
matched to that of the printer.
LPRINT CHR$(&H0A)
LPRINT CHR$(&H12); "ABC"; CHR$(&H0A)
. The communication link that the BASIC program outputs to must be
(0A)
, and
"ABC" (41 42 43)