Tuesday, September 22, 2015

Smart Label Pro command codes

I managed to find a web page with a listing of the smart label pro command code protocol. It looks pretty simple, so the next step is to write a little QBasic program to pretend to be the smart label pro.

CMD_NOP 00 No operation

CMD_STATUS 01 Request printer status

CMD_VERSION 02 Request firmware version

CMD_BAUDRATE 03 nn Change baud rate to nn

CMD_PRINT 04 nn dd ... Print literal (binary) data

CMD_PRINTRLE 05 nn dd ... Print compressed (RLE) data

CMD_MARGIN 06 nn Image offset (in mm from left edge)

CMD_TAB 09 nn Tab nn dots to the right

CMD_LINEFEED 0A Feed label one line (one dot)

CMD_VERTTAB 0B nn Feed label nn lines (dots)

CMD_FORMFEED 0C Feed to top of next label

CMD_DENSITY 0E nn Set print density to nn

CMD_RESET 0F Reset printer

CMD_CHECK A5 Check for correct baud rate

CMD_CHECK (A5h) - check for proper baud rate

This command is used to detect if the printer and the host are communicating at the same baud rate. If the printer receives this command, it always responds with a response byte which has the value of C9h.


Status Byte Definitions

The status byte always has a base value of 40 hex. The following values may be added to the base value, as appropriate:


STAT_PAPER_OUT 01 Out of labels

STAT_PAPER_JAM 02 Label is jammed (feed error)

STAT_HARD_ERR 04 General hardware error

STAT_COMM_ERR 08 Invalid command or I/O error

STAT_IDLE 10 Printer is idle

STAT_UNUSED 20 (in later smart label printers, used for STAT_PLATEN_OPEN)

No comments:

Post a Comment