M-S Cash Drawer 7193 RS-232C Interface, Using DOS to Send Commands, Using Basic to Send Commands

Models: 7193

1 118
Download 118 pages 9.39 Kb
Page 50
Image 50

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 RS-232C interface uses either XON/XOFF or DTR/DSR protocol. For XON/XOFF, a particular character is sent back and forth between the host and the printer to regulate the communication. For DTR/DSR, changes in the DTR/DSR signal coordinate the information flow.

The RS-232C version of the 7193 offers the standard options which are selected with the DIP switches. The switch settings are shown on page 50.

46

May 1996

Page 50
Image 50
M-S Cash Drawer 7193 manual RS-232C Interface, Using DOS to Send Commands, Using Basic to Send Commands