|
Smart Label Printer
Interface Specification
Revised August 29, 1995
1. Overview
This document describes the interface for Smart Label Printer models SLP-1000, SLP-1000P, and SLP-1100, including:
Hardware interface
Handshake protocol
Printer command set
Printer error and status reporting
The document is intended for programmers who want to control the Smart Label Printer from within an application program, or to interface the printer directly to the host system. It is assumed that the programmer has experience with system-level programming and device control applications. The following specifications are subject to change without notice.
Back to the Top
2. Description
The Smart Label Printer, or SLP, is a very small printer which is dedicated (as the name implies) to printing labels.
Although the SLP hardware is "smart" at what it does (i.e. printing labels), it is actually just a bitmap device. It has no built-in fonts, logic-seeking algorithms, centering logic, blank line detection, etc. It is the application software that provides these "smarts" to the printer system.
The command set is purposely very lean in order to allow the printer to concentrate only on printing and off-load all other functions to the host.
Note that the SLP-1000 printer firmware was in an EPROM and some units have been upgraded. If the EPROM is labeled Version 1.20 or later, the unit is functionally equivalent to the SLP-1000P.
Back to the Top
3. Hardware Interface
The SLP communicates with the host computer using an RS-232 serial cable. The cable connects the host computer's TX, RX, CTS, DSR and GND signals to the printer via a standard RJ11 type (modular telephone) connector. The host end of the cable is intended for DTE connections using either a DB-25 or DB-9 connector. Older cables do not include connections for CTS and DSR because the SLP-1000 and SLP-1000P printers do not support hardware handshaking. A cable wiring diagram is shown in Figure 1.
The serial data format is 9600 baud, eight data bits, one stop bit, and no parity. A proprietary busy bit handshake protocol is supported by all three models and, additionally, hardware handshake is supported by the SLP-1100 model.
The primary communication flow is from the host to the SLP. This is because the host must send commands and bitmap data, while the SLP sends only occasional status and handshake data.
Figure 1 - Standard SLP Interface Cable
Back to the Top
4. Handshake Protocol
The printer uses bit 6 in the status byte for handshaking. When the printer's buffer is nearly full (19 bytes left for SLP-1100 or 10 bytes left for other models), a status byte with bit 6 set is sent to the host. When the printer has room in its buffer again, it will send another status byte with bit 6 cleared.
When interfacing with the SLP-1100 printer, we recommend using hardware handshaking because it is usually easier to implement with most operating systems. The hardware handshake uses the host's CTS and DSR signals to indicate the "busy" status of the printer. These signals are set "false" whenever the printer is busy and "true" when the printer is ready
to receive more data.
The printer acknowledges each print command (i.e., CMD_R2L and CMD_L2R) with a special status byte that has bit 7 (STAT_ACK) set. The status byte is sent after all data bytes for the command are received.
When the printer starts processing commands, after sitting idle, it will send a status byte with the STAT_IDLE bit cleared. After all commands and data in the receive buffer have been processed, the printer will send a status byte with the STAT_IDLE bit set.
Since the SLP status byte is normally the only data sent from the printer, the host receive routine can be fairly simple. In general, a newly received status byte can replace the contents of a global status variable. The SLP sends a new status byte, unsolicited, to the host whenever there is a change in its internalcopy of the status byte. A status byte can also be requested by sending the CMD_STATUS command to the SLP.
Back to the Top
5. SLP Command Set Comparison
The following table is a comparison of the commands that are recognized by the various SLP models. The mnemonics are defined in the SAMPLE.H file of the SLP Developer's Kit. A check mark () indicates that the command is available.
|
Mnemonic |
SLP-
1000 |
SLP-
1000P |
SLP-
1100 |
Hex
Value |
Description |
|
CMD_NOP |
|
|
|
00 |
no-operation |
|
CMD_STATUS |
|
|
|
01 |
request printer status |
|
CMD_VERSION |
|
|
|
02 |
request firmware version |
|
CMD_L2R |
|
|
|
03 |
print left to right |
|
CMD_R2L |
|
|
|
04 |
print right to left |
|
CMD_HALFSTEP |
|
|
|
05 |
high resolution half-step mode |
|
CMD_FULLSTEP |
|
|
|
06 |
normal full step mode |
|
CMD_TABRIGHT |
|
|
|
07 |
tab n dots to right |
|
CMD_TABLEFT |
|
|
|
08 |
tab n dots to left |
|
CMD_HALFDOT |
|
|
|
09 |
move vertically 1/2 dot |
|
CMD_LINEFEED |
|
|
|
0A |
move vertically 8 dots |
|
CMD_VERTTAB |
|
|
|
0B |
move vertically 7.5 dots |
|
CMD_FORMFEED |
|
|
|
0C |
advance label |
|
CMD_RETURN |
|
|
|
0D |
move to left margin |
|
CMD_DENSITY |
|
|
|
0E |
set print density |
|
CMD_RESET |
|
|
|
0F |
reset printer |
|
CMD_CHECK |
|
|
|
88 |
check for SLP-1000P or SLP-1100 |
Back to the Top
6. Description of SLP Commands
CMD_NOP -- no operation
This command is ignored by the SLP. It is used primarily to pad a partially transmitted record when the printer needs to be reset.
CMD_STATUS -- request printer status
This command is used to request the status of the SLP. The printer will respond to this command immediately after it is received (i.e., it is not buffered). It is normally used only at start-up, when the state of the printer is unknown, or when a global status
variable is not implemented. See "Status Byte Definitions" below for a description of the status byte.
CMD_VERSION -- request printer firmware version
This command is used to request the version of the SLP-1100 firmware. The printer will respond to this command immediately after it is received (i.e., it is not buffered).
The current version of SLP-1100 firmware returns a value of 21 hex. Values from 22 hex through 2F hex are reserved for future versions. The SLP-1000 and SLP-1000P printers do not recognize this command and will return a status byte with the STAT_COMMAND_ERR bit set.
CMD_L2R -- print left to right
This command is used to send a bitmap record to the printer. The data will be printed from left to right. The command must be followed by the record length (single byte) and the data record.
|
Byte Sent |
|
Meaning |
|
03 |
CMD_L2R -- print left to right |
|
05 |
data record length (5 bytes) |
|
01 |
ü |
|
02 |
ï |
|
03 |
ý5 binary data bytes |
|
04 |
ï |
|
05 |
þ |
The bits of each data byte are translated into an image of eight "dots" (1=black, 0=white), arranged in a vertical column, with the least significant bit as the upper dot.
For example, the command (values in hex):
03 08 11 22 44 88 11 22 44 88
would produce the following pattern:
0
1
2
3
4
5
6
7
CMD_R2L -- print right to left
This command is identical to CMD_L2R (above) except that the data will be printed from right to left.
CMD_HALFSTEP -- high resolution half-step mode
This command, used for high resolution printing, causes the print head to move in one-half step increments. This causes the dots to overlap and produces a higher dot density.
CMD_FULLSTEP -- normal full step mode
This command, used for normal resolution printing, causes the print head to move in full step increments. This is the default mode after the printer is reset.
CMD_TABRIGHT -- tab n dots to right
This command is used to move the print head to the right. The distance is determined by the byte sent immediately after the command.
Back to the Top
|