-
-
Notifications
You must be signed in to change notification settings - Fork 42
Brother Driver
This page provides a place to discuss/plan the Brother driver in LPrint.
- "lprint-brother.c": Driver code
- "lprint-brother.h": Driver name, make/model, and IEEE-1284 device ID strings
| Command | Description |
|---|---|
<00> |
Invalidate (128 or more bytes) |
<0C> |
Print command |
<1A> |
Print command with feeding |
<1B> @ |
Reset |
<1B> i A <n> |
Set page number for "cut every" |
<1B> i K <n> |
Set advanced settings |
<1B> i M <n> |
Set each mode |
<1B> i S |
Query status (all but PT-E550W/PT-P750W) |
<1B> i a <01> |
Set raster command mode |
<1B> i d <n1..2> |
Set margins |
<1B> i z <n1..10> |
Set print information |
M <n> |
Set compression mode |
Z |
Zero raster graphics (all but QL-800) |
g <00> <n> <d1..n> |
Raster graphics transfer (QL-Series) |
g <n1..2> <d1..n> |
Raster graphics transfer (PT-Series) |
w <c> <n> <d1..n> |
Two-color raster graphics transfer (QL-800/810W/820NWB) |
<n> is a single byte whose bits are:
PT-series:
| Bit | Description |
|---|---|
| 0 | 1 = draft printing, 0 = normal printing (PT-P900/P900W/P950NW) |
| 1 | Not used |
| 2 | 1 = half cut, 0 = full cut (all but PT-P710BT) |
| 3 | 1 = cut at end, 0 = no cut |
| 4 | 1 = special tape being used, 0 = normal tape |
| 5 | Not used |
| 6 | 1 = high resolution, 0 = normal (see below) |
| 7 | 1 = don't clear expansion buffer, 0 = clear buffer |
QL-series;
| Bit | Description |
|---|---|
| 0 | 1 = two-color printing, 0 = one-color printing (QL-800/810W/820NWB) |
| 1 | Not used |
| 2 | Not used |
| 3 | 1 = cut at end, 0 = no cut |
| 4 | Not used |
| 5 | Not used |
| 6 | 1 = high resolution, 0 = normal (see below) |
| 7 | Not used |
Resolutions:
| Model(s) | High | Normal |
|---|---|---|
| PT-E550W/P750W/P710BT | 180x360dpi | 180dpi |
| PT-P900/P900W/P950NW | 360x720dpi | 360dpi |
| All other PT-series | 360dpi | 360dpi |
| QL-570/580N/700/800/810W/820NWB/1100/1110NWB/1115NWB | 300x600dpi | 300dpi |
| All other QL-series | 300dpi | 300dpi |
Bit 6 Auto cut 1: Auto cut 0:No auto cut Bit 7 Mirror printing 1. Mirror printing 0. No mirror printing (PT-series)
When “auto cut” is specified, the "<1B> i A " command is valid.
Returns a 32-bit buffer of status information:
| Byte(s) | Description | Value(s) |
|---|---|---|
| 0 | Print head mark | <80> |
| 1 | Size | <20> (32 bytes) |
| 2 | Brother code | "B" (<42>) |
| 3 | Series code | See below |
| 4 | Model code | See below |
| 5 | Country code | "0" (<30>) |
| 6 | Battery level | See below |
| 7 | Extended error | See below |
| 8 | Error information 1 | See below |
| 9 | Error information 2 | See below |
| 10 | Media width | See below |
| 11 | Media type | See below |
| 12 | Number of colors | <00> |
| 13 | Fonts | <00> |
| 14 | Japanese fonts | <00> |
| 15 | Mode | Last "ESC i M" value |
| 16 | Density | <00> |
| 17 | Media length | See below |
| 18 | Status type | See below |
| 19 | Phase type | See below |
| 20-21 | Phase number (big-endian) | See below |
| 22 | Notification number | See below |
| 23 | Expansion area | <00> |
| 24 | Tape color | See below |
| 25 | Text color | See below |
| 26-31 | Reserved | <00> |
Series/Model codes:
- "0O" (<304F>): QL-500/550
- "0Q" (<3051>): QL-650TD
- "0P" (<3050>): QL-1050
- "0d" (<3064>): PT-H500
- "0e" (<3065>): PT-E500
- "0f" (<3066>): PT-E550W
- "0g" (<3067>): PT-P700
- "0h" (<3068>): PT-P750W
- "0o" (<306f>): PT-P900W
- "0p" (<3070>): PT-P950NW
- "0q" (<3071>): PT-P900
- "0x" (<3078>): PT-P910BT
- "41" (<3431>): QL-560
- "42" (<3432>): QL-570
- "43" (<3433>): QL-580N
- "44" (<3434>): QL-1060N
- "45" (<3435>): QL-700
- "46" (<3437>): QL-710W
- "47" (<3437>): QL-720NW
- "48" (<3438>): QL-800
- "49" (<3439>): QL-810W
- "4A" (<3441>): QL-820NWB
- "4C" (<3443>): QL-1100
- "4D" (<3444>): QL-1110NWB
- "4E" (<3445>): QL-1115NWB
- "4G" (<3447>): QL-600
Battery levels:
- 0x00: Full (PT-P900/P900W/P950NW)
- 0x01: Half (PT-P900/P900W/P950NW)
- 0x02: Low (PT-P900/P900W/P950NW)
- 0x03: Needs to be charged (PT-P900/P900W/P950NW)
- 0x04: Using AC adapter (PT-P900/P900W/P950NW)
- 0x20: Full, not using AC adapter (PT-P910BT)
- 0x22: Half, not using AC adapter (PT-P910BT)
- 0x23: Low, not using AC adapter (PT-P910BT)
- 0x24: Needs to be charged, not using AC adapter (PT-P910BT)
- 0x30: Full, using AC adapter (PT-P910BT)
- 0x32: Half, using AC adapter (PT-P910BT)
- 0x33: Low, using AC adapter (PT-P910BT)
- 0x34: Needs to be charged, using AC adapter (PT-P910BT)
- 0x37: Battery not installed, using AC adapter (PT-P910BT)
- 0xff: Unknown
Extended error values:
- 0x10: FLe tape end
- 0x1d: High-resolution/draft printing error
- 0x1e: Adapter pull/insert error
- 0x1f: Incompatible media error
Error information 1 bits:
- 0x01: No media
- 0x02: End of media
- 0x04: Cutter jam
- 0x08: Low battery
- 0x10: Printer in use
- 0x20: Printer turned off
- 0x40: High-voltage adapter
- 0x80: Fan motor error
Error information 2 bits:
- 0x01: Incorrect media
- 0x02: Expansion buffer full
- 0x04: Communication error
- 0x08: Communication buffer full
- 0x10: Cover open
- 0x20: Overheating error/cancel key
- 0x40: Black marking not detected (load/feed error)
- 0x80: System error
Media widths:
- 0: No tape loaded
- 4: 3.5mm tape
- 6: 6mm tape or 5.8mm HS
- 9: 9mm tape or 8.8mm HS
- 12: 12mm tape or 11.7mm HS
- 18: 18mm tape or 17.7mm HS
- 21: 21x45mm FLe
- 24: 24mm tape or 23.6mm HS
- 29: 29mm tape
- 36: 36mm tape
- 38: 38mm tape
- 50: 50mm tape
- 54: 54mm tape
- 62: 62mm tape
- 90: 90mm tape
- 102: 102mm tape
- 103: 103mm tape
Media lengths:
- 0: Unknown
- 45: FLe 21x45mm
- Other values: die-cut labels
Media types:
- 0x00: No tape loaded
- 0x01: Laminated tape
- 0x03: Non-laminated tape
- 0x04: Fabric tape
- 0x0a: Continuous labels (QL-500/550/560/570/580N/650TD/700/1050/1060N/1100/1110NWB/1115NWB)
- 0x0b: Die-cut labels (QL-500/550/560/570/580N/650TD/700/1050/1060N/1100/1110NWB/1115NWB)
- 0x11: Heat-Shrink Tube (2:1)
- 0x13: FLe tape
- 0x14: Flexible ID tape
- 0x15: Satin tape
- 0x17: Heat-Shrink Tube (3:1)
- 0x4a: Continuous labels (QL-600/QL-710W/QL-720NW/800/810W/820NWB)
- 0x4b: Die-cut labels (QL-600/QL-710W/QL-720NW/800/810W/820NWB)
- 0xff: Incompatible tape
Notification numbers:
- 0x00: Not available
- 0x01: Cover open
- 0x02: Cover closed
- 0x03: Cooling (started)
- 0x04: Cooling (finished)
Phase types:
- 0x00: Editing/receiving
- 0x01: Printing (number is 0 if printing, 20 for cover open)
Status types:
- 0x00: Reply to status request
- 0x01: Printing completed
- 0x02: Error occurred
- 0x03: Exit IF mode
- 0x04: Turned off
- 0x05: Notification
- 0x06: Phase change
Tape colors:
- 0x01: White
- 0x02: Other
- 0x03: Clear
- 0x04: Red
- 0x05: Blue
- 0x06: Yellow
- 0x07: Green
- 0x08: Black
- 0x09: Clear (White Text)
- 0x20: Matte White
- 0x21: Matte Clear
- 0x22: Matte Silver
- 0x23: Satin Gold
- 0x24: Satin Silver
- 0x30: Blue (D)
- 0x31: Red (D)
- 0x40: Fluorescent Orange
- 0x41: Fluorescent Yellow
- 0x50: Berry Pink (S)
- 0x51: Light Gray (S)
- 0x52: Lime Green (S)
- 0x60: Yellow (F)
- 0x61: Pink (F)
- 0x62: Blue (F)
- 0x70: White (Heat-shrink Tube)
- 0x90: White (Flex. ID)
- 0x91: Yellow (Flex. ID)
- 0xf0: Cleaning
- 0xf1: Stencil
- 0xff: Incompatible
Text colors:
- 0x01: White
- 0x02: Other
- 0x04: Red
- 0x05: Blue
- 0x08: Black
- 0x0a: Gold
- 0x62: Blue (F)
- 0xf0: Cleaning
- 0xf1: Stencil
- 0xff: Incompatible
n = n1 + 256 * n2
Use 0 for die-cut labels, 35 for continuous tape on QL-550/560/570/580N/700.
QL-500/550/560/570/580N/650TD/700/1050/1060N:
Specifies the print information.
Definition of {n1} through {n10}
{n1}: Valid flag; specifies which values are valid
#define PI_KIND 0x02 // Paper type
#define PI_WIDTH 0x04 // Paper width
#define PI_LENGTH 0x08 // Paper length
#define PI_QUALITY 0x40 // Give priority to print quality
#define PI_RECOVER 0x80 // Always ON
{n2}: Paper type
Continuous length tape 0A Hex
Die-cut labels 0B Hex
{n3}: Paper width; units: mm
{n4}: Paper length; units: mm
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “error
information 2” is set to “ON”.)
{n9}: Starting page: 0; Other pages: 1
{n10}: Fixed to “0”
QL-1100/1110NWB/1115NWB:
Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
0x02: Media type
0x04: Media width
0x08: Media length
0x40: Priority given to print quality
0x80: Printer recovery always on
{n2}: Media type
Continuous length tape: 0Ah
Die-cut labels: 0Bh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 62 mm × length 100 mm, specify as n3=3Eh and n4=64h.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the media type, media width and
media length of valid flag {n1} are set to “ON”, an error status is returned. (Bit 0 of “(2)
Error information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0
QL-800/810W/820NWB:
Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
0x02: Media type
0x04: Media width
0x08: Media length
0x40: Priority given to print quality (invalid for two-color printing)
0x80: Printer recovery always on
{n2}: Media type
Continuous length tape: 0Ah
Die-cut labels: 0Bh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 62 mm × length 100 mm, specify as n3=3Eh and n4=64h.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the media type, media width and
media length of valid flag {n1} are set to “ON”, an error status is returned. (Bit 0 of “(2)
Error information 2” is set to “ON”.)
* For two-color printing, the raster number is calculated as a single raster data packet
using the following 186 bytes.
‘w’ 01 90 First color data ( 90 b yte s ) ‘w’ 02 90 Second color data ( 9 0 b yt e s)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0
PT-E550W/P750W/P710BT:
Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
#define PI_KIND 0x02 // Media type
#define PI_WIDTH 0x04 // Media width
#define PI_LENGTH 0x08 // Media length
#define PI_QUALITY 0x40 // Priority given to print quality(Not used)
#define PI_RECOVER 0x80 // Printer recovery always on
{n2}: Media type
No tape: 00h
Laminated tape: 01h
Non-laminated tape: 03h
Heat-Shrink Tube (HS 2:1): 11h
Heat-Shrink Tube (HS 3:1): 17h
Incompatible tape: FFh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 24 mm, specify as n3=18h and n4=00h.
n4 is normally 00h, regardless of the paper length.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “(2)
Error information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0
PT-H500/P700/E500:
Definitions of {n1} through {n10}
{n1}: Valid flag; Specifies which values are valid
#define PI_KIND 0x02 // Media type
#define PI_WIDTH 0x04 // Media width
#define PI_LENGTH 0x08 // Media length
#define PI_QUALITY 0x40 // Priority given to print quality(Not used)
#define PI_RECOVER 0x80 // Printer recovery always on
{n2}: Media type
No tape: 00h
Laminated tape: 01h
Non-laminated tape: 03h
Heat-Shrink Tube (HS 2:1): 11h
Heat-Shrink Tube (HS 3:1): 17h
Incompatible tape: FFh
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 24 mm, specify as n3=18h and n4=00h.
n4 is normally 00h, regardless of the paper length.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “(2)
Error information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
{n10}: Fixed at 0
PT-P900/P900W/P950NW/P910BT:
Definitions of {n1} through {n10}
{n1}: Valid flag: Specifies which values are valid
#define PI_KIND 0x02 // Media type
#define PI_WIDTH 0x04 // Media width
#define PI_LENGTH 0x08 // Media length
#define PI_QUALITY 0x40 // Priority given to print quality (Not used)
#define PI_RECOVER 0x80 // Printer recovery always on
If flag 0x80 is specified…
PT-P9100/900W/950NW:
Both “Printer recovery” and “bi-directional communication” will be activated.
The printer will send status notification when printing.
PT-P910BT:
“bi-directional communication” will not be activated.
Please use “Switch automatic status notification mode” command to enable
bi-directional communication with the printer when printing.
{n2}: Media type
Laminated/Non-laminated tape: 00h
Heat-Shrink Tube (HS 2:1): 11h
Heat-Shrink Tube (HS 3:1): 17h
Fle tape: 13h
Incompatible tape: FFh
Note:
PT-P9100/900W/950NW:
High-resolution printing and draft printing are supported for Laminated tape only.
Please set to 09h when printing.
PT-P910BT:
High-resolution printing and draft printing are not supported.
{n3}: {n4}:
{n3}: Media width (mm)
{n4}: Media length (mm)
For the media of width 24 mm, specify as n3 = 18h and n4 = 00h.
- 33 -
4. Printing Command Details
Raster Command Reference
n4 is normally 00h, regardless of the paper length.
{n5-n8}: Raster number = n8*256*256*256 + n7*256*256 + n6*256 + n5
If the media is not correctly loaded into the printer when the valid flag for PI_KIND,
PI_WIDTH and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “(2) Error
information 2” is set to “ON”.)
{n9}: Starting page: 0
Other pages: 1
Last page: 2
The output will be 2 regardless of starting/last page for the job consists of single page.
{n10}: Fixed at 0
"n" is 0 for uncompressed and 2 for PackBits compression.
PackBits is supported by QL-580N/650TD/1050/1060N.
"d1..n" are the bytes for the current line.
n = n1 + n2 * 256 (number of bytes)
"d1..n" are the bytes for the current line.