Software Developer's Manual Raster Command Reference PT-E550W/P750W/P710BT Version 1.
The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2014 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 PT-XXXX (where “XXXX” 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”).
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 PT-XXXX (where “XXXX” 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 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 an PT-XXXX printer (where “XXXX” 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) Send the status (Confirm the printer status.) At your side (プリンタの状態を確認) (3) Send the print data (5) Send 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/network port Open the USB/network port in the operating environment. The procedure for opening the USB/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 100-byte invalidate command, and then resets the printer to the receiving state.
Raster Command Reference 8 Select compression mode Selects the compression mode for raster graphics. To send the data compressed to TIFF format: 4Dh, 02h - 6 2.
Raster Command Reference (3) Raster data Repeated for each page in the print job. Sequence Command Name Description/Example - Raster graphics transfer Sends a raster line that contains data with pixels set to “ON”. - Zero raster graphics Sends a raster line with all pixels set to “0”.(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) The print data created by the printer driver is described 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.
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 (in this case, RJ-4030) 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. Print data (Left:PT-P750W, Right:PT-P710BT) - 11 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 100-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 180 dpi high, 180 dpi wide 1:1 180 dpi high, 360 dpi wide 1:2 - 13 2.
Raster Command Reference 2.3.2 Page size (a) Continuous length tape 2 6 4 5 1 3 Print area Feeding direction Landscape Number 1 Width 2 Length 3 Print area width (maximum printing width) 4 Print area length 5 Width offset 6 Length offset TZe tape ID Tape Size Designation 1 2 3 4 5 6 263 3.5 mm 3.5 mm 0.13" 3.40 mm 24 dots →2.3.4 3.40 mm 24 dots →2.3.4 0.00 mm 0 dots →2.3.3 257 6 mm 6 mm 0.23" 5.90 mm 42 dots →2.3.4 4.50 mm 32 dots →2.3.4 0.70 mm 5 dots →2.3.
Raster Command Reference Heat-Shrink Tube ID Tape Size Designation 1 2 3 4 5 6 415 HS 5.8 mm HS 5.8mm HS 0.23" 5.60 mm 40 dots →2.3.4 3.90 mm 28 dots →2.3.4 0.80 mm 6 dots →2.3.3 416 HS 8.8 mm HS 8.8mm 0.34” 8.70mm 62 dots →2.3.4 6.80 mm 48 dots →2.3.4 1.10 mm 8 dots →2.3.3 417 HS 11.7 mm HS 11.7mm 0.46” 11.6mm 82 dots →2.3.4 9.30 mm 66 dots →2.3.4 1.10 mm 8 dots →2.3.3 418 HS 17.7 mm HS 17.7mm 0.69” 17.8 mm 126 dots →2.3.4 14.9 mm 106 dots →2.3.4 1.
Raster Command Reference (b) Split size Number 1 Width 2 Length 3 Print area width (maximum printing width) 4 Print area length 5 Width offset 6 Length offset 7Overall width 8 Width of overall print area TZe tape ID Tape Size Designation 1 3 5 7 [3]×Split number+[5] ×2 8 [3]×Split number 279 12 mm 12 mm×2 0.47”×2 11.9 mm 84 dots 9.90 mm 70 dots 0.98 mm 7 dots 9.90mmx2+0.98mmx2 70dotsx2+7dotsx2 9.90mmx2 70dotsx2 285 12 mm 12 mm×3 0.47”×3 11.9 mm 84 dots 9.90 mm 70 dots 0.
Raster Command Reference 2.3.3 Feed amount The feed amount (left and right margins) is defined below. 180dpi×180dpi Type Minimum margin setting 2mm 0.08" 14 dots Normal Maximum margin setting 127 mm 5" 900 dots Minimum margin setting with no precut (Unrelated to driver) 24.3mm 0.96” 172dots 180dpi×360dpi Type Normal Minimum margin setting 2mm 0.08" 28 dots Maximum margin setting 127 mm 5" 1800 dots Minimum margin setting with no precut (Unrelated to driver) 24.3mm 0.96” 344dots - 17 2.
Raster Command Reference 2.3.4 Maximum and minimum lengths The maximum and minimum lengths are defined below. TZe tape 180dpi×180dpi Type Minimum length 4.4mm 0.18” 31 dots Normal Maximum length 1000 mm 39.37” 7086dots 180dpi×360dpi Type Minimum length 4.2mm 0.17” 60 dots Normal Maximum length 1000 mm 39.37” 14172dots Heat-Shrink Tube Type Normal Minimum length 4.4 mm 0.18” 31 dots Maximum length 500 mm 19.
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 settings” at the beginning and the end.
Raster Command Reference Total number of pins: 128pin 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 TZe tape: Tape Type Number of pins for left margin Number of print area pins Number of pins for right margin Number of bytes for raster graphics transfer 3.
Raster Command Reference Heat-Shrink Tube: Tape Type Number of pins for left margin Number of print area pins Number of pins for right margin Number of bytes for raster graphics transfer HS 5.8 mm 50 28 50 16 HS 8.8 mm 40 48 40 16 HS 11.7 mm 31 66 31 16 HS 17.7 mm 11 106 11 16 HS 23.6 mm 0 128 0 16 HS 5.2 mm 54 20 54 16 HS 9.0 mm 42 44 42 16 HS 11.2 mm 39 50 39 16 HS 21.0 mm 4 120 4 16 - 21 2.
Raster Command Reference 3. Print Command List ASCII Code Binary Code Description NULL 00 Invalidate ESC @ 1B 40 Initialize ESC iS 1B 69 53 Status information request *The PT-E550W/PT-P750W does not support this command.
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 @ ASCII: Initialize ESC Hexadecimal: 1B @ 40 Description ⚫ Initializes mode settings. ⚫ Also used to cancel printing.
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 Brother code Fixed at “B” (42h) 4 3 1 Series code Fixed at “0” (30h) 5 4 1 Model code PT-E550W: Fixed at “f” (66h) PT-P750W: Fixed at “h” (68h) 6 5 1 Country code Fixed at “0” (30h) 7 6 1 Reserved Fixed at “00h” 8 7 1 Reserved Fixed at 00h 9 8 1 Error information 1 Refer to table (1) below.
Raster Command Reference 32 31 1 Reserved Fixed at 00h - 25 4.
Raster Command Reference (1) Error information 1 Flag Mask Definition Bit 0 01h “No media” error Bit 1 02h (Not used) Bit 2 04h Cutter jam Bit 3 08h Weak batteries Bit 4 10h (Not used) Bit 5 20h Bit 6 40h Bit 7 80h (Not used) High-voltage adapter (Not used) (2) Error information 2 Flag Mask Definition Bit 0 01h “Replace media” error (with a serial connecting) Wrong media Bit 1 02h (Not used) Bit 2 04h (Not used) Bit 3 08h (Not used) Bit 4 10h “Cover open” error Bi
Raster Command Reference (3) Media width and length The media width and length is described in millimeters. 0~255 (0 to FFh) (a) TZe tape * Media Width: The tape width is indicated in millimeters. * Media Length: Fixed at 00h Media Media Width Media Length No tape 0 0 3.
Raster Command Reference (5) Status type Status Type Value Reply to status request 00h Printing completed 01h Error occurred 02h Exit IF mode 03h (not used) Turned off 04h Notification 05h Phase change 06h (Not used) 07h to 20h (Reserved) 21h to FFh If an error occurred during printing, the printer returns the error status. (6) Phase type and phase number If the phase number is not used, both are fixed at 00h.
Raster Command Reference (7) Notification number Notification Value Not available 00h Cover open 01h Cover closed 02h (8)Tape color information Tape color Tape color ID Notes White 01h Other 02h Clear 03h Red 04h Blue 05h Yellow 06h Green 07h Black 08h Clear(White text) 09h Matte White 20h Matte Clear 21h Matte Silver 22h Satin Gold 23h Satin Silver 24h Blue(D) 30h TZe-535(12mm) TZe-545(18mm) TZe-555(24mm) Red(D) 31h TZe-435(12mm) Fluorescent Orange 40h Fluore
Raster Command Reference Yellow(Flex. ID) 91h Clearning F0h Stencil F1h Incompatible FFh (9)Text color information Text color Text color ID White 01h Red 04h Blue 05h Black 08h Gold 0Ah Blue(F) 62h Cleaning F0h Stencil F1h Other 02h Incompatible FFh - 30 4.
Raster Command Reference ESC i a ASCII: Switch dynamic command mode ESC Hexadecimal: 1B i a {n1} 69 61 {n1} Parameters Definitions of {n1}: 0: ESC/P mode 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.
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 ESC i M Various mode settings ASCII: ESC Hexadecimal: 1B i M {n1} 69 4D {n1} Parameters Definitions of {n1} The meaning of each bit in a 1-byte parameter is described below. 0 ~ 5bit:Not used 6bit:Auto cut 1. Automatically cuts 0. Does not automatically cut 7bit:Mirror printing 1. Mirror printing 0.
Raster Command Reference ESC i d ASCII: Specify margin amount (feed amount) ESC Hexadecimal: 1B i d {n1} {n2} 69 64 {n1} {n2} Description ⚫ Specifies the amount of the margins. ⚫ Margin amount (dots)=n1+n2*256 (a) Continuous length tape Paper Tape Print area Margin amount ESC i A ASCII: Cut line Specify the page number in “cut each * labels” ESC Hexadecimal: 1B i A {n} 69 41 {n} Parameters Definitions of {n} Page number = n1 (1 - 99) Default is 1 (cut each label).
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 16 bytes of the total number of pins (128). 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 G Raster graphics transfer ASCII: G Hexadecimal: 47 {n1} {n2} {d1} ... {dk} {n1} {n2} {d1} ... {dk} Description ⚫ Transfers the specified number of bytes (k) of data. ⚫ The data is expanded by overwriting from the position where the margin was added. ⚫ If the expanded data does not reach the end of the expansion buffer, the remainder is filled with 0 data. ⚫ If the expanded data exceeds the end of the expansion buffer, the excess is cut off.
Raster Command Reference Control-Z ASCII: Print command with feeding Control-Z Hexadecimal: 1A Description ⚫ Used as a print command at the end of the last page. - 38 4.
Raster Command Reference 5. Flow Charts Normally, printing is performed as buffered printing. However, if the printer is connected via USB and uncompressed data is received, concurrent printing is performed. Note: Concurrent printing:Printing starts immediately after the printer receives print data. Buffered printing:Printing starts after one page of print data is received. - 39 5.
Raster Command Reference 5.1 Concurrent printing normal flow for USB connection Printer Computer (host) Invalidate If there are no problems with the printer status (media, etc.), the data is READ transmitted. If there is a problem, an error appears. The printer is reset. Initialize The printer is initialized. Status information request Status (response to status information request) Displaying sending The status of the printer (media, etc.) is checked and a response is sent. Data received.
Raster Command Reference 5.2 Concurrent printing 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, READ etc.), the data is transmitted. If there is a problem, an error appears. Displaying sending Printer Invalidate The printer is reset. Initialize The printer is initialized. Status information request Status (response to status information request) The status of the printer (media, etc.
Raster Command Reference 5.3 Concurrent printing error flow for USB connection (with a concurrent printing error such as end of tape) Computer (host) Invalidate If there are no problems with the printer status (media, etc.), the data is transmitted. If there is a problem, an error appears. Initialize Status information request READ Status (response to status information request) Displaying sending Printer Any jobs with errors remaining in the printer are cleared. The printer is initialized.
Raster Command Reference 5.4 Buffered printing normal flow for USB connection Computer (host) 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 Printer Invalidate The printer is reset. Initialize The printer is initialized. 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.
Raster Command Reference 5.5 Buffered printing error flow for USB connection Computer (host) Printer Invalidate 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 reset. The printer is Initialized. The status of the printer (media, etc.
Raster Command Reference 5.6 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 Printer 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.