Software Developer's Manual Raster Command Reference QL-600/QL-710W/QL-720NW Version 1.
The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2013-2019 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.
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”).
Updates Version Date Contents changed 1.01 03/21/2013 Initial version for QL-710W/ QL-720NW 1.
Raster Command Reference Contents Introduction ······························································································ 1 About Raster Commands ············································································ 2 1. Printing Using Raster Commands ····························································· 3 2. Print Data ······························································································ 5 2.
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.
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.
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.) At your side (プリンタの状態を確認) (3) Send the print data (5) Receive the status (Confirm that printing is completed.) Computer, mobile terminal, etc. Your printer (4) Print (6) Close the port - 3 1.
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.
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 200-byte invalidate command, and then resets the printer to the receiving state.
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. - Zero raster graphics Sends image data for 1 blank line as a compression command. (Valid only when TIFF is selected as the compression mode) 5Ah (Fixed) (4) Print commands Specified at the end of the page.
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.
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.
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.
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. 1 5 7 11 * For QL-600, switch dynamic command mode (1B 69 61 FF) after position 12. Print data - 10 2.
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 1 Invalidate A 200-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.
Raster Command Reference 2.3 Page data details 2.3.1 Resolution Resolution Height-to-Width Proportion 300 dpi high, 300 dpi wide 1:1 600 dpi high, 300 dpi wide 2:1 2.3.2 Page size (a) Continuous length tape 1 3 5 6 Feeding direction 2 6 2 Print area 4 4 5 1 3 Print area Feeding direction Landscape Number Portrait 1 Width 2 Length 3 Print area width (maximum printing width) 4 Print area length 5 Width offset 6 Length offset - 12 2.
Raster Command Reference ID Tape Size 257 12 mm 258 29 mm 264 38mm 262 50 mm 261 54 mm 259 62 mm Designation 1 2 12 mm 12.0 mm 0.47" 142 dots 29 mm 29.0 1.1" 342 dots 38 mm 38.0 mm 1.4" 449 dots 50 mm 50.0 mm 1.9" 590 dots 54 mm 53.8 mm 2.1" 636 dots 62 mm 62.0 mm 2.4" 732 dots mm →2.3.4 →2.3.4 →2.3.4 →2.3.4 →2.3.4 →2.3.4 3 9.0 mm 106 dots 25.9 mm 306 dots 35.0 mm 413 dots 46.9 mm 554 dots 50.0 mm 590 dots 58.9 mm 696 dots 4 →2.3.4 →2.3.4 →2.3.4 →2.3.
Raster Command Reference (b) Die-cut labels 1 1 5 3 5 3 6 6 8 Print area 10 2 2 4 4 Print area 7 Number 9 1 Width 2 Length 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 - 14 2.
Raster Command Reference ID 269 270 370 358 271 272 367 374 383 274 275 362 363 273 ID 273 Label Size 1 2 3 4 5 6 17 mm x 54 mm 17.0 mm 53.9 mm 14.0 mm 47.9 mm 1.5 mm 3.0 mm 0.66" x 2.1" 201 dots 636 dots 165 dots 566 dots 18 dots 35 dots 17 mm x 87 mm 17.0 mm 86.9 mm 14.0 mm 80.9 mm 1.5 mm 3.0 mm 0.66" × 3.4" 201 dots 1026 dots 165 dots 956 dots 18 dots 35 dots 23 mm x 23 mm 23.0 mm 23.0 mm 20.0 mm 17.1 mm 1.5 mm 3.0 mm 0.9" x 0.
Raster Command Reference 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.
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.
Raster Command Reference Total number of pins: 720 pins Number of pins for right margin Raster line Left and right margins First byte Number of print area pins Total number of pins Print area Last byte 0 pin Number of pins for left margin Feeding direction Pins on print head - 18 2.
Raster Command Reference Continuous length tape: Number of Pins Number of Print Number of Pins Number of Bytes for for Left Margin Area Pins for Right Margin Raster Graphics Transfer 12 mm 585 106 29 90 29 mm 408 306 6 90 38 mm 295 413 12 90 50 mm 154 554 12 90 54 mm 130 590 0 90 62 mm 12 696 12 90 Number of Pins Number of Print Number of Pins Number of Bytes for for Left Margin Area Pins for Right Margin Raster Graphics Transfer 17mm x 54mm 555 165 0 90 1
Raster Command Reference 3.
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.
Raster Command Reference Number Offset Size Name Value/Reference 1 0 1 Print head mark Fixed at 80h 2 1 1 Size Fixed at 20h 3 2 1 Reserved Fixed at “B” (42h) 4 3 1 Series code Fixed at “4” (34h) 5 4 1 Model code QL-710W: Fixed at “6” (36h) QL-720NW: Fixed at “7” (37h) QL-600: Fixed at “G” (47h) 6 5 1 Reserved Fixed at “0” (30h) 7 6 1 Reserved Fixed at “0” (30h) 8 7 1 Reserved Fixed at “00h” 9 8 1 Error information 1 Refer to table (1) below.
Raster Command Reference (1) Error information 1 Flag Mask Definition Bit 0 01h “No media” error Bit 1 02h “End of media” error (only for die-cut labels) Bit 2 04h Cutter jam Bit 3 08h (Not used) Bit 4 10h Printer in use Bit 5 20h Printer turned off Bit 6 40h High-voltage adapter (not used) Bit 7 80h Fan motor error (not used) (2) Error information 2 Flag Mask Definition Bit 0 01h “Replace media” error Bit 1 02h “Expansion buffer full” error Bit 2 04h Communication err
Raster Command Reference (3) Media width and length The media width and length is described in millimeters. 0~255 (0 to FFh) (a) Continuous length tape * Media Width: The tape width is indicated in millimeters. * Media Length: Fixed at 00h Media Media Width Media Length 12 mm 12 0 29 mm 29 0 38 mm 38 0 50 mm 50 0 54 mm 54 0 62 mm 62 0 (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.
Raster Command Reference (4) Media type Media Type Value Description No media 00h Used as print information when the media type is not indicated. Continuous length tape 4Ah Used for both paper and film. Die-cut labels 4Bh Used for both paper and film.
Raster Command Reference (6) Phase type and phase number If the phase number is not used, both are fixed at 00h. Phase State Phase Type Receiving state 00h Printing state 01h Receiving state Phase Value (Dec.) Higher Order Bytes Lower Order Bytes Waiting to receive 0 00h 00h Phase Value (Dec.) Higher Order Bytes Lower Order Bytes Printing 0 00h 00h Printing state ⚫ When the printer is turned on, it is in the receiving state.
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.
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 of QL-710W / QL-720NW) (QL-710W / QL-720NW Only) 1: Raster mode (Be sure to switch to this mode.) (default of QL-600) 3: P-touch Template mode (QL-710W / QL-720NW Only) FF: Mode set as default Description ⚫ Dynamically switches between the printer's command modes.
Raster Command Reference ESC i B ASCII: Specify baud rate ESC Hexadecimal: 1B i B {n1} {n2} 69 42 {n1} {n2} Parameters Setting=n1+n2*256 Setting: 96=9600 bps, 576=57600 bps, 1152=115200 bps Description ⚫ Changes the communications baud rate for the printer. The manufacturer’s default setting is 9600 bps. Z Zero raster graphics ASCII: Z Hexadecimal: 5A Description ⚫ Fills raster line with 0 data.
Raster Command Reference ESC i z Print information command ASCII: ESC Hexadecimal: 1B i z {n1} {n2} {n3} {n4} {n5} {n6} {n7} {n8} {n9} {n10} 69 7A {n1} {n2} {n3} {n4} {n5} {n6} {n7} {n8} {n9} {n10} Description ⚫ Specifies the print information.
Raster Command Reference M Select compression mode ASCII: M Hexadecimal: 4D {n} {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. [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.
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.
Raster Command Reference ESC i M Various mode ASCII: ESC Hexadecimal: 1B i M {n} 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.
Raster Command Reference 5. Flow Charts 5.1 Normal flow for USB connection Printer Computer (host) The printer is initialized. Initialize 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 Status information request Status (response to status information request) The status of the printer (media, etc.) is checked and a response is sent. Data received.
Raster Command Reference 5.2 Error flow for USB connection (when feeding at the end of the page) Computer (host) Printer The printer is initialized. Initialize If there are no problems with the printer status (media, READ etc.), the data is transmitted. If there is a problem, an error appears. Displaying sending Status information request Status (response to status information request) Sending control codes The status of the printer (media, etc.) is checked and a response is sent. Data received.
Raster Command Reference 5.3 Error flow for USB connection (with a concurrent printing error such as end of tape) Computer (host) If there are no problems with the printer status (media, etc.), the data is transmitted. If there is a problem, an error appears. Printer Initialize The printer is initialized. Status information request READ Status (response to status information request) Displaying sending Any jobs with errors remaining in the printer are cleared.
Raster Command Reference 5.4 Cooling flow for USB connection Computer (host) Printer Any jobs with errors remaining in the printer are cleared. Initialize 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 The printer is initialized. The status of the printer (media, etc.) is checked and a response is sent. Status information request Status (response to status information request) Data received.
Raster Command Reference 5.5 Flow for setting serial connection baud rate (QL-710W / QL-720NW Only) Computer (host) Printer Specify baud rate Printer waiting to recover from 3000 ms Sleep “Specify baud rate completed” status (normal status) Old baud rate New baud rate Status information request Status (response to status information request) * The request/response at the new baud rate are simply to verify that communication is possible and may be omitted. - 38 5.
Raster Command Reference 5.6 Normal flow for serial connection (QL-710W / QL-720NW Only) Computer (host) Printer Initialize If there are no problems with the printer status (media, READ etc.), the data is transmitted. If there is a problem, an error appears. Displaying sending Status information request Status (response to status information request) Sending control codes The printer is initialized. The status of the printer (media, etc.) is checked and a response is sent. Data received.
Raster Command Reference 5.7 Error flow for serial connection (QL-710W / QL-720NW Only) Computer (host) Printer Initialize If there are no problems with the printer status READ (media, etc.), the data is transmitted. If there is a problem, an error appears. Displaying sending Status information request Status (response to status information request) or an error is displayed Sending control codes The printer is Initialized. The status of the printer (media, etc.) is checked and a response is sent.
Raster Command Reference 5.8 Cleaning flow for serial connection (QL-710W / QL-720NW Only) Computer (host) Printer Initialize If there are no problems with the printer status READ (media, etc.), the data is transmitted. If there is a problem, an error appears. Displaying sending Status information request The printer is initialized. Status (response to status request) Status (response to status information request) Sending control codes Data received.
Raster Command Reference 5.9 Normal Flow for Network (Standard TCP/IP port) Connection (QL-710W / QL-720NW Only) *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 (host) Divide print data into particular size, and send it.
Raster Command Reference Appendix A: USB Specifications USB specifications 1.
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.