3.1.PRINT DATA OVERVIEW ................................................................................................................................
3.2.PAGE DATA DETAILS ....................................................................................................................................
This material provides the necessary information for directly controlling the Brother QL-500/550/560/
570/580N/650TD/700/1050/1060N. This information is provided assuming that the user has full
understanding of the operating system being used and basic mastery of USB in a developer’s
environment.
Details concerning the USB interface are not described in this material. If a USB interface is being
us
ed, refer to “7. USB Specifications
” to prepare the interface.
We accept no responsibility for any problems caused
information provided in this material, affecting software, data or hardware, including the Brother QL-500/
550/560/570/580N/650TD/700/1050/1060N, and any problems resulting directly or indirectly from them.
These materials are provided in their current condition, and we assume no responsibility for their content.
Use this material only if you accept these terms.
This material shall not be reproduced, in part or in full, without prior approval. In addition, this material
shall not be used as evidence in a lawsuit or dispute in a way that is unfavorable towards our company.
The printing procedure is described below. For details on each command, refer to “5.Command Details”.
By using the machine’s button (E/EL), QL-700 can be
the mass storage class.
These materials assume that the machine is operating in the printer class.
①
Open USB/Serial/Network port
Open the USB/Serial/Network port in the operating
USB/Serial/Network port is not described in this material.
The serial port can only be used with the QL-580N/650TD/1050/1060N.
The network port can only be used with the QL-580N/1060N.
②
Check machine status
The “Status information request” command is sent to the printer, the status information received from
the printer is analyzed, and then the status of the printer is determined.
information request” command and on the definition of “status”, refer to “Status information request” in “5.
Command Details
Send print data
③
If the status analysis concludes that a tape cassette
”.
switched between operating in the printer class and
environment. The procedure for opening the
For details on the “Status
corresponding to the print data is loaded into the
printer and that no error has occurred, the print data is sent. The structure of the print data is explained in
the next section, “3. Print Data
Note:
No com
of printing is confirmed.
Even the “Status information request” command cannot be sent during printing.
④
Confirmation of printing completion
is completed, one page is printed. If the print job has multiple pages, ② through ④ are
⑤
Close USB/Serial/Network port
Note:
In
order to print at high speed when the USB port is used, the Brother QL starts printing when it
starts to receive print data, instead of waiting for a print command. For the processing flow, for
mand can be sent to the printer after the print data is transmitted and until the completion
When printing is completed, the status is sent from the printer. This status is analyzed and, if printing
After all printing is finished, close the USB/Serial/Network port.
”.
repeated.
example when managing errors, refer to “6. Flow Charts
(If the printing data is compressed in Command “4D H + 02 H” for QL-580N/650TD/1050/1060N, the
printer starts printing after a print command.)
3.1.Print data overview
The print data is constructed of the following: ① Initialize, ② Job
command. If the print job consists of multiple pages, ② through ④ are repeated
① Initialize
- Initialize Clears the mode settings. 1B H, 40 H
② Job
data
Added at the beginning of each page and feeds each page.
Sequence Command Name Description/Example
1 Command mode switch Only used with QL-580N/650TD/1050/1060N.
Switches to raster mode
1B H, 69 H, 61 H, 01 H
2 Print information
command
Sets the print information for the printer.
For the starting page of die-cut labels (29 mm × 90 mm)
with priority given to print speed:
1BH, 69H, 7AH, 0EH, 0BH, 1DH, 5AH, DFH, 03H,
data, ③ Page data, and ④ Print
00H, 00H, 00H, 00H
3 Set each mode To select “Auto Cut”(except QL-500):
1B H, 69 H, 4D H, 40 H
4
5
6
7
Specify the page
number in ”cut every
labels”
Set expanded mode Only used with QL-570/580N/650TD/700/1050/1060N.
Set margin amount For 3 mm margins:
Compression mode
select
ion
Only used with QL-570/580N/700/1050/1060N.
When an auto cut setting is effective, specify the number
*
of sheets for auto cut.
For each sheets,
1B H, 69 H, 41 H, 01 H
To set “Cut at end flag”
1B H, 69 H, 4B H, 08 H
1B H, 69 H, 64 H, 23 H, 00 H
Only used with QL-580N/650TD/1050/1060N
For QL-650TD, data can only be compressed when the
serial port is used.
3 Print area width (maximum printing width) 4 Print area length
5 Width offset 6 Length offset
7 Width offset of masked area 8 Length offset of masked area
9 Width of masked area 10 Length of masked area
ID Designation 12
269 17mm x 54mm
Inch measurements are indicated as decimals with QL-700 and as fractions with all models other than
QL-700.
ID 78
273 21.17mm
232 dots
*1 The number of dots in the table is for 300 dpi; it is difference in the high-resolution mode.
*2 Margins of 3 mm (1.5 mm × 2) horizontally and 3 mm (1.5 mm × 2) vertically
*19*1*210*1*2
21.08mm
232 dots
19.0mm
224 dots
19.0mm
224 dots
are added to a diameter of 16 mm.
“102mm x 51mm” and “102mm x 152mm” is only for QL-1050/1060N
17 mm x 54 mm 555 165 0 90
17 mm x 87 mm 555 165 0 90
23 mm x 23 mm 442 236 42 90
29 mm x 90 mm 408 306 6 90
38 mm x 90 mm 295 413 12 90
39 mm x 48 mm 289 425 6 90
52 mm x 29 mm 142 578 0 90
62 mm x 29 mm 12 696 12 90
62 mm x 100 mm 12 696 12 90
12 mm Dia 513 94 113 90
24 mm Dia 442 236 42 90
58 mm Dia 51 618 51 90
4.1. Overview
The status is sent from the printer to the computer as a reply to the “status information request”
command or as an error message. The size is fixed to 32 bytes.
Number Offset Size Name Value/Reference
1 0 1 Print head mark Fixed to “80 Hex”
2 1 1 Size Fixed to “20 Hex”
3 2 1 Reserved Fixed to ’B’ (42 Hex)
4 3 1 Reserved QL-500/550/650TD/1050:
Fixed to ’0’ (30 Hex)
QL-560/570/580N/700/1060N:
Fixed to ’4’ (34 Hex)
5 4 1 Reserved QL-500/550: Fixed to ‘O’ (4F Hex)
QL-560: Fixed to ‘1’ (31 Hex)
QL-570: Fixed to ‘2’ (32 Hex)
QL-580N: Fixed to ‘3’ (33 Hex)
QL-650TD: Fixed to ‘Q’ (51 Hex)
QL-700: Fixed to ‘5’ (35 Hex)
QL-1050: Fixed to ‘P’ (50 Hex)
QL-1060N: Fixed to ‘4’ (34 Hex)
6 5 1 Reserved Fixed to ’0’ (30 Hex)
7 6 1 Reserved Fixed to “00 Hex”
8 7 1 Reserved Fixed to “00 Hex”
9 8 1 Error information 1 Refer to section 4.2.1.
10 9 1 Error information 2 Refer to section 4.2.1.
11 10 1 Media width Refer to section 4.2.2.
12 11 1 Media type Refer to section 4.2.3.
13 12 1 Reserved Fixed to “00 Hex”
14 13 1 Reserved Fixed to “00 Hex”
15 14 1 Reserved Not set
16 15 1 Reserved Not set
17 16 1 Reserved Fixed to “00 Hex”
18 17 1
19 18 1 Status type Refer to section 4.2.4.
20 19 1 Phase type Refer to section 4.2.5.
21 20 1 Higher order bytes of
22 21 1 Lower order bytes of Refer to section 4.2.5.
Media Media Width Media Length
17 mm x 54 mm 17 54
17 mm x 87 mm 17 87
23 mm x 23mm 23 23
29 mm x 90 mm 29 90
38 mm x 90 mm 38 90
39 mm x 48 mm 39 48
52 mm x 29 mm 52 29
62 mm x 29 mm 62 29
62 mm x 100 mm 62 100
102mm x 51mm 102 51
102mm x 152mm 102 153
12 mm Dia 12 12
24 mm Dia 24 24
58 mm Dia 58 58
No media 00 Hex Used as print information when the
media type is not indicated.
Continuous length tape 0A Hex Used for both paper and MKP.
Die-cut labels 0B Hex Used for both paper and MKP.
Status Type Value
Reply to status request 00 Hex
Printing completed 01 Hex
Error occurred 02 Hex
Notification 05 Hex
Phase change 06 Hex
If an error occurred during printing, the unit returns the error status.
4.2.5. Phase type and phase number
If the phase type and phase number are not used, both are fixed to “00 Hex”.
Phase State Phase Type Phase Number
Waiting to receive 00 Hex 00 Hex 00 Hex
Printing state 01 Hex 00 Hex 00 Hex
When the machine is turned on, it is in the “Waiting to receive” phase state. When printing
begins, it changes to the “Printing state” phase state and the machine sends the phase status to
the computer. When printing has finished, the machine sends the “Waiting to receive” phase status
to the computer. Unless an error occurs during
Phase Number
Higher Order Bytes
Lower Order Bytes
printing, the machine sends the “Printing
completed” status.
In sequential printing, In order to print at high speed, printing starts even if a print command
not been sent from the computer. At this time, care should be taken since the “Printing state” phase
and “Waiting to receive” phase statuses will be sent. (Refer to “6. Flow Charts
Not available 00 Hex
Cooling (start) 03 Hex
Cooling (finish) 04 Hex
Notification Value
If a high-temperature error occurred during printing, the unit stops printing and enters the
cooling state.
At this time, the notification number is used for delivering the status of the cooling state. For
details on controlling the actual printing process, refer to “6. Flow Charts
{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
information 2” is set to “ON”.)
{n9}: Starting page: 0; Other pages: 1
{n10}: Fixed to “0”
Name Set each mode
Syntax ESC + i + M + {n}
1B H + 69 H + 4D H + {n}
Description Definition of {n}
The meaning of each bit in a 1-byte parameter is described below.
and PI_LENGTH are set to “ON”, an error status is returned (Bit 0 of “error
76543210
Not used
Not defined
Auto cut (QL550/560/570/580N/
Not used
Bit 6 Auto cut 1: Auto cut 0:No auto cut
When “auto cut” is specified for QL-560/570/580N/700/1050/1060N, following
command (ESC + I + A + {n1}) is valid.
Name Set margin amount (feed amount)
Syntax ESC + i + d + {n1} + {n2}
1B H + 69 H + 64 H + {n1} + {n2}
Description Specifies the amount of the margins.
Margin amount (dots) = n1 + 256*n2
With this model, the amount of feed cannot be set for each mode.
With die-cut labels, the margin amount at the ends of the printed area is “0”.
In case of using QL-550/560/570/580N/700, specify 35dots.
1. 1-byte unit
When the same data is repeated, the number of repetitions and the one-byte
data are specified.
When the data is different, the number of data items and all data are specified.
.When the same data is repeated, the number of data units is specified as the
actual number minus 1, expressed as a negative number.
When the number of different data units is specified, that number of bytes
1 is expressed as a positive number.
.If the above process results in more than 90 bytes of compressed data, the data
is treated as being all different. As a result,
byte specifying the data length.
Example: Compression example
Without compression
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
there are 91 bytes, including the 1
00 00 00 00 00 22 22 23 BA BF A2 22 2B ……
With compression
a. 00H continues for 20 bytes, so 20 Dec -> 19 Dec -> 13 Hex, made into a
negative number ED Hex.
Therefore, ED 00
ED 00 FF 22 05 23 BA BF A2 22 2B …
a b c
minus
b. 22H continues for 2 bytes, so 2 Dec ->
number FF Hex.
Therefore, FF 22
c.
The following 6 bytes remain unchanged. 6 Dec-> 5 Dec ->5 Hex.
Therefore, 05 23 BA BF A2 22 2B
This continues for up to 90 bytes. Even if the remainder of the 90
only of 00 Hex, it cannot be omitted. (In case QL-1050, 162 bytes)
Name Raster graphics transfer
Syntax g + {s} + {n} + {d1} + ... + {dn}
67 H + {s} + {n} + {d1} + ... + {dn}
Description {s} The definition of raster information s is as follows.
s 0x0: Data transmission
0x1~0xFE: Not
used
0xFF: Indicates that data transmission should be stopped.
{n} Transfers the specified number of bytes (n) of data. (However, this changes if the
data is compressed using the serial interface.)
n=90 (QL-500/550/560/570/580N/650TD/700)
n=162 (QL-1050/1060N)
{d1-dn} Print data.
Name Zero raster graphics
Syntax Z
5A H
Description Raster line is filled in zero data. (Compression mode)
Name Print command
Syntax FF
0C H
Description Used as a print command, except for the last label when multiple labels are printed.
Name Print command with feeding
Syntax Control-Z
1A H
Description Used as a print command for the last label when multiple labels are printed.
Name
Syntax
Baud rate setting (QL-580N/650TD/1050/1060N)
ESC + i + B + {n1} + {n2}
1B H + 69 H + 42H + {n1} + {n2}
Description This changes the communications baud rate for the main unit. The factory setting is
Send a print command (print command with feeding (1A) for
the last page or print command (0C) for other pages).
Initialize
Print 1st page.
Print 2nd page.
×Error occurred
If an error occurs, all
data read from the
computer is cleared.
Reprint 2nd page.
27
Page 29
6.4. Sequential Cooling Flow for USB Connection
Computer (host)
Perform a READ.
If there are no problems with
the Printer status
the data is transmitted. If there
is a problem, an error appears.
(media, etc.),
Sending display
Send 200 bytes of Invalid command
Initialize
Status information request
Status (response status to status information request)
Send control code.
Send print data.
Status
(Phase change :
“Printing state”)
Send print data.
Printer
In order to clear any jobs
with errors remaining in
the printer
The printer is initialized.
The status of the Printer
(media, etc.) is checked
and a response is sent.
Receive data.
Begin printing w
waiting for a print
command.
Printing
ithout
Perform a READ.
Repeat reading of
and transmission timeout
times. If the transmission
timeout is exceeded, perform
a read, and display the
cooling status if a
high-temperature error is
returned.
Continue reading.
0 packets are returned
hile cooling.
w
maximum
When cooling is finished,
“Notification: Cooling(finish)”
is returned.
Mass storage (QL-700 only)
Character string for
manufacturer
Character string for product Character string descriptor: 0x02
Character string for serial
number
Character string descriptor: 0x01
0x0409:“Brother"
0x0409: “QL-50”
0x0409: ”QL-55”
0x0409: “QL-560”
0x0409: “QL-570”
0x0409: “QL-580N”
0x0409: ”QL-650T”
0x0409: “QL-700”
0x0409: ”QL-105”
0x0409: “QL-1060N”
Character string descriptor: 0x03
0x0409:“00000000"
Last nine digits of the unit’s serial number
(The serial number is written on the bottom of the product.)
Device speed Full speed
Number of interfaces 1 (No alternate interfaces)
With the printer class
Power supply Self-powered (As a printer class, Bus power is also set to
End point 1 In bulk (Sends the status from the unit to the computer.)
Maximum packet size: 16 bytes
End point 2 Out bulk (Sends print commands and data from the
computer to the unit.)
Maximum packet size: 64 bytes
With the mass storage class
(QL-700 only)
Power supply Self-powered
End point 1 Out bulk (Sends print commands and data from the
computer to the unit.)
Maximum packet size: 64 bytes
End point 2 In bulk (Sends the status from the unit to the computer.)
History of Changes
Change
Number
000 2004.07.20 Created version 1.0
001 2005.03.25 Created version 2.0 edition adding QL-650TD
002 2006.11.07 Created version 3.0 edition adding QL-1050
003 2008.09.01 Created version 4.0 edition adding QL-560
004 2008.12.25 Created version 5.0 edition adding QL-570/580N/1060N
005 2011.10.03 Created version 6.0 edition adding QL-700