Search Site:

About

Linux

Printers?

Programming

Windows?

Download

Skins

Edit - To Do - AllRecentChanges

Recent Changes Printable View Page History Edit Page
Brother PT-9500PC

Printing Protocol description for the PT-9500PC - NEW 01-JUN-2007

Cristian Georgescu kindly submitted a couple of very useful documents that describe in detail the protocols used by the Brother PT-9500PC label printer.
That protocol is very similar to the one used by the QL500/QL550 below, so anyone looking at implementing a driver or a hardware solution might want to have a close look at these documents:

Brother QL550

Printing Protocol description for the QL-500/QL-550 - v1.4 (06-FEB-2007)

These findings are incomplete and they are probably erroneous in many ways. They are the fruit of my and other contributor's trials on the Brother P-Touch QL-500/QL-550 label printers and did not involve Brother® at all. If you have information about the protocol, please let me know: .

Purpose

I did this to be able to print labels on this printer from Linux. See QL550LabelPrinter for more information on this project.
The purpose of collecting these data is to ensure interroperabilty between this printer and Operating Systems unsupported by the manufacturer.

Reading / Writting

Data is sent and received through the USB interface. Need direct access to USB block write/read, with libusb on Windows/Linux platforms or on Linux only, through simple access to the /dev/usb/lpX device.

Sequence of calls for 1 label jobs:

  1. Reset
  2. Init
  3. Get Printer Status -> returns 32 byte status
  4. Init
  5. Set Page Length
  6. Set Side Margin
  7. Image data -> returns 3x32 byte status
  8. Job Completion
  9. Init

Sequence of calls for 2 or more labels jobs:

  1. Reset
  2. Init
  3. Get Printer Status -> returns 32 byte status
  4. Init
  5. Set Page Length
  6. Set Side Margin
  7. Image data -> returns 3x32 byte status
  8. Page completion
  9. Set Page Length
  10. Set Side Margin
  11. Image data -> returns 3x32 byte status
  12. Job Completion
  13. Init

Basic commands

Numbers in block are in Hexadecimal.
Findings flagged with ?? are uncertain and need confirmation.

Reset - 200 bytes
00 x 200

Init - 2 bytes
1b 40

Get Printer Status - 3 bytes
1b 69 53
Returns a 32 bytes status:
80 20 42 30 4f 30 00 00 00 EC LW MT 00 00 ID 00
00 LL SK BS 00 00 00 00 00 00 00 00 00 00 00 00
Each byte address in the status is detailed as follow:

  • 09 (09h): EC Error Code (SK flag = 02)
    - 00 : No Error
    - 10 : Cover Open
    - 40 : Paper Out
  • 10 (0Ah): LW Label Width in mm
    - 1D : 29mm
    - 3E : 62mm
  • 11 (0Bh): MT Media Type ??
    - 0A : White Paper Tape
    - 0B : Standard Address Labels
  • 14 (0Eh): ID Label hardcoded ID set by the base of the roll holder
    (see section Roll base encoding below)
  • 17 (11h): LL Label Length in mm
    - 00 : Continuous roll
    - 5a : 90mm long labels
  • 18 (12h): SK Status Kind
    - 00 : Reply to Status Request
    - 01 : Printing completion
    - 02 : Error, refer to EC byte for more details
    - 06 : Buffer status (read with BS)
  • 19 (13h): BS Buffer Status ?? (only when SK=06)
    - 00 : Buffer empty ??
    - 01 : Buffer busy ??
    - 04 : Undefined ??

Set Page Length (number of lines to be printed) - 13 bytes
1b 69 7a 00 MT LW LL LB HB 00 00 00 00
MT, LW, LL are identical to those returned by the Get Printer Status.
LB HB = length of page in 1/300inch (least significant byte first).

Set Paper Cut and Side Margin - 9 bytes
1b 69 4d PM 1b 69 64 LB HB
PM = A logical OR combination of 80 for Mirror printing and 40 for Auto Cut after the label is printed, 00 otherwise (only for QL550).
LB HB = size of margin in 1/300inch
Note: Mirrorring must be done in software as the printer hardware does not perform it automatically.

Line Image Data - 93 bytes
Prints a single 1/300inch line.
Line Header: 67 00 5a
Line Data : PX x 90
PX = binary representation of the line image: each bit set to 1 prints a dot. Bits are printed right-to-left, with bit 7 rightmost.
The packet is always 90 bytes (5Ah) as this printer model is 62mm wide (720 dots at 300dpi).
Note: the first and last 12 bits are set to 0 to create a small margin (1.35mm) along the length of the label.
eg: a black line 1/300inch thin:

67 00 5a 00 0f ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff f0 00

eg: a black line on a 29mm wide label

67 00 5a 00 ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff ff ff ff ff c0 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00

Image Data - Line Image Data (93 bytes) x Page length
The set of lines that make the full image to be printed.
Data: Line Image Data x Page Length

Job Completion or Page completion
1a if job is completed (no other labels following in this job)
0c if page is completed (more labels follow)
Both return the following 3x32 byte status sequentially:

  • 80 20 42 30 4f 30 00 00 00 00 LW MT 00 00 RB 00
    00 00 06 01 00 00 00 00 00 00 00 00 00 00 00 00
  • 80 20 42 30 4f 30 00 00 00 P1 LW MT 00 00 RB 00
    00 LL P2 01 00 00 00 00 00 00 00 00 00 00 00 00
    LW/LL/MT = Label Width/Length/Media Type (see above)
    RB = Roll Base encoding (see below)
    P1 = 00 if OK, 40 if Paper Out
    P2 = 01 if OK, 02 if Paper Out
  • This one is sent only if no error occured in the previous packet
    80 20 42 30 4f 30 00 00 00 00 LW MT 00 00 RB 00
    00 LL 06 00 00 00 00 00 00 00 00 00 00 00 00 00

Roll base encoding
Each roll base has a number of holes encoding its model number (a depressed pin in the printer sets the bit to 1):

4   3
    2
    1
    0

List of kown label types and their corresponding code (bit 4 = 0):
- 01 : 29x90mm white paper labels - Ref DK-11201
- 02 : 38x90mm white paper labels - Ref DK-11208
- 03 : 62x29mm white paper labels - Ref DK-11209
- 04 : 62x100mm white paper labels - Ref DK-11202
- 05 : 17x54mm white paper labels - Ref DK-11204
- 06 : 17x87mm white paper labels - Ref DK-11203
- 07 : 58x58 CD/DVD film labels - Ref DK-11207
Continuous rolls (bit 4 = 1):
- 14 : 29mm continuous white paper or film(?) roll - Ref DK-22210 or 22211
- 15 : 62mm continuous white paper roll - Ref DK-22205
- 16 : 29mm continuous white film or paper(?) roll - Ref DK-22211 or 22210
- 17 : 62mm continuous white or yellow (?) film roll - Ref DK-22206 or DK-22212
- 18 : 62mm continuous yellow or white (?) film roll - Ref DK-22212 or DK-22206
- 19 : 62mm continuous clear film roll - Ref DK-22113
- 1a : 12mm continuous white paper roll - Ref DK-22214


The data on this page is given without warranty and is for information only.


Thanks to Ralf Muschall, Arne John Glenstrup and Arne Ljung who have helped with their remarks, corrections and additions.

Comments
Arne LjungSaturday 03 February 2007, at 14:26 GMT+8 [X]
Hi, I have complemented the Job Completion or Page completion status messages with LW MT and LL information, I have got this from my QL-550 printer and 29x90 mm labels. Se below for the updates. 1a if job is completed (no other labels following in this job) 0c if page is completed (more labels follow) Both return the following 3x32 byte status sequentially: * 80 20 42 30 4f 30 00 00 00 00 LW MT 00 00 RB 00 00 LL 06 01 00 00 00 00 00 00 00 00 00 00 00 00 * 80 20 42 30 4f 30 00 00 00 P1 LW MT 00 00 RB 00 00 LL P2 01 00 00 00 00 00 00 00 00 00 00 00 00 P1 = 00 if OK, 40 if Paper Out P2 = 01 if OK, 02 if Paper Out * This one is sent only if no error occured in the previous packet 80 20 42 30 4f 30 00 00 00 00 LW MT 00 00 RB 00 00 LL 06 00 00 00 00 00 00 00 00 00 00 00 00 00 RB stands for Roll base encoding. Best Regards
RenaudTuesday 06 February 2007, at 10:55 GMT+8 [X]
Hi Arne, I've included your findings. thanks a lot!
WillFriday 21 June 2013, at 19:46 GMT+8 [X]
You are an excellent writer even if I have thought your writing seems sad sometimes! I am so glad you are honest! The truth will set you free, is true! I love you and I am so blessed to be your Mom!
Enter your comment (no links allowed): Author:

Edit Page - Page History - Printable View - Recent Changes - WikiHelp - Search - RSS -
Page last modified on Friday 01 June 2007, at 02:39 GMT+8 - Viewed 1065 times