User Manual for brother models including: cv ql800 High-speed Professional Label Printer, cv ql800, High-speed Professional Label Printer, Professional Label Printer, Label Printer

Software Developer's Manual - Brother

30 août 2022 — This documentation (“ ation”) provides information that will assist you in controlling your Printer. QL-XXX (where “XXX” is the model name).

Lataa

Käyttöohjeet | QL-800 | Suomi | Brother

Download

Manuals | QL-810W/810Wc | United States | Brother


File Info : application/pdf, 51 Pages, 1.19MB

PDF preview unavailable. Download the PDF instead.

cv ql800 eng raster 101
Software Developer's Manual
Raster Command Reference QL-800/810W/820NWB
Version 1.01

The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2016 Brother Industries, Ltd. All rights reserved.
Microsoft and Windows are registered trademarks of Microsoft Corporation in the United States and other countries.
Each owner whose software title is mentioned in this document has a Software License Agreement specific to its proprietary programs. Any trade names and product names of companies appearing on Brother products, related documents and any other materials are all trademarks or registered trademarks of those respective companies.

IMPORTANT - PLEASE READ CAREFULLY
Note
This documentation ("Documentation") provides information that will assist you in controlling your Printer QL-XXX (where "XXX" is the model name). You may use the Documentation only if you first agree to the following conditions. If you do not agree to the following conditions, you may not use the Documentation.
Condition of Use
You may use and reproduce the Documentation to the extent necessary for your own use of your Printer Model ("Purpose"). Unless expressly permitted in the Documentation, you may not; (i) copy or reproduce the Documentation for any purpose other than the Purpose, (ii) modify, translate or adapt the Documentation, and/or redistribute it to any third party, (iii) rent or lease the Documentation to any third party, or, (iv) remove or alter any copyright notices or proprietary rights legends included within the Documentation.
No Warranty
a. Any updates, upgrades or alteration of the Documentation or Printer Model will be performed at the sole discretion of Brother. Brother may not respond to any request or inquiry about the Documentation.
b. THIS DOCUMENTATION IS PROVIDED TO YOU "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. BROTHER DOES NOT REPRESENT OR WARRANT THAT THIS DOCUMENTATION IS FREE FROM ERRORS OR DEFECTS.
c. IN NO EVENT SHALL BROTHER BE LIABLE FOR ANY DIRECT, INDIRECT, PUNITIVE, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER, ARISING OUT OF THE USE, INABILITY TO USE, OR THE RESULTS OF USE OF THE DOCUMENTATION OR ANY SOFTWARE PROGRAM OR APPLICATION YOU DEVELOPED IN ACCORDANCE WITH THE DOCUMENTATION.

Raster Command Reference

Contents

Introduction ······························································································ 1 About Raster Commands ············································································ 2 1. Printing Using Raster Commands ····························································· 3 2. Print Data ······························································································ 5
2.1 Print data overview ························································································ 5

2.2 Sample (analyzing the print data of the test page) ················································ 8

2.2.1 Preparation ...........................................................................................................8 2.2.2 Checking the print data.........................................................................................8 2.2.3 Explanation of print data for the test page .......................................................... 11

2.3 Page data details ························································································· 13

2.3.1 Resolution .......................................................................................................... 13

2.3.2 Page size............................................................................................................13

2.3.3 Feed amount ...................................................................................................... 16

2.3.4 Maximum and minimum lengths ......................................................................... 16

2.3.5 Raster line .......................................................................................................... 18

3. Print Command List ···············································································21

4. Printing Command Details ······································································22

NULL Invalidate ................................................................................................... 22

ESC i S Status information request ......................................................................... 22

ESC @ Initialize......................................................................................................28

ESC i d Specify margin amount (feed amount) ....................................................... 28

ESC i a Switch dynamic command mode ............................................................... 29

ESC i ! Switch automatic status notification mode ................................................. 30

g

Raster graphics transfer ............................................................................ 30

w

Two-color raster graphics transfer ............................................................. 30

Z

Zero raster graphics...................................................................................31

FF

Print command........................................................................................... 31

Control-Z Print command with feeding ...................................................................... 31

ESC i z Print information command ........................................................................ 32

M

Select compression mode ......................................................................... 33

ESC i A Specify the page number in "cut each * labels" ......................................... 34

ESC i M Various mode.............................................................................................35

ESC i K Expanded mode......................................................................................... 35

5. Flow Charts ··························································································36

5.1 Normal flow for USB connection ······································································ 36

5.2 Error flow for USB connection (when feeding at the end of the page) ······················ 37

5.3 Error flow for USB connection (with a concurrent printing error such as end of tape)··· 38

5.4 Cooling flow for USB connection······································································ 39

5.5 Flow for setting serial connection baud rate ······················································· 40

5.6 Normal flow for serial connection ····································································· 41

5.7 Error flow for serial connection ········································································ 42

5.8 Cleaning flow for serial connection ··································································· 43

5.9 Normal Flow for Network (Standard TCP/IP port) Connection ································ 44

Appendix A: USB Specifications ·································································45 Appendix B: Introducing the Brother Developer Center··································46

- i -

Raster Command Reference
Introduction
This material provides the necessary information for directly controlling the Brother printer QL-XXX (where "XXX" is the model name). This information is provided assuming that the user has full understanding of the operating system being used and basic mastery of USB and networks in a developer's environment. Details concerning the USB interface are not described in this material. If a USB interface is being used, refer to "Appendix A: USB Specifications" to prepare the interface.
Read the model names that appear in the screens in this manual as the name of your printer.

- 1 -

Introduction

Raster Command Reference
About Raster Commands
Using raster commands a QL-XXX printer (where "XXX" is the model name) can be used to print without using our printer driver. This operation is useful in the following situations.  When printing from an operating system other than Windows
(Example: When printing from a Linux computer or mobile terminal)  When adding print functions to an existing system In addition, printing can be performed with advanced settings.
In this material, "raster" refers to binary bitmap data (collection of dots). Refer to this material to print by sending initialization commands and control codes together with raster data to the QL-XXX printer (hereafter, referred to as "printer"). This manual describes the procedure for adding these codes and sending the data.

- 2 -

About Raster Commands

Raster Command Reference
1. Printing Using Raster Commands
The printing procedure is described below. For detailed flow charts, refer to "5. Flow Charts". For details on each command, refer to "4. Printing Command Details".
(1) Open the port
Port (2) Receive the status (Confirm the printer status.) 
(3) Send the print data

At your side

Computer, mobile terminal, etc.

(5) Receive the status (Confirm that printing is completed.)

Your printer

(6) Close the port

(4) Print

- 3 -

1. Printing Using Raster Commands

Raster Command Reference
(1) Open the USB/serial/network port Open the USB/serial/network port in the operating environment. The procedure for opening the USB/serial/network port is not described in this material.
(2) Confirm the printer status sent from the printer 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. For details on the "status information request" command and on the definitions of "status", refer to "Status information request" in "4. Printing Command Details".
(3) Send the print data If the status analysis confirms that media compatible with 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, "2. Print Data". Note: No command can be sent to the printer after the print data is transmitted and until the completion of printing is confirmed. Even the "status information request" command cannot be sent during printing.
(4) Print the data
(5) Confirm that printing is completed When printing is completed, the status is received from the printer. If this status is analyzed to confirm that printing is completed, printing one page is considered finished. If the print job has multiple pages, (2) through (4) are repeated.
(6) Close the USB/serial/network port After all printing is finished, close the USB/serial/network port.
Note: In order to print at high speed when a USB port is used to send uncompressed raster data, the Brother QL-XXX starts printing when it starts to receive print data, instead of waiting for a print command (concurrent printing). For the processing flow, for example when managing errors, refer to "5. Flow Charts".

- 4 -

1. Printing Using Raster Commands

Raster Command Reference

2. Print Data

2.1 Print data overview
The print data is constructed of the following: (1) initialization commands, (2) control codes, (3) raster data, and (4) print commands. If the print job consists of multiple pages, (2) through (4) are repeated.

(1) Initialization commands Specified only once at the beginning of the job.

Sequence Command Name

Description/Example

1

Invalidate

Sends a 400-byte invalidate command, and then resets the printer to the receiving state.

2

Initialize

Initializes for printing. 1Bh, 40h (Fixed)

(2) Control codes

Added at the beginning of each page and sent for each page.

Sequence Command Name

Description/Example

1

Switch dynamic command mode

Switches to raster mode. 1Bh, 69h, 61h, 01h

Switch automatic Dynamically switches whether an automatic status notification is

2

status notification given during printing.

mode

1Bh, 69h, 21h, 00h

3

Print information command

Sets the print information for the printer. For 102-mm-wide continuous length tape: 1Bh, 69h, 7Ah, 86h, 0Ah, 66h, 00h, 09h, 07h, 00h, 00h, 00h, 00h

4

Various mode

To select "Auto Cut" 1Bh, 69h, 4Dh, 40h

5

Specify the page

When an auto cut setting is effective, specify the number of sheets

number in "cut each for auto cut.

* labels"

For each sheets,

1Bh, 69h, 41h, 01h

6

Expanded mode

To select "Cut at End" flag

1Bh, 69h, 4Bh, 08h

7

Specify margin amount

Specifies the amount of the margins. For 3 mm margins: 1Bh, 69h , 64h, 23h, 00h

8

Select compression Selects the compression mode for raster graphics.

- 5 -

2. Print Data

mode

Raster Command Reference
To send the data compressed to TIFF format: 4Dh, 02h

- 6 -

2. Print Data

Raster Command Reference

(3) Raster data Repeated for each page in the print job.

Sequence Command Name

Description/Example

-

Raster graphics transfer

Sends image data as commands.

-

Two-color raster graphics transfer

Sends image data as commands for red-black printing.

Sends image data for 1 blank line as a compression command.

-

Zero raster graphics (Valid only when TIFF is selected as the compression mode)

5Ah (Fixed)

(4) Print commands Specified at the end of the page. Sequence Command Name

-

Print command

-

Print command with feeding

Description/Example
Specifies at the end of a page that is not the last page. 0Ch
Specifies at the end of the last page. 1Ah (Fixed)

- 7 -

2. Print Data

Raster Command Reference
2.2 Sample (analyzing the print data of the test page)
Based on print data created by the printer driver, descriptions of the commands introduced in the previous chapter are provided here. As an example, we will check the print data created when the [Print Test Page] button in the printer Properties dialog box is clicked to print the test page. Since the print data differs depending on the print settings of the printer, refer to this procedure and try creating print data with various print settings. Furthermore, this procedure is for the Windows® 7 operating environment. A similar procedure can be performed if you are using a different operating system.

Printer Properties

Test page

2.2.1 Preparation
Install the two listed below.  Printer driver of the Brother QL-XXX  Binary file editor The data that we will analyze in this sample is a binary file. Therefore, use a binary file editor to display and check the contents of the binary file.
2.2.2 Checking the print data
The procedure for checking the print data is provided below. Step 1: Change the port of the printer to "FILE:". Step 2: Print the desired item (in this case, the test page), and then specify the file name. Step 3: Open the created file in the binary file editor to check it.

- 8 -

2. Print Data

Raster Command Reference
Step 1: Change the port of the printer to "FILE:". Open the Printers and Faxes folder, and then right-click the printer to display the Properties dialog box. In the Properties dialog box, click the [Ports] tab, select the "FILE:" check box, and then click the [Apply] button.
[Ports] tab of the printer Properties dialog box Step 2: Print the item (in this case, the test page), and then specify the file name.
For this sample, print the test page with the default print settings, which were specified immediately after the printer driver was installed.

Default settings immediately after installation of the printer driver - 9 -

2. Print Data

Raster Command Reference
When the test page is printed with the printer, a dialog box appears so that the file name can be specified. (Refer to the illustration below.) After a file name is typed in and the [OK] button is clicked, the printer driver creates the print data and saves it in a file with the specified name.
Dialog box for specifying the file name
Step 3: Open the print data in the binary file editor. Open the saved file in the binary file editor. The rows of numbers that appear are the print data. (Refer to the illustration below.) The print data is constructed of the following: (1) initialization commands, (2) control codes, (3) raster data and (4) print commands, which were described in "2.1 Print data overview". For details on the print data, refer to "2.2.3 Explanation of print data for the test page".
(1) Initialization commands
(2) Control codes
(3) Raster data
(4) Print commands Print data

- 10 -

2. Print Data

Raster Command Reference
2.2.3 Explanation of print data for the test page The print data for the test page outputted in the previous section is described below. The following illustration shows the print data created in section "2.2.1 Preparation" opened in the binary file editor.



2

3

4

5

6

7 8

9 10 11

12

13
Print data

- 11 -

2. Print Data

Raster Command Reference

Descriptions for the numbers in the print data on the previous page are provided in the following table. For details on each command, refer to "4. Printing Command Details".

No.

Command Name

Description



Invalidate

A 400-byte invalidate command is sent.

2

Initialize

The "initialize" command is sent.

3

Switch dynamic command mode

The printer is switched to raster mode. Send this command before sending raster data to the printer.

Switch automatic

4

status notification

mode

Dynamically switches whether an automatic status notification is given during printing.

5

Job ID setting commands

Internal specification commands Since this is a command for outputting with the commercial version driver, it is unnecessary for the user to send this command.

6

Print information command

Media size information for the print data is sent.
This is the command for "1.1" × 3.5" (29 mm × 90 mm)" die-cut labels.

7

Various mode

(1Bh+69h+4Dh+00H)

This is the command for specifying settings such as cut options. Here, "auto cut" is specified.

8

Specify the page
number in "cut each * labels"

The number of pages printed before automatically cutting is specified.

9

Expanded mode

This is the command for specifying expanded functions. Here, "cut at end" is specified.

10

Specify margin amount

Since a margin amount cannot be specified with die-cut labels, this command is sent with a margin amount of 0.

11

Select compression mode

TIFF compression mode is selected.

12

Raster data

Raster data continues.

13

Print command with feeding

Since one page will be printed, this is sent at the end of the first page.

- 12 -

2. Print Data

2.3 Page data details
2.3.1 Resolution Resolution
300 dpi high, 300 dpi wide 600 dpi high, 300 dpi wide
2.3.2 Page size (a) Continuous length tape

Raster Command Reference

Height-to-Width Proportion 1:1 2:1

1

3

5

6

Feeding direction

6 5
1 3

2 4
Print area

Print area

2 4

Feeding direction Landscape

Number

1 Width 3 Print area width (maximum printing width) 5 Width offset

Portrait
2 Length 4 Print area length 6 Length offset

ID 257 258

Tape Size 12 mm 29 mm

Designation

1

2

12 mm 0.47"

12.0 mm 142 dots

2.3.4

29 mm 1.1"

29.0 mm 2.3.4 342 dots

3
9.0 mm 106 dots
25.9 mm 306 dots

4 2.3.4 2.3.4

5
1.5 mm 18 dots
1.5 mm 18 dots

6 2.3.3 2.3.3

- 13 -

2. Print Data

Raster Command Reference

264

38mm

262

50 mm

261

54 mm

259

62 mm

38 mm 1.4"
50 mm 1.9"
54 mm 2.1"
62 mm 2.4"

38.0 mm 449 dots
50.0 mm 590 dots
53.8 mm 636 dots
62.0 mm 732 dots

2.3.4 2.3.4 2.3.4 2.3.4

35.0 mm 413 dots
46.9 mm 554 dots
50.0 mm 590 dots
58.9 mm 696 dots

2.3.4 2.3.4 2.3.4 2.3.4

1.5 mm 18 dots
1.5 mm 18 dots
1.9 mm 23 dots
1.5 mm 18 dots

2.3.3 2.3.3 2.3.3 2.3.3

- 14 -

2. Print Data

(b) Die-cut labels
1 5
3 6

2 4

Print area

Raster Command Reference

1

5

3

6 8
Print area 10

24

7

9

Number

1 Width 3 Print area width (maximum printing width) 5 Width offset 7 Width offset of masked area 9 Width of masked area

2 Length 4 Print area length 6 Length offset 8 Length offset of masked area 10 Length of masked area

ID

Label Size

1

2

3

4

5

6

17 mm x 54 mm 269
0.66" x 2.1"

17.0 mm 201 dots

53.9 mm 636 dots

14.0 mm 165 dots

47.9 mm 566 dots

1.5 mm 18 dots

3.0 mm 35 dots

17 mm x 87 mm 270
0.66" × 3.4"

17.0 mm 201 dots

86.9 mm 1026 dots

14.0 mm 165 dots

80.9 mm 956 dots

1.5 mm 18 dots

3.0 mm 35 dots

23 mm x 23 mm 370
0.9" x 0.9"

23.0 mm 272 dots

23.0 mm 272 dots

20.0 mm 236 dots

17.1 mm 202 dots

1.5 mm 18 dots

3.0 mm 35 dots

29 mm × 42 mm 358
1.1" x 1.6"

29.0 mm 342 dots

41.9 mm 495 dots

25.9 mm 306 dots

36.0 mm 425 dots

1.5 mm 18 dots

3.0 mm 35 dots

29 mm x 90 mm
271 1.1" x 3.5"

29.0 mm 342 dots

89.8 mm 1061 dots

25.9 mm 306 dots

83.9 mm 991 dots

1.5 mm 18 dots

3.0 mm 35 dots

38 mm x 90 mm
272 1.4" x 3.5"

38.0 mm 449 dots

89.8 mm 1061 dots

35.0 mm 413 dots

83.9 mm 991 dots

1.5 mm 18 dots

3.0 mm 35 dots

39 mm x 48 mm
367 1.5" x 1.8"

39.0 mm 461 dots

47.8 mm 565 dots

36.0 mm 425 dots

41.9 mm 495 dots

1.5 mm 18 dots

3.0 mm 35 dots

52 mm x 29 mm
374 2" x 1.1"

52.0 mm 614 dots

28.9 mm 341 dots

48.9 mm 578 dots

22.9 mm 271 dots

1.5 mm 18 dots

3.0 mm 35 dots

54 mm x 29 mm
382 2.1" x 1.1"

54.0 mm 638 dots

28.9 mm 341 dots

51.0 mm 602 dots

22.9 mm 271 dots

1.5 mm 18 dots

3.0 mm 35 dots

- 15 -

2. Print Data

Raster Command Reference

60 mm x 86 mm
383 2.3" x 3.4"
62 mm x 29 mm
274 2.4" x 1.1"
62 mm x 60 mm
388 2.4" x 2.3"
62 mm x 75 mm
389 2.4" x 2.9"
62 mm x 100 mm
275 2.4" x 3.9"
12 mm Dia
362 0.47" Dia
24 mm Dia
363 0.94" Dia
58 mm Dia 273
2.2" Dia

60.0 mm 708 dots
62.0 mm 732 dots
62.0 mm 732 dots
62.0 mm 732 dots
62.0 mm 732 dots
12.0 mm 142 dots
24.0 mm 284 dots
58.3 mm 688 dots

86.8 mm 1024 dots
28.9 mm 341 dots
60.6 mm 716 dots
75.4 mm 891 dots
99.8 mm 1179 dots
12.0 mm 142 dots
24.0 mm 284 dots
58.3 mm 688 dots

56.9 mm 672 dots
58.9 mm 696 dots
58.9 mm 696 dots
58.9 mm 696 dots
58.9 mm 696 dots
8.0 mm 94 dots
20.0 mm 236 dots
52.3 mm 618 dots

80.8 mm 954 dots
22.9 mm 271 dots
54.6 mm 645 dots
69.4 mm 820 dots
93.9 mm 1109 dots
8.0 mm 94 dots
20.0 mm 236 dots
52.3 mm 618 dots

1.5 mm 18 dots
1.5 mm 18 dots
1.5 mm 18 dots
1.5 mm 18 dots
1.5 mm 18 dots
2.0 mm 24 dots
2.0 mm 24 dots
3.0 mm 35 dots

3.0 mm 35 dots
3.0 mm 35 dots
3.0 mm 35 dots
3.0 mm 35 dots
3.0 mm 35 dots
2.0 mm 24 dots
2.0 mm 24 dots
3.0 mm 35 dots

ID

7

8

9

10

19.64 mm 273
201 dots

53.9 mm 636 dots

14.0 mm 165 dots

47.9 mm 566 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 are added to a diameter of 16 mm.

2.3.3 Feed amount

The feed amount (left and right margins) is defined below.

Type

Minimum Margin Setting

Maximum Margin Setting

Continuous length tape

3 mm 0.12" 35 dots

127 mm 5" 1500 dots

Die-cut labels

The length offset indicated in "(b) Die-cut labels" of "2.3.2 Page size" is used.
However, set "0" as the value of the "specify margin amount" command.

*1 The number of dots in the table is for 300 dpi; it is difference in the high-resolution mode.

2.3.4 Maximum and minimum lengths

The maximum and minimum lengths are defined below.

Type

Minimum Length

Maximum Length

- 16 -

2. Print Data

Raster Command Reference

Continuous length tape

12.7 mm 150 dots

1000 mm 11811 dots

Die-cut labels

Fixed

Fixed

*1 The number of dots in the table is for 300 dpi; it is difference in the high-resolution mode.

- 17 -

2. Print Data

Raster Command Reference

2.3.5 Raster line
As shown below, the parts with data to be printed are converted with "raster graphics transfer", and the parts with no data are converted with "zero raster graphics". On the actual tape, margins (feed) are added specified with "various mode" at the beginning and the end.
Feeding direction

Expansion direction

Print area

Rasterized

RasterLine 4 Zero Raster 1 Zero Raster 1 RasterLine 3 RasterLine 2 RasterLine 1

Feeding direction

Print area

Print head

The following shows the relationship between the raster graphics parameters and the pixels.

MSB LSB 1stB

MSB LSB 2ndB

MSB LSB 3rdB

MSB LSB 4thB ...

- 18 -

2. Print Data

Total number of pins: 720 pins
Number of pins for right margin

Raster Command Reference

Raster line First byte

Left and right margins

Number of print area pins
Total number of pins

Print area

Last byte

0 pin Number of pins
for left margin
Pins on print head

Feeding direction

Continuous length tape:

Tape Size

Number of Pins for Left Margin

12 mm

585

29 mm

408

38 mm

295

50 mm

154

54 mm

130

62 mm

12

Number of Print Area Pins 106 306 413 554 590 696

Number of Pins for Right Margin
29 6 12 12 0 12

Number of Bytes for Raster Graphics Transfer
90 90 90 90 90 90

Die-cut labels:
Label Size 17mm x 54mm 17mm x 87mm

Number of Pins for Left Margin
555
555

Number of Print Area Pins
165
165

Number of Pins for Right Margin
0
0

Number of Bytes for Raster Graphics Transfer
90
90

- 19 -

2. Print Data

Raster Command Reference

23mm x 23mm

442

236

42

90

29mm x 42mm

408

306

6

90

29mm x 90mm

408

306

6

90

38mm x 90mm

295

413

12

90

39mm x 48mm

289

425

6

90

52mm x 29mm

142

578

0

90

54mm x 29mm

59

602

59

90

60mm x 86mm

24

672

24

90

62mm x 29mm

12

696

12

90

62mm x 100mm

12

696

12

90

12mm Dia

513

94

113

90

24mm Dia

442

236

42

90

58mm Dia

51

618

51

90

- 20 -

2. Print Data

3. Print Command List

ASCII Code NULL ESC i S ESC @ ESC i d ESC i a ESC i !

Binary Code 00 1B 69 53 1B 40 1B 69 64 1B 69 61 1B 69 21

g

67

w
Z FF Control-Z ESC i z M ESC i A ESC i M ESC i K

77
5A 0C 1A 1B 69 7A 4D 1B 69 41 1B 69 4D 1B 69 4B

Raster Command Reference
Description Invalidate Status information request Initialize Specify margin amount (feed amount) Switch dynamic command mode Switch automatic status notification mode Raster graphics transfer (for monochromatic printing) Two-color raster graphics transfer (for two-color printing) Zero raster graphics Print command Print command with feeding Print information command Select compression mode Specify the page number in "cut each * labels" Various mode Expanded mode

- 21 -

3. Print Command List

Raster Command Reference

4. Printing Command Details

NULL

Invalidate

ASCII:

NULL

Hexadecimal: 00

Description  Skipped  If data transmission is to be stopped midway, send the "initialize" command after sending the "invalidate"
command for the appropriate number of bytes to return to the receiving state, where the print buffer is cleared.

ESC i S Status information request

ASCII:

ESC

Hexadecimal: 1B

i S 69 53

Description  When a status information request is sent to the printer, a fixed size of 32 bytes is returned as a response
from the printer. For details on these 32 bytes, refer to the following page. Note Before sending print data to the printer, this command should be sent once. Since error information is automatically sent by the printer during printing, do not send this command while printing. For details on transmission of the status, refer to "5. Flow Charts".

- 22 -

4. Printing Command Details

Number 1 2 3 4

Offset 0 1 2 3

Size 1 1 1 1

Name Print head mark Size Reserved Series code

5

4

1 Model code

6

5

1 Reserved

7

6

1 Reserved

8

7

1 Reserved

9

8

1 Error information 1

10

9

1 Error information 2

11

10

1 Media width

12

11

1 Media type

13

12

1 Reserved

14

13

1 Reserved

15

14

1 Reserved

16

15

1 Mode

17

16

1 Reserved

18

17

1 Media length

19

18

1 Status type

20

19

1 Phase type

21

20

1

Phase number (higher order bytes)

22

21

1

Phase number (lower order bytes)

23

22

1 Notification number

24

23

1 Reserved

25

24

8 Reserved

Raster Command Reference
Value/Reference Fixed at 80h Fixed at 20h Fixed at "B" (42h) Fixed at "4" (34h) QL-800 "8" (38h) QL-810W "9" (39h) QL-820NWB "A" (41h) Fixed at "0" (30h) Fixed at "0" (30h) Fixed at "00h" Refer to table (1) below. Refer to table (2) below. Refer to table (3) below. Refer to table (4) below. Fixed at 00h Fixed at 00h Fixed at 3Fh Value specified where the "various mode" command 00h if not specified Fixed at 00h Refer to table (3) below. Refer to table (5) below.
Refer to table (6) below.
Refer to table (7) below. Fixed at 00h Fixed at 00h

- 23 -

4. Printing Command Details

Raster Command Reference

(1) Error information 1 Flag Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7
(2) Error information 2 Flag Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5
Bit 6
Bit 7

Mask 01h 02h 04h 08h 10h 20h 40h 80h
Mask 01h 02h 04h 08h 10h 20h 40h 80h

Definition "No media" error "End of media" error (only for die-cut labels) Cutter jam (Not used) Printer in use Printer turned off High-voltage adapter (not used) Fan motor error (not used)
Definition "Replace media" error "Expansion buffer full" error Communication error "Communication buffer full" error (not used) "Cover open" error Cancel key (not used) Media cannot be fed (also when the media end is detected) System error

- 24 -

4. Printing Command Details

Raster Command Reference

(3) Media width and length The media width and length is described in millimeters. 0255 (0 to FFh) (a) Continuous length tape * Media Width: The tape width is indicated in millimeters. * Media Length: Fixed at 00h

Media

Media Width

12 mm

12

29 mm

29

38 mm

38

50 mm

50

54 mm

54

62 mm

62

(b) Die-cut labels * Media Width: The width of the die-cut section is indicated. * Media Length: The length of the die-cut section is indicated.

Media

Media Width

17 mm x 54 mm

17

17 mm × 87 mm

17

23 mm × 23 mm

23

29 mm × 42 mm

29

29 mm × 90 mm

29

38 mm × 90 mm

38

39 mm x 48 mm

39

52 mm x 29 mm

52

54 mm x 29 mm

54

60 mm x 86 mm

60

62 mm x 29 mm

62

62 mm x 100 mm

62

12 mm Dia

12

24 mm Dia

24

58 mm Dia

58

Media Length 0 0 0 0 0 0
Media Length 54 87 23 42 90 90 48 29 29 86 29 100 12 24 58

- 25 -

4. Printing Command Details

Raster Command Reference

(4) Media type Media Type
No media Continuous length tape Die-cut labels

Value 00h 4Ah 4Bh

Description Used as print information when the media type is not indicated. Used for both paper and film. Used for both paper and film.

(5) Status type

Status Type

Value

Reply to status request

00h

Printing completed

01h

Error occurred

02h

Turned off

04h

Notification

05h

Phase change

06h

(Not used)

08h to 20h

(Reserved)

21h to FFh

If an error occurred during printing, the printer returns the error status.

- 26 -

4. Printing Command Details

Raster Command Reference

(6) Phase type and phase number If the phase number is not used, both are fixed at 00h. Phase State Receiving state Printing state

Phase Type 00h 01h

Receiving state Phase
Waiting to receive

Value (Dec.) 0

Higher Order Bytes 00h

Lower Order Bytes 00h

Printing state Phase

Value (Dec.)

Higher Order Bytes

Lower Order Bytes

Printing

0

00h

00h

 When the printer is turned on, it is in the receiving state. When printing begins, it changes to the "printing" phase (phase type: printing state; phase number: printing), and the printer sends that phase status to the

computer. When printing has finished, the printer sends the "receiving state" phase status (phase type: receiving state; phase number: waiting to receive) to the computer. Unless an error occurs during printing,

the printer sends the "printing completed" status.  With concurrent printing, printing starts even if a print command has not been sent from the computer in

order to print at high speed. At this time, care should be taken since the "printing" and "waiting to receive" phase statuses will be sent. (Refer to "5. Flow Charts".) (7) Notification number

Notification

Value

Not available

00h

Cooling (started)

03h

Cooling (finished)

04h

- 27 -

4. Printing Command Details

Raster Command Reference

ESC @

Initialize

ASCII:

ESC @

Hexadecimal: 1B 40

Description  Initializes mode settings.  Also used to cancel printing.

ESC i d Specify margin amount (feed amount)

ASCII:

ESC

Hexadecimal: 1B

i d {n1} {n2} 69 64 {n1} {n2}

Description  Specifies the amount of the margins.  Margin amount (dots)=n1+n2*256  With die-cut labels, the margin amount at the ends of the printed area is 0.

(a) Continuous length tape Paper

Tape

Print area

(b) Die-cut labels

Margin amount

Cut line

Paper Label

Print area

Margin amount (only "0" is available)

Cut line

- 28 -

4. Printing Command Details

Raster Command Reference

ESC i a

Switch dynamic command mode

ASCII:

ESC

Hexadecimal: 1B

i a {n1} 69 61 {n1}

Parameters Definitions of {n}: 0: ESC/P mode (default) 1: Raster mode (Be sure to switch to this mode.) 3: P-touch Template mode

Description  Dynamically switches between the printer's command modes. A printer that receives this command
operates in the specified command mode until the printer is turned off.  The printer must be switched to raster mode before raster data is sent to it. Therefore, send this command
to switch the printer to raster mode.

- 29 -

4. Printing Command Details

Raster Command Reference

ESC i !

Switch automatic status notification mode

ASCII:

ESC

Hexadecimal: 1B

i ! {n1} 69 21 {n1}

Parameters Definitions of {n1} 0Notify. (default) 1Do not notify.

Description  Dynamically switches whether the automatic status notification is given during printing. A printer that
receives this command operates in the specified command mode until the printer is turned off.  Use this command when building a system where the status is not obtained using a status information
request.

g

Raster graphics transfer

ASCII:

g

Hexadecimal: 67

{s} {n} {d1} ... {dn} {s} {n} {d1} ... {dn}

Parameters {s} 00h {n} Number of bytes of raster data (d1 to dh) However, use the following value if no compression is specified as the compression mode. n=90 {d1~dn} Raster data.

w

Two-color raster graphics transfer

ASCII:

w

Hexadecimal: 77

{c} {n1} {d1} ... {dn} {c} {n1} {d1} ... {dn}

Parameters {s} Color No 0x01...First color data (high energy) 0x02...Second color data (low energy) {n1} Transfers the specified number of bytes {n1} of data. {d1~dn} Raster data.

- 30 -

4. Printing Command Details

Z

Zero raster graphics

ASCII:

Z

Hexadecimal: 5A

Description  Fills raster line with 0 data.
* The QL-800 does not support this command.

Raster Command Reference

FF

Print command

ASCII:

FF

Hexadecimal: 0C

Description  Used as a print command at the end of pages other than the last page when multiple pages are printed.

Control-Z Print command with feeding

ASCII:

Control-Z

Hexadecimal: 1A

Description  Used as a print command at the end of the last page.

- 31 -

4. Printing Command Details

Raster Command Reference

ESC i z

Print information command

ASCII:

ESC i z {n1} {n2} {n3} {n4} {n5} {n6} {n7} {n8} {n9} {n10}

Hexadecimal: 1B 69 7A {n1} {n2} {n3} {n4} {n5} {n6} {n7} {n8} {n9} {n10}

Description  Specifies the print information.  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 bytes) `w' 02 90 Second color data (90 bytes)

{n9}: {n10}:

Starting page: 0 Other pages: 1
Fixed at 0

- 32 -

4. Printing Command Details

Raster Command Reference

M

Select compression mode

ASCII:

M {n}

Hexadecimal: 4D {n}

Parameters Definitions of {n} 0 No-compression mode (Enabled) 1 Reserved (Disabled) 2 TIFF (Enabled)
Description  Selects the compression mode. Data compression is available only for data in raster graphic transfer.
* The QL-800 does not support the compression mode.
[TIFF(Pack Bits)]  1-byte units  If the same data is repeated, the number of data units and that 1 byte of data are specified.
If different data is in a series, the number of data items and all of the different data are specified.  If the same data is repeated, the number of data units is specified as the actual number minus 1,
expressed as a negative number. If different data is in a series, the number of data units is specified as the number of bytes minus 1, 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, the data will be 91 bytes, including the 1 byte that specifies the data length.
Example 1 raster of raster graphics transfer:
Without compression: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 22 22 23 BA BF A2 22 2B......

With compression:

ED 00 FF 22 05 23 BA BF A2 22 2B ...

a

b

c

a. Since "00h" is repeated for 20 bytes, 20d -> 19d -> 13h changed into a negative number is EDh. Therefore: ED 00
b. Since "22h" is repeated for 2 bytes, 2d -> 1d -> 1h changed into a negative number is FFh. Therefore: FF 22
c. The following 6 bytes remain unchanged. 6d -> 5d -> 5h Therefore: 05 23 BA BF A2 22 2B
Continue for the remaining number of bytes for the uncompressed data. Even if 00h continues until the end, it cannot be omitted.

- 33 -

4. Printing Command Details

Raster Command Reference

Explanation of "TIFF compression mode" With compression, the data for the "raster graphics transfer" command is based on 90 bytes of the total number of pins (720). As shown below, with no compression, the sum of the number of offset pins and the number of pins within the print area is the byte data. However, with compression, the number of unused pins is also added to the data. In other words, with compression, this becomes 90 bytes when it is expanded by the printer, regardless of the tape width.

Raster line with compression

Raster line with no compression

0 pin

First byte

Number of offset pins

Tape margin

Number of print area pins
Total number of pins

Print area

Number of unused pins

Last byte

Pins on print head

Feeding direction

ESC i A Specify the page number in "cut each * labels"

ASCII:

ESC i A {n}

Hexadecimal: 1B 69 41 {n}

Parameters Definitions of {n} Page number = n1 (1 - 255) Default is 1 (cut each label).

Description When "auto cut" is specified, you can specify page number (1 - 255) in "cut each * labels".

- 34 -

4. Printing Command Details

ESC i M Various mode

ASCII:

ESC i M {n}

Hexadecimal: 1B 69 4D {n}

Parameters Definitions of {n} The meaning of each bit in a 1-byte parameter is described below. 1 ~ 6bit: Not used 7bit: Auto cut 1: Auto cut 0:No auto cut 8bit: Not used

ESC i K Expanded mode

ASCII:

ESC

Hexadecimal: 1B

i K {n} 69 4B {n}

Parameters Definitions of {n} The meaning of each bit in a 1-byte parameter is described below. 1bit: Two-color printing 2,3bit: Not used 4bit: Cut at end 1:Cut at end (default) 0:Not cut at end 5,6bit: Not used 7bit: High resolution printing 1: It prints at 600 dpi in the paper length direction 0: It prints at 300 dpi in the paper length direction.default 8bit: Not used

Raster Command Reference

- 35 -

4. Printing Command Details

Raster Command Reference

5. Flow Charts

5.1 Normal flow for USB connection

Computer (host)
If there are no problems with the printer status (media, etc.), the data is READ transmitted. If there is a problem, an error appears.
Displaying sending

Initialize Status information request Status (response to status information request)

Printer
The printer is initialized.
The status of the printer (media, etc.) is checked and a response is sent.

Sending control codes Sending raster data

Status (Phase change:
"Printing")

Data received. Beginning printing without waiting for a print command
Printing

Sending raster data Sending raster data Sending raster data

Display ing printing READ
Phase change "Printing" received. "Printing completed" received.
Finishing process for printing page 1
Sending data for page 2

Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other pages)
Status ("Printing completed")
Status (Phase change: "Waiting to receive")
Sending control code/print data Status
(Phase change: "Printing")
Sending raster data Sending raster data
Sending raster data

Printing of the 1st page is actually not finished, but the "Printing completed" status and "Waiting to receive" phase are sent.
Printing 1st page
Printing 2nd page

- 36 -

5. Flow Charts

Raster Command Reference

5.2 Error flow for USB connection (when feeding at the end of the page)

Computer (host)

If there are no

problems with the

printer status (media,

etc.), the data is

READ

transmitted. If there is

a problem, an error

appears.

Displaying sending

Initialize Status information request Status (response to status information request)

Printer
The printer is initialized.
The status of the printer (media, etc.) is checked and a response is sent.

Sending control codes Sending raster data
Sending raster data

Status (Phase change:
"Printing")

Data received.
Beginning printing without waiting for a print command
Printing

Displaying printing READ
Phase change "Printing" received. "Printing completed" received. Finishing process for printing page 1
Sending data for page 2
Displaying printing
Displaying printing READ
"Error Occured" received. An error appears. When restarted, data is resent starting with the 1st page since "Printing" for the 2nd page is not received.
Resending process for data of 1st page

Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other page)

Status ("Printing completed") Status (Phase change: "Waiting to receive")

Sending control code/raster data

Sending raster data

Status ("Error occurred")

Sending raster data

Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other pages)

Initialize

Printing of the 1st page is actually not finished, but the "Printing completed" status and "Waiting to receive" phase are sent.
Error occurred
If an error occurs, all data read from the computer is cleared.
Reprinting 1st page

- 37 -

5. Flow Charts

Raster Command Reference

5.3 Error flow for USB connection (with a concurrent printing error such as end of tape)

Computer (host)

Printer

If there are no problems with the printer status (media, etc.), the data is transmitted. If there is a problem, an error appears.

READ

Displaying sending

Initialize Status information request Status (response to status information request)
Sending control codes

Sending raster data

Status (Phase change :
"Printing")

Sending raster data

Displaying printing

Phase change "Printing" received.

READ

Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other pages)

"Printing completed" received.
Phase change "Waiting to receive" received.
Finishing process for printing page 1
Sending data for page 2

Status ("Printing completed") Status (Phase change: "Waiting to receive")
Sending control code/raster data

Sending raster data

Status (Phase change :
"Printing")

Sending raster data

Status ("Error Occurred")

Displaying printing

Phase change "Printing" received.

READ

"Error Occured" received.

An error appears.
When restarted, data is resent starting with the 2nd page since "Printing" for the 2nd page is received.

Resending process for data of 2nd page

Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other pages)
Initialize

Any jobs with errors remaining in the printer are cleared. The printer is initialized. The status of the printer (media, etc.) is checked and a response is sent. Data received.
Beginning printing without waiting for a print command Printing
Printing of the 1st page is actually not finished, but the "Printing completed" status and "Waiting to receive" phase are sent.
Printing 1st page Printing 2nd page
Error occurred
If an error occurs, all data read from the computer is cleared.
Reprinting 2nd page

- 38 -

5. Flow Charts

Raster Command Reference

5.4 Cooling flow for USB connection

Computer (host)

If there are no problems with the printer status (media, etc.), the READ data is transmitted. If there is a problem, an error appears.
Displaying sending

Initialize Status information request Status (response to status information request)
Sending control codes

Printer Any jobs with errors remaining in the printer are cleared. The printer is initialized.
The status of the printer (media, etc.) is checked and a response is sent.
Data received.

Sending raster data

Status (Phase change:
"Printing")

Beginning printing without waiting for a print command
Printing

Sending raster data

Sending raster data Sending raster data

READ
Repeating reading of maximum and transmission timeout times. If the transmission timeout is exceeded, reading, and displaying the cooling status if a hightemperature error is returned.
Continuing reading. 0 packets are returned while cooling.
When cooling is finished, Notification: "Cooling (finished)" is returned.

Sending raster data

Status (Notification: "Cooling (started)")
Failed

Cooling occurred
Returned "NAK" from cooling

0 packet 0 packet 0 packet 0 packet
Status (Notification: "Cooling (finished)") Sending raster data

Resuming printing

Sending raster data

- 39 -

5. Flow Charts

Raster Command Reference

5.5 Flow for setting serial connection baud rate

Computer (host)

Printer waiting to recover from 3000 ms Sleep
Old baud rate New baud rate

Specify baud rate
"Specify baud rate completed" status (normal status) Status information request

Status (response to status information request)

Printer

* The request/response at the new baud rate are simply to verify that communication is possible and may be omitted.

- 40 -

5. Flow Charts

Raster Command Reference

5.6 Normal flow for serial connection

Computer (host)

Printer

If there are no

problems with the

printer status (media,

etc.), the data is

READ

transmitted. If there is

a problem, an error

appears.

Displaying sending

Initialize Status information request Status (response to status information request)
Sending control codes Sending raster data

The printer is initialized.
The status of the printer (media, etc.) is checked and a response is sent.
Data received.

Sending raster data Sending raster data Sending raster data

Displaying printing

Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other page)

Printing

Phase change "Printing" received.

READ

"Printing completed" received.

Status (Phase change: "Printing")
Status ("Printing completed")

Phase change "Waiting to receive" received.
Finishing process for printing 1st page
Sending data for 2nd page

Status (Phase change: "Waiting to receive")
Sending control codes

Printing 1st page Printing 2nd page

Sending raster data

Sending raster data

- 41 -

5. Flow Charts

Raster Command Reference

5.7 Error flow for serial connection

Computer (host)

If there are no

problems with the

printer status (media, etc.), the

READ

data is transmitted.

If there is a problem,

an error appears.

Initialize
Status information request
Status (response to status information request) or an error is displayed

Printer
The printer is Initialized.
The status of the printer (media, etc.) is checked and a response is sent.

Displaying sending
Displaying printing READ
Phase change "Printing" received.

Sending control codes
Sending raster data
Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other page)
Status (Phase change: "Printing")

Data received. Printing

Status ("Error Occurred")

Error occurred

- 42 -

5. Flow Charts

Raster Command Reference

5.8 Cleaning flow for serial connection

Computer (host)

If there are no

problems with the

printer status (media, etc.), the

READ

data is transmitted.

If there is a problem,

an error appears.

Initialize
Status information request Status (response to status
information request)

Printer
The printer is initialized.
Status (response to status request)

Displaying sending

Displaying printing

Phase change "Printing" received.

READ

Sending control codes
Sending raster data
Sending a print command (print command with feeding (1A) for the last page or print command (0C) for other page)
Status (Phase change :"Printing")
Status (Notification: "Cooling (started)")

Data received. Printing Cooling

* "Cooling (standard)" and "Cooling (finished)" may be repeated multiple times during one printing operation.
"Printing completed" received.
Phase change "Waiting to receive" received.
End process for printing 1st page Sending data for 2nd page

Status (Notification: "Cooling (finished)")
Status (Printing completed)
Status (Phase change: "Waiting to receive")
Sending control codes Sending raster data Sending raster data

Printing
Printing 1st page Printing 2nd page

- 43 -

5. Flow Charts

Raster Command Reference

5.9 Normal Flow for Network (Standard TCP/IP port) Connection

*With a network connection, print data from the operating system's port monitor is simply sent as is. When it prints 2 pages data

Computer

Printer

Divide print data into particular size, and send it.

Sending raster data Sending raster data

Sending raster data Sending raster data

Receive data

End process for printing 1st
Sending data for 2nd page

BUSY BUSY

Sending raster data Sending raster data Sending raster data Sending raster data Sending raster data

As one page data receives in the printer buffer, start printing
Printing 1st page
Printer buffer is full

BUSY

Sending raster data

BUSY
At host side, as sending print data has completed, the print job data is erased. The print job is treated to be completion at printer side

Sending raster data Sending raster data Sending raster data Sending raster data Sending raster data Sending raster data

As 2nd page data receives in the printer buffer, start printing.
Printing 2nd page

- 44 -

5. Flow Charts

Raster Command Reference

Appendix A: USB Specifications

USB specifications 1.1 Item
Vendor ID
Product ID
Class Character string for
manufacturer Character string for
serial number Device speed Number of interfaces Power supply
End point 1
End point 2

Description
0x04F9
QL-800 : 0x209b QL-810W : 0x209c QL-820NWB : 0x209d
Printer Mass storage
Character string descriptor: 0x01 0x0409: "Brother"
Character string descriptor: 0x03 0x0409: "000000000001" Last twelve digits of the printer's serial number
Full speed
1 (No alternate interfaces)
Self-powered
In bulk (Sends the status from the printer to the computer.) Maximum packet size: 64 bytes
Out bulk (Sends print commands and data from the computer to the printer.) Maximum packet size: 64 bytes

- 45 -

Appendix A: USB Specifications

Raster Command Reference
Appendix B: Introducing the Brother Developer Center
Useful information for developers, such as applications, tools, SDKs as well as FAQs, are provided in the Brother Developer Center. http://www.brother.com/product/dev/index.htm
- 46 Appendix B: Introducing the Brother Developer Center



References

Microsoft Word for Microsoft 365 Microsoft Word for Microsoft 365