Brother PT-P900, PT-P900W, PT-P950NW, PT-P910BT Software Developer's Manual Raster Command Reference

Software Developer's Manual
Raster Command Reference PT-P900/P900W/P950NW/P910BT
Version 1.01
The Brother logo is a registered trademark of Brother Industries, Ltd. Brother is a registered trademark of Brother Industries, Ltd. © 2020 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 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”). 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
- i -
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) ················································ 7
2.2.1 Preparation ....................................................................................................... 7
2.2.2 Checking the print data ................................................................ ...................... 7
2.2.3 Explanation of print data for the test page ........................................................ 10
2.3 Page data details ························································································· 12
2.3.1 Resolution ....................................................................................................... 12
2.3.2 Page size ........................................................................................................ 13
2.3.3 Feed amount ................................................................................................... 17
2.3.4 Maximum and minimum lengths ...................................................................... 18
2.3.5 Raster line ....................................................................................................... 19
3. Print Command List ·············································································· 22
4. Printing Command Details ····································································· 23
NULL Invalidate ................................................................................................ 23
ESC @ Initialize .................................................................................................. 23
ESC i S Status information request ...................................................................... 23
ESC i a Switch dynamic command mode ............................................................. 32
ESC i z Print information command ..................................................................... 33
ESC i M Various mode settings ............................................................................. 35
ESC i K Advanced mode settings ......................................................................... 36
ESC i d Specify margin amount (feed amount) ..................................................... 37
ESC i A Specify the page number in “cut each * labels” ........................................ 37
M Select compression mode ....................................................................... 38
G Raster graphics transfer .......................................................................... 40
Z Zero raster graphics ................................................................................ 40
FF Print command ....................................................................................... 40
Control-Z Print command with feeding .................................................................... 41
ESC i ! Specify automatic status notification mode .............................................. 41
5. Flow Charts ························································································· 42
5.1 Concurrent printing normal flow for USB connection ············································ 43
5.2 Concurrent printing error flow for USB connection (when feeding at the end of the page)44
5.3 Concurrent printing error flow for USB connection (with a concurrent printing error such
as end of tape) ·································································································· 45
5.4 Buffered printing normal flow for USB/Bluetooth connection ·································· 46
5.5 Buffered printing error flow for USB/Bluetooth connection ····································· 47
5.6 Normal Flow for Network (Standard TCP/IP port) Connection ································ 48
Appendix A: USB Specifications ································································ 49 Appendix B: Introducing the Brother Developer Center ································· 50
Raster Command Reference
- 1 ­Introduction
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. 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.
Raster Command Reference
- 2 -
About Raster Commands
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.
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 PT-XXXX printer (hereafter, referred to as “printer”). This manual describes the procedure for adding these codes and sending the data.
Raster Command Reference
- 3 -
1. Printing Using Raster Commands
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”.
(2) Send the status
(Confirm the printer status.)
(1) Open the port
(5) Send the status
(Confirm that printing is completed.)
(6) Close the port
Port
(4) Print
At your side
(3) Send the print data
Your printer
Computer, mobile terminal, etc.
Raster Command Reference
- 4 -
1. Printing Using Raster Commands
(1) Open the USB/network/Bluetooth port
Open the USB/network/Bluetooth port in the operating environment. The procedure for opening the USB/network/Bluetooth 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/network/Bluetooth port
After all printing is finished, close the USB/network/Bluetooth port.
Note:
In order to print at high speed when a USB port is used to send uncompressed raster data, the
Brother PT-XXXX 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”.
Raster Command Reference
- 5 -
2. Print Data
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.
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 the printer to raster mode. 1Bh, 69h, 61h, 01h
2
Specify automatic status notification
mode (PT-P910BT only)
Dynamically switches whether an automatic status notification is
given during printing. 1Bh, 69h, 21h, 00h
3
Print information
command
Sets the print information for the printer.
When printing 100 mm on 24-mm-wide tape with the 180 dpi
model: 1Bh, 69h, 7Ah, 84h, 00h, 18h, 00h, 9Ch, 02h, 00h, 00h, 00h, 00h
4
Various mode
settings
When auto cut is enabled: 1Bh, 69h, 4Dh, 40h
5
Specify the page number in “cut
each * labels”
When an auto cut setting is effective, specify the number of
sheets for auto cut. For auto cut every single sheet, 1Bh, 69h, 41h, 01h
6
Advanced mode
settings
When half cut is enabled, and chain printing is disabled: 1Bh, 69h, 4Bh, 0Ch
7
Specify margin
amount
Specifies the amount of the margins. For 1 mm margins on the 360 dpi model: 1Bh, 69h, 64h, 0Eh, 00h
8
Select compression
mode
Selects the compression mode for raster graphics. To send the data compressed to TIFF format: 4Dh, 02h
Raster Command Reference
- 6 -
2. Print Data
(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.
Sequence
Command Name
Description/Example
-
Print command
Specifies at the end of a page that is not the last page. 0ChFixed
-
Print command with
feeding
Specifies at the end of the last page. 1Ah (Fixed)
Raster Command Reference
- 7 -
2. Print Data
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.
Furthermore, this procedure is for the Windows® 10 operating environment. A similar procedure can be
performed if you are using a different operating system.
Print Properties
2.2.1 Preparation
Install the two listed below.
Printer driver of the Brother PT-XXXX 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.
Raster Command Reference
- 8 -
2. Print Data
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.
Print the test page with “36mm” selected as the paper size in the print settings.
Raster Command Reference
- 9 -
2. Print Data
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.
Save Print Output As
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”.
Print data
Raster Command Reference
- 10 -
2. Print Data
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
Raster Command Reference
- 11 -
2. Print Data
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 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.
4
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.
5
Print information
command
Media size information for the print data is sent. This is the command for “36 mm” tape.
6
Various mode settings
(1Bh+69h+4Dh+40h)
This is a command for specifying a mode. Here, automatically cutting is specified.
7
Specify the page number in “cut each *
labels”
The number of pages printed before automatically cutting is
specified.
8
Advanced mode
settings
This is the command for specifying settings for the advanced
mode.
In this case, “no chain printing” is enabled, and “half cut” is
enabled.
9
Specify number of
copies
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.
10
Specify margin amount
Specifies the amount of the margins. This is the command for “14 dots”.
11
Select compression
mode
TIFF compression mode is selected.
12
Raster data
Raster data continues.
13
Print command with
feeding
Since it is the last page, the print command with feeding is sent
at the end of the page.
Raster Command Reference
- 12 -
2. Print Data
2.3 Page data details
2.3.1 Resolution
PT-P900/P900W/P950NW
Resolution
Height-to-Width Proportion
360 dpi high, 360 dpi wide
1:1
360 dpi high, 720 dpi wide
1:2
PT-P910BT
Resolution
Height-to-Width Proportion
360 dpi high, 360 dpi wide
1:1
Raster Command Reference
- 13 -
2. Print Data
2.3.2 Page size
(a) Continuous length tape
Feeding direction
6
5
Landscape
3
1 4 2
Print area
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.38 mm 48 dots
2.3.4
3.38 mm 48 dots
2.3.4
0.00 mm 0 dots
2.3.3
257
6 mm
6 mm
0.23"
6.00 mm 84 dots
2.3.4
4.52 mm 64 dots
2.3.4
0.74 mm 10 dots
2.3.3
258
9 mm
9 mm
0.35”
9.00mm 128 dots
2.3.4
7.48 mm 106 dots
2.3.4
0.76 mm 11 dots
2.3.3
259
12 mm
12 mm
0.47”
12.0 mm 170 dots
2.3.4
10.58 mm 150 dots
2.3.4
0.71 mm 10 dots
2.3.3
260
18 mm
18 mm
0.70”
18.01 mm 256 dots
2.3.4
16.51 mm 234 dots
2.3.4
0.75 mm 11 dots
2.3.3
261
24 mm
24 mm
0.94”
24.00 mm 340 dots
2.3.4
22.58 mm 320 dots
2.3.4
0.71 mm 10 dots
2.3.3
262
36 mm
36 mm
1.4”
36.09 mm 512 dots
2.3.4
32.03 mm 454 dots
2.3.4
2.03 mm 29 dots
2.3.3
Loading...
+ 38 hidden pages