Communication | 7193 Owner’s Guide |
Using DOS to Send Commands
One way of getting commands to the printer is to send them directly from DOS. For example, the command
COPY CON: COM1:
sets the computer up such that the Hex code corresponding to any key that was pressed would be sent to the communication port COM1 when the COPY mode is exited. If the printer is connected to COM1, then the data will go to the printer.
Exit the COPY mode by typing
CTRL Z
and then pressing the ENTER key. Once the computer knows to direct data from any print command to the proper port, commands can be sent from any software program.
Using BASIC to Send Commands
In BASIC, printer commands are sent as a string of characters preceded by the LPRINT command. For example,
LPRINT CHR$(&H0A)
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. For example,
LPRINT CHR$(&H12); "ABC"; CHR$(&H0A)
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 “ABC” (41 42 43), and finally, print (0A). Again, the communication link that the BASIC program outputs to must be matched to that of the printer.
RS-232C Interface
The
The
46 | May 1996 |