If printing does not begin (main most frequent cause) ................................................... 130
If a template linked to a database is not printed ............................................................. 130
Appendix E: Introducing the Brother Developer Center······························131
- iii -
P-touch Template 2.0 Command Reference
Introduction
This material provides the necessary information for directly controlling the templates transferred to your
printer.
This information is provided assuming that the user has full understanding of the operating system being used
and basic mastery of programming in a developer's environment.
Read the model names that appear in the screens in this manual as the name of your printer.
We accept no responsibility for any problems caused by programs that you develop using the information
provided in this material, affecting software, data or hardware, including the your printer, and any problems
resulting directly or indirectly from them. Use this material only if you accept these terms.
This material shall not be reproduced, in part or in full, without prior approval. In addition, this material shall
not be used as evidence in a lawsuit or dispute in a way that is unfavorable towards our company.
- 1 -
Introduction
P-touch Template 2.0 Command Reference
3. Transfer the data (text) from
the host, and then print the
template.
1. Set up the printer from
the PC according to the
configuration of the host.
2. Design the template
with P-touch Editor, then
transfer it to printer.
What is P-touch Template 2.0?
P-touch Template 2.0 helps the user develop a printing system that connects directly from the host and has
following functions:
Transfers the template data from P-touch Editor to the printer (2)
Transfers the ASCII text and binary data from a host to the template in the printer (3)
(“Host” includes medias such as barcode readers, smartphones or mobile terminals.)
Prints the transferred data (3)
(See the figure shown below.)
P-touch Template 2.0 commands consist of a prefix character and a two-character text string.
When the prefix character is sent, the printer begins the analysis of the P-touch Template 2.0 command, and
performs the specified process if the following two-character text string corresponds to a command.
There are two types of command, “static command” and “dynamic command”. Items set with the dynamic
command are retained until the printer is turned off. On the other hand, the items set with the static command
are stored in the non-volatile ROM in the printer.
Note
*P-touch Template 2.0 is not compatible with some hosts.
*These hosts should have an interface to transfer the data.
*ZP L II emulation is supported by P-touch Template 2.0.
What is P-touch Template 2.0?
- 2 -
touch Template Settings tool, specify the initial
touch Template Settings Tool User’s
The printer driver must first be installed via a USB
Editor, design the template to be transferred
If any special commands are required to control the printer,
change the terminal program in accordance with the
1. Using P-touch Template 2.0
P-touch Template 2.0 Command Reference
(1) Specify the printer settings.
Using the Pprinter settings according to the host system environment or
the host that the printer is connected to.
(Please refer to “2. P-
Guide”.)
connection.
(2) Design the template.
Using P-touch
to the printer.
(Please refer to “4. P-touch Template 2.0 Limitations”.)
(3) Transfer the templates.
Using P-touch Transfer Manager, transfer the templates to
the printer.
(4) Program using P-touch Template 2.0 commands.
P-touch Template 2.0 commands.
(Please refer to “6. Control Code Lists”.)
(5) Connect the printer with the host and print slips etc.
Transfer the data such as ASCII text from the host to
templates in the printer, and print the slips etc.
1. Using P-touch Template 2.0
- 3 -
(5) Print start command text
string setting
(1) Command mode setting
(2) Template number setting
(3) Delimiter setting
(4) Print start trigger setting
(6) Print start data amount setting
(7) Character code set setting
(8) International character set setting
(9) Prefix c
haracter setting
(10) Non-printed character setting
Applies settings for (1)
through (18) to the printer.
Returns (1) through (18) to their default settings.
Closes the tool.
(11
) Line
feed character setting
(13) Number of copies setting
(12) FNC1 replacement setting
(17) Rotate setting
(14) Cut at End setting
(15) Cut number setting
(16) Auto cut setting
(18) Serial communication setting
2. P-touch Template Settings Tool User’s Guide
P-touch Template 2.0 Command Reference
*Available items depend on the printer models.
2. P-touch Template Settings Tool User’s Guide
- 4 -
P-touch Template 2.0 Command Reference
(1) Command mode setting
- P-touch Template mode
To use P-touch Template 2.0, select the P-touch Template mode.
(2) Template number setting
Specify the template number selected as the default when the printer is turned on.
However, if any template has been set to not be transferred to the printer, the number of that template
cannot be specified.
(3) Delimiter setting
A delimiter is the symbol used to indicate when to move to the next object in the data that is being sent.
Between 1 and 20 characters can be specified.
(4) Print start trigger setting
Select one of the following three options for the print start trigger.
- Command Character
(Printing starts when the command character specified in (5) is received.)
- Data Insertion into All the Objects
(Printing starts when the delimiter for the last object is received.)
- Received Data Size
(Printing starts when the number of characters specified in (6) is received. However, delimiters are not
counted in the number of characters.)
(5) Print start command text string setting
Specify 1 to 20 characters.
(6) Print start data amount setting
The amount of data that must be received before printing can begin can be set between 1 and 999.
(7) Character code set setting
Select one of the following code sets. For character code tables, refer to “Appendix C: Character Code
Tables”.
- Windows1252
- Windows1250
- Brother standard
- Unicode (UTF-8)
- 5 -
2. P-touch Template Settings Tool User’s Guide
(8) International character set setting
Select one of the following countries for the character set.
- USA
- France
- Germany
- Britain
- Denmark I
- Sweden
- Italy
- Spain I
- Japan
- Norway
- Denmark II
- Spain II
P-touch Template 2.0 Command Reference
- Latin America
- South Korea
- Legal
The following 12 codes are switched depending on the country selected from those listed above.
23h 24h 40h 5Bh 5Ch 5Dh 5Eh 60h 7Bh 7Ch 7Dh 7Eh
For the characters that are switched, refer to the “International character set table” in “Appendix C:
Character Code Tables”.
(9) Prefix character setting
Change the prefix character code. Specify as a one-character character code.
The prefix character is the code for the first character that identifies commands that can be used in
P-touch Template mode.
(10) Non-printed character setting
The characters specified here are not printed when data is received. Specify 1 to 20 characters.
(11) Line feed character setting
The line feed code is used when feeding data to indicate that the following data should be moved to the
next line in a text object. One of the following four line feed codes can be selected, or 1 to 20 characters
can be specified as the line feed code.
1. ^CR
2. \0D\0A
3. \0A
4. \0D
- 6 -
2. P-touch Template Settings Tool User’s Guide
P-touch Template 2.0 Command Reference
(12) FNC1 replacement setting
This setting selects if GS codes, which are included in barcode protocols such as GS1-128
(UCC/EAN-128), are replaced with FNC1 codes.
If the check box is selected, a received GS code is replaced with the FNC1 code. If the check box is
cleared, a received GS code is outputted as is.
(13) Number of copies setting
Specify the number of copies. A number between 1 and 99 can be specified.
(14) Cut at End setting
If this setting is selected, the cut operation will be performed when printing is finished.
*This command is available only for printers with auto cutter.
(15) Cut number setting
A number between 1 and 99 can be specified.
*This command is available only for printers with auto cutter.
(16) Auto cut setting
If auto cutting is selected, the cut operation will be performed after the number of labels specified in
(16).
*This command is available only for printers with auto cutter.
(17) Rotate setting
Set print orientation. When the check box is checked, a print is 180 degrees rotated.
- 7 -
2. P-touch Template Settings Tool User’s Guide
Baud rate
Please refer to “Appendix B: Specifications”
Bit length (bit)
8 bit, 7 bit
Parity
None, Odd, Even
Busy control
DTR, XON/XOFF
Applies the four settings
to the printer.
Returns the four parameters
to their default settings.
Closes the Communication
Settings dialog box.
(18) Serial communication settings
P-touch Template 2.0 Command Reference
2. P-touch Template Settings Tool User’s Guide
- 8 -
P-touch Template 2.0 Command Reference
PRINT
PRINT
Tab control code
\09
Line feed control code
\0D \ \\
Others
· ini file
After the [Set] button (in the main dialog box or the Communication Settings dialog box) is clicked, the
settings are saved when the dialog box is closed.
C:\Users\(user_account_name)\App Data\Roaming\Brother\Printer Settings\PtsXXXX.ini
Note: A name of file “PtsXXXX.ini” varies depending on printers like below.
Model File name
RJ-4230B Pts4337.ini
RJ-4250WB Pts4437.ini
TD-4410D Pts3735.ini
TD-4420DN Pts3835.ini
TD-4510D Pts3935.ini
TD-4520DN Pts4135.ini
TD-4550DNWB Pts4235.ini
Note: A file path above might be different depending on OS.
· Typing text into text boxes (3), (5), (9), (10) and (11)
Characters that can be entered as text can be typed in, and control codes can be entered as ASCII
codes (00 to FF) with \ in front of them.
Example
2. P-touch Template Settings Tool User’s Guide
- 9 -
3. Examples for Using Commands
In this chapter, the following settings are described as defaults.
P-touch Template 2.0 Command Reference
3.1 Example for using P-touch Template 2.0
Target label is following.
- 10 -
3. Examples for Using Commands
Steps
1. Make a template with P-touch Editor.
2. Transfer the template to Transfer Manager.
3. Transfer the template from Transfer Manager to the printer.
4. Use P-touch Template 2.0 commands for printing.
Step 1: Make a template with P-touch Editor.
Start the P-touch Editor and make a label.
In this example, P-touch Editor operates in Professional mode.
P-touch Template 2.0 Command Reference
Step 2: Transfer the template to Transfer Manager.
Text1, Text2, … are added in the
order in which the objects were
created.
- 11 -
3. Examples for Using Commands
P-touch Template 2.0 Command Reference
Stored
template
Assigned number
Click [Transfer] button.
The template sent in step 2 is stored in Transfer Manager, as shown below.
In this example, it is assumed that another template has already been transferred with key assignment
number 1, and the key assignment number is 2.
Step 3: Transfer the template from Transfer Manager to the printer.
Note
Make sure that the printer is turned on and hooked up to the PC with a USB cable before using
Transfer Manager. Also, make sure that the printer communication setting is always bi-directional
communication when Transfer Manager is used.
When the template is transferred to the printer, the following message appears.
3. Examples for Using Commands
- 12 -
P-touch Template 2.0 Command Reference
^II
Entered command
^TS002
Entered command
Brother
0x09
At your side
Entered command
^FF
Entered command
Step 4: Use P-touch Template 2.0 commands for printing.
(1) Initialize P-touch Template 2.0
Send "Initialize" command to restore the default settings.
(2) Select template number
Select target template number using “Select template” command. In this example, please select
number 2 selected in Step2.
(3) Creating text data to insert
Insert text data to print.
Order of the data is followings.
1. Data for the first object (ex: “Brother”)
2. Delimiter (09h)
3. Data for the second object (ex: “At your side”)
3. Examples for Using Commands
(4) Print Start
- 13 -
When the printer receives the command above, the label below is printed.
P-touch Template 2.0 Command Reference
- 14 -
3. Examples for Using Commands
609 dots (3 inches)
406 dots (2 inches)
80 dots
290 dots
Example:
A case 203dpi printer is used
Font is outline font, and size is
50, 50 dots.
Select P-touch Template mode.
3.2 Example for using ZPL II in P-touch Template 2.0
Here is the label that will be made.
P-touch Template 2.0 Command Reference
Steps
1. Change the mode to P-touch Template mode.
2. Set the label length with ^LL.
3. Set the label width with ^PW.
4. Send other ZPL II command.
Step 1: Change the mode to P-touch Template mode.
P-touch Template mode can be selected by using the P-touch Template Settings tool shown below.
3. Examples for Using Commands
- 15 -
^LL609
Entered command
^PW406
Entered command
^FO80,290
^A0N,50,50
^FDAt your side
Entered command
Step 2: Set the label length with ^LL.
The label length is 609 dots.
Step 3: Set the label width with ^PW.
The label width is 406 dots.
Step 4: Send other ZPL II commands.
The orientation of the text is 80, 290.
The font is outline font and size is 50, 50.
P-touch Template 2.0 Command Reference
The text is “At your side.”
Summar y -all commands to be sent to make the label-
^XA
^LL609
^PW406
^FO80,290
^A0N,50,50
^FDAt your side
^XZ
3. Examples for Using Commands
Note
“^XZ” is the command required at the end of format with ZPL II commands.
- 16 -
With those commands above, the label below is printed.
P-touch Template 2.0 Command Reference
- 17 -
3. Examples for Using Commands
P-touch Template 2.0 Command Reference
Stored template
Assigned number
Click[Transfer] button.
3.3 Example for printing logo/external characters in P-touch Template 2.0
Here is the label to be printed.
Steps
1. Make a template and transfer it to the printer.
2. Store the logo/external characters as a bitmap file.
3. Transfer the bitmap file from Transfer Manager to the printer.
4. Use P-touch Template commands for printing.
Step 1: Make a template and transfer it to the printer.
3. Examples for Using Commands
- 18 -
P-touch Template 2.0 Command Reference
Example file name is “_ext_logo.bmp”
Assigned number
Click[Transfer] button.
^II
Entered command
In order to select the bitmap file, enter a specific character
and the value one less than the assigned number for the
enter \01 as shown right.
\01
Entered command
Step 2: Store the loge/external characters as a bitmap file. The file name should be started from
“_ext_”,, and drag & drop it to Transfer Manager.
Step 3: Transfer the bitmap file from Transfer Manager to the printer.
Step 4: Use P-touch Template commands for printing.
(1) Initialize P-touch Template
(2) Select the bitmap file to be printed.
“\”
bitmap file that is shown in Step 3.
For example, if the assigned number for the bitmap file is 2,
3. Examples for Using Commands
- 19 -
^FF
Entered command
(3) Start printing.
When the printer receives the command above, the label below is printed.
P-touch Template 2.0 Command Reference
3. Examples for Using Commands
- 20 -
P-touch Template 2.0 Command Reference
4. P-touch Template 2.0 Limitations
4.1 Relating to text objects
4.1.1 Font, size, etc.
Please also refer to “5.3 Relationship between the P-touch Editor settings and the printer image” on page 31 When a template is transferred to a printer, a font specified in P-touch Editor is changed to most similar
resident font in the printer.
Character sizes specified in P-touch Editor are converted to the closest built-in character size when the
data is sent to the printer.
Character sizes specified in P-touch Editor are all made the same size within an object.
Depending on the language of the computer used for transferring, either the Western European or the
Eastern European character set is used for characters within text objects.
“\” is used as control character for an external character. When “\” has to be used as a data, input “\\”.
When “At Printing” check box is NOT checked, the time and date when editing P-touch Editor is applied
and printed. When “At Printing” check box is checked, time and date is not printed.
“At Printing” setting
To cancel the “At Printing” setting for a date/time in P-touch Editor, display the properties for the Date and
Time object, and then clear the “At Printing” check box.
- 21 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
4.1.2 Character alignment
Horizontal alignment settings (“Justify” or “Equal Length”) specified in P-touch Editor are changed to the
left alignment setting.
The setting for line feed with a line feed specified with the P-touch Editor can be set between 0 and 255
dots.
A negative line spacing setting cannot be used in P-touch Editor. In addition, since there is an upper limit
for the line width with the printer, a line spacing setting larger than this limit specified in P-touch Editor will
not be applied on the printer.
Specifying the line spacing setting in P-touch Editor
- 22 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
The text object size is fixed, and the text size is changed depending on the text
length.
The text object size is fixed, and the text size is fixed. If the text is too long, the text
is not printed.
The text object width is fixed, and the text size is fixed. If the text is too long, the text
object height is increased.
Automatic
Length
The text object height is fixed, and the text size is fixed. If the text is too long, the
text object width is increased.
The text size is fixed. If the text is too long, the text object width is increased. If a
new line is started, the text height is increased.
4.1.3 Text Layout settings
Character styles specified in P-touch Editor all become the same style within an object.
If the “Long text” is selected under “Text Layout” in P-touch Editor, the text is always aligned at top left.
If the “Long Text” setting is selected under “Text Layout” in P-touch Editor and continuous length tape is
used, the print length is increased to fit the text.
If the “Fixed Frame Size (Wrap)” setting is selected under “Text Layout” in P-touch Editor, the object size
does not change, and the text size is reduced.
“Fixed Frame Size (Wrap)” is a setting that was added for inserting long text. Since it is possible that the
text size may become extremely small if the wrapping feature is no longer applied, we recommend that
“Fixed Frame Size” be selected when die-cut labels or a fixed length is specified in P-touch Editor, or that
“Automatic Length” be selected when an automatic media length is specified.
Shrink to Fit
Clip Text
Long Text
Free Size
Specifying a Text Layout setting
Click the button circled in red to display a drop-down list, and then select the desired option.
- 23 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
Decoration tag*
Start tag
End tag
Bold
<b>
</b>
Underline
<u>
</u>
It is possible to decorate specific text by surrounding text data with decoration tags.
The specification of the tag is as follows.
Type
*These are default values.
*Not supported by RJ-4XXX series.
Ex) When the text ”AAA<b>BBB</b><u>CCC</u>” is inserted to a text object:
Output: AAABBBCCC
Decoration tags are required for each line. If a line break occurs inside the decorative tag, the text after the
line feed is not decorated.
Decoration tag is available only for text object.
Numbering field is not supported for decoration.
PDF417, QR Code, Data Matrix, MaxiCode, Aztec, GS1 Databar Composite
4.2 Relating to barcodes
4.2.1 Barcodes
When trying to transfer a template containing a barcode that is not compatible with the printer, an error will
occur while transferring and the template cannot be transferred to the printer.
The following barcodes are compatible with the printer.
1D barcodes
*Please refer to Appendix B:Specifications for each model support information.
If data containing characters incompatible with the protocol are fed into the barcode object, that barcode
object is not printed.
The barcode size may differ from that in the print result with P-touch Editor.
Since CODE128 and GS1-128(UCC/EAN-128) can easily be printed slightly larger, we recommend
leaving larger margins when creating templates in P-touch Editor.
If data fed into a barcode in a template created with P-touch Editor causes an extremely long barcode, the
barcode may not be fully printed.
Do not insert line feed immediately before or immediately after the barcode data. Otherwise, it will be
considered as part of the barcode data. In that case, the barcode will be created containing the line feed
code, or the barcode will not be printed since data incompatible with the barcode protocol is entered.
A delimiter or print start text string should be entered immediately after the barcode data.
- 25 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
1 to 50 characters (not including “*” on both sides)
skipped.
ITF
I-2/5
1 to 64 characters
The bearer bar setting specified in P-touch Editor is invalid.
EAN-8
7 characters
EAN-13
12 characters
UPC-A
11 characters
UPC-E
6 characters
CODABAR
3 to 64 characters (with “A”, “B”, “C” or “D” at the beginning and end)
A barcode wider than 22.5 cm will not be printed.
A 1D barcode taller than 1164 dots is converted to 1164dots.
The number of characters that can be entered for each protocol is shown below.
CODE39
When feeding data, the asterisks (*) at the beginning and end of the data are
1 to 64 characters
3 to 15 characters (begins with “01”)
3 to 15 characters (begins with “01”; third digit is “0” or “1”)
1 to 64 numbers or 1 to 40 letters*
* ISO646 characters can be printed.
<<numbers, letters, spaces, !, ”, %, &, ’, (, ), *, +, ,, -, ., /, :, ;, <, =, >, ? and _>>
When trying to transfer data exceeding the ranges described above, an error will occur while
transferring. If the data that is fed does not meet the minimum limit, the barcode is not printed. If the
data exceeds the maximum limit, only the data to the maximum limit is applied.
- 26 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
The version setting for a QR Code specified in P-touch Editor is invalid. The
The Structured Append settings specified in P-touch Editor are invalid.
Since the error correction levels for PDF417 specified in P-touch Editor are
The Structured Append settings specified in P-touch Editor are invalid.
The Structured Append settings specified in P-touch Editor are invalid.
Macro settings specified in P-touch Editor are invalid
The Structured Append settings specified in P-touch Editor are invalid.
P-touch Editor: “200”; Printer: “002”
The Remove Character setting specified in P-touch Editor is invalid.
specified in P-touch Editor are invalid.
Following models are supported.
Please insert “0112345|67890”.
4.2.3 2D barcodes
Margin setting in the P-touch Editor is ignored. It is only changed by Barcode margin setting command
(ESC iXE2).
Other limitations are as follows.
QR Code
PDF417
Data Matrix
Maxi Code
Aztec
GS1 Databar
Composite
version setting must be turned off.
inconsistent with those on the printer, the size of the barcode may change when
it is printed with P-touch Template 2.0.
The barcode is partitioned when too much data is entered.
When specifying the country code and service class with P-touch Editor, the
number is entered at the beginning if the maximum number of characters is not
reached. However, with the printer, the number is entered at the end.
Example: “2” is specified.
The Code Spacing and Join Vertically in the Set Structured Append settings
- GS1 Databar Omni CC-A/CC-B
- GS1 Databar Truncated CC-A/CC-B
- GS1 Databar Stacked CC-A/CC-B
- GS1 Databar Stacked Omni CC-A/CC-B
- GS1 Databar Limited CC-A/CC-B
- GS1 Databar Expanded CC-A/CC-B
- GS1 Databar Expanded Stacked CC-A/CC-B
When inserting data, please add the data “01” to the beginning of data. The
setting “Add 01 on the head of data” of the P-touch Editor is not affected.
In addition, 1D barcode data and 2D code data must be separated by ‘|’.
Ex) 1D barcode data is “12345”, 2D code data is ”67890”:
4. P-touch Template 2.0 Limitations
- 27 -
P-touch Template 2.0 Command Reference
4.3 Relating to images
If a template containing overlapping images is transferred with P-touch Editor, all image data will be
overlapping. (P-touch Editor displays the image created last on top.)
4.4 Relating to Numbering
A single object contains a single Numbering field.
A Numbering field can contain a maximum of 15 digits.
Only Numbering fields will be saved in Numbering objects when printing is finished.
If the number of characters that was fed in is less than the number of characters in the Numbering object, it
may not be printed correctly.
If a line feed exists in the numbering area, characters after line feed are deleted.
Note
Numbering objects refer to text objects or barcode objects that have the Numbering function
applied.
4.5 Relating to Database
When a database is transferred, it is named using the file name + sheet name (when created in Excel).
The file name can contain up to 15 bytes of characters (15 one-byte characters or 7 two-byte characters).
A maximum of 255 databases can be transferred. However, the transfer cannot be completed if the
amount of data being transferred exceeds 40MB.
If there is a line feed in a cell containing text to be replaced, only the string of characters before the line
feed will be replaced.
The text to be replaced can contain up to 256 characters.
A database can contain a maximum of 65,000 rows.
The maximum number of database line is 65000 lines included the title. If the database is over 65000 lines,
the only lines over 65000 are deleted.
A database can contain a maximum of 100 columns. If a database containing more than 100 columns is
transferred, all data after the 100th column will be deleted.
If there is no database linked to the template being printed, or if the corresponding string of characters to
be replaced cannot be found, an error occurs.
If columns linked to the template being printed are not in the database, the objects related to those
columns remain as they were when the template was transferred.
Depending on the language of the computer used for transferring, either the Western European or the
Eastern European character set is used for characters within databases.
- 28 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
4.6 Others
4.6.1 Transferring templates
A maximum of 255 templates can be transferred. The transfer cannot be completed if the amount of data
being transferred exceeds 40 MB.
A single template can contain a maximum of 255 objects.
When print data is fed, the command mode should be the P-touch Template mode.
When a template is transferred to the printer, all values specified with dynamic commands are initialized.
This is not compatible with split labels.
After printing from P-touch Editor, the command mode changes to initial value. In order to print a template,
select the P-touch Template mode in the P-touch Template Settings tool or, if the previous mode in the
P-touch Template Settings tool was the P-touch Template mode, turn the printer off, then on again to enter
P-touch Template mode.
4.6.2 About objects in a template
The line feed codes (0D0A, 0D and 0A) in print data are read, then discarded. However, when specified as
special data, such as delimiters, print start text strings or line feed commands, they are applied.
The order of the objects is determined only by the last four-digit number of the object name. Objects with
no numbers in their names will be at the end of the order. If objects have the same number, the order is
determined in the following order: text, 1D barcodes, then 2D barcodes. If the objects are of the same type,
the object created first is first in the order. We recommend that the numbers indicating the order be added
at the end of the object name.
(To specify the name of an object in P-touch Editor, display the properties of the text or barcode object, and
then specify the name in the “Object Name” box on the Expanded tab.)
Specifying the object name
- 29 -
4. P-touch Template 2.0 Limitations
P-touch Template 2.0 Command Reference
5. Precautions
5.1 Notes on using static commands
Some static commands are only executed in raster mode. When using these static commands, change the
command mode to raster mode before sending the command.
(1) Switch to raster mode.
ESC i a 01h (1Bh 69h 61h 01h)
(2) Send static commands.
(3) Switch to P-touch Template mode.
ESC i a 03h (1Bh 69h 61h 03h)
*Please refer to 6.3 Raster commands.
5.2 Notes for printers with Bluetooth interface
If the printer is connected using Bluetooth, the printer may not be ready immediately after the port is opened.
When sending print data, wait at least 500 msec after the port has been opened before starting to send the
data.
In addition, if the port is continuously opened and closed, for example, when printing multiple pages, wait at
least 500 msec after the port is closed before opening the port the next time.
Once the print data for one page has been sent, do not close the Bluetooth port until printing is finished.
- 30 -
5. Precautions
P-touch Template 2.0 Command Reference
(Text Layout settings)
Printer image
Layout
Options
Text
text is not printed.
text is not printed.
Shr i nk to Fit
Clip Text
Selected
Fit
(Wrap)
line.
outside the frame.
outside the frame.
outside the frame.
below.)
5.3 Relationship between the P-touch Editor settings and the printer image
P-touch Editor setting
Text options
Width Height
Text
Details-
Wrap
Frame Siz e Text Size Frame Size Text Size
Printed
image
Clip Text
Fixed
Frame Size
Shr i nk to
Fixed
Frame Size
Long Text -
Automatic
Length
Selected
-
-
Fixed
If the text is too
long, the overflow
Fixed
If the text is too
long, eve n w ith
the minimum text
size, the overflow
text is printed
outside the frame.
Fixed
The overflow text
is automatically
sent to the new
Even the overflow
text is printed
outside the frame.
Fixed
Auto
The text is
automatically
maximized t o
fit the frame
size.
Fixed
Fixed
Fixed
If the text is too
long, the overflow
Fixed
If the text is too
long, eve n w ith
the minimum text
size, the overflow
text is printed
outside the frame.
Even the overflow
text is printed
outside the frame.
Fixed
If the text is too
long, eve n w ith
the minimum text
size, the overflow
text is printed
Fixed
Auto
The text is
automatically
maximized t o
fit the frame
size.
Fixed
Auto
The text is
automatically
maximized t o
fit the frame
size.
1
(See
below.)
2
(See
below.)
3
(See
below.)
4
(See
below.)
Free Size -
Even the overflow
text is printed
Fixed
Even the overflow
text is printed
Fixed
5
(See
Printed image
1
2
3
4
5
- 31 -
5. Precautions
P-touch Template 2.0 Command Reference
5.4 Making a template in order to save time before starting to print
Perform the following operation to convert permanent objects into images.
- In the Text Properties dialog box, select the Expanded tab, and then select the “Text Cannot Be Edited”
check box.
- If the Expanded tab of the Text Properties dialog box is not displayed, click [Options] on the Tools menu,
and then select the “Display Expanded Tabs of Object Properties” check box on the General tab.
Specify the text options (Text Layout settings) so that the text size is fixed.
- 32 -
5. Precautions
string
character count
feed
Specify line feed command text
string
Numbering copies
6. Control Code Lists
6.1 Setting and retrieving commands for P-touch Template mode
P-touch Template 2.0 Command Reference
Commands Description
^PT
^FF
^PS
^PC
^SS
^TS
^CO
^LS
^CC
^RC
^CN
^NN
Select print start trigger
Start printing
Specify print start command text
Specify print start received
Specify delimiter
Select template
Select cut options
Specify line spacing with line
Change the prefix character
Specify number of copies
Specify number of
Series
RJ-4XXX TD-4XXX
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
^ID
^QS
^QV
^FC
^II
^OP
^SR
^VR
^CR
^OS
^ON
^DI
ESC ia
Initialize template data
Select print options
Specify QR Code version
FNC1 replacement setting
Initialize
Perform printer operation (feed)
Status request
Retrieve version information
Line feed in object
Select object(object number)
Select object(object name)
Directly insert object
Select command mode
○○
- ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
Note
* The commands listed above must be used in P-touch Template mode.
* These commands (except ESC i a) cannot be used in raster mode or ESC/P mode.
6. Control Code Lists
- 33 -
string
character count
text string
(specifying number of labels)
Select international character set
Specify line feed command text
string
Numbering copies
Retrieve print start command
setting text string
character count
6.2 Common commands
P-touch Template 2.0 Command Reference
Commands Description
ESC iXT2
ESC iXP2
ESC iXr2
ESC iXD2
ESC iXa2
ESC iXi2
ESC iXn2
ESC iXf2
ESC iXc2
ESC iXy2
ESC iXm2
ESC iXj2
ESC iXR2
Select print start trigger
Specify print start command text
Specify print start received
Specify delimiter
Specify non-printed
Select command mode
Select template
Change prefix character
Select cut options
Select cut options
Select character code set
Series
RJ-4XXX TD-4XXX
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
ESC iXC2
ESC iXN2
ESC iXF2
ESC iXd2
ESC
iXv2(0Ch)
ESC iXE2
ESC iXh2
ESC iX^2
ESC
iXv2(08h)
ESC iXT1
ESC iXP1
ESC iXr1
Specify number of copies
Specify number of
FNC1 replacement setting
Specify recovery setting
Specify number of recovery
Specify barcode margin setting
Specify rotated print
Specify print stop position
Specify WLAN communication
mode of Raw port
Retrieve print start trigger setting
Retrieve print start received
○ ○
○ ○
○ ○
○ ○
○ ○
- ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
6. Control Code Lists
- 34 -
Setting
character set setting
(specifying number of labels)
Retrieve character code set
setting
character set setting
Setting
Numbering copies setting
Setting
(Continued from the previous page)
P-touch Template 2.0 Command Reference
Command Description
ESC iXD1
ESC iXa1
ESC iXi1
ESC iXn1
ESC iXc1
ESC iXy1
ESC iXm1
ESC iXj1
ESC iXf1
ESC iXC1
ESC iXN1
Retrieve delimiter
Retrieve character code set
Retrieve international
Retrieve prefix character
Retrieve cut options
Retrieve cut options
Retrieve international
Retrieve prefix character
Retrieve number of copies
Retrieve number of
Series
RJ-4XXX TD-4XXX
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
○ ○
ESC iXF1
ESC iXd1
ESC
iXv1(0Ch)
ESC iXE1
ESC iXh1
ESC iX^1
ESC
iXv1(08h)
Retrieve FNC1 replacement
Retrieve recovery setting
Retrieve number of recovery
Retrieve barcode margin setting
Retrieve rotated print setting
Retrieve print stop position
Retrieve WLAN communication
mode of Raw Port
○ ○
○ ○
○ ○
- ○
○ ○
○ ○
○ ○
6. Control Code Lists
- 35 -
6.3 Raster commands
P-touch Template 2.0 Command Reference
Commands Description
ESC iOUe1
ESC iOUe0
Specify decoration tag string
Retrieve decoration tag string
Note
* These commands are only available in raster mode.
Series
RJ-4XXX TD-4XXX
- ○
- ○
- 36 -
6. Control Code Lists
n=1:
When the specified text string is received (default)
n=2:
When all objects are filled
(Prints with the delimiter at the end of the data.)
n=3:
When the specified number of characters is received
(not including delimiters)
7. Control Command Details
^PT Select print start trigger
ASCII: ^ P T n
Decimal: 94 80 84 nd
Hexadecimal: 5E 50 54 nh
Parameters
1≤n≤3
Description
Selects the type of print start trigger.
P-touch Template 2.0 Command Reference
This command is a dynamic command.
Remarks
Invalid if n is a value other than 1 through 3
Example
When the print start trigger is “when all objects are filled”:
^ P T 2
(5Eh 50h 54h 32h)
7. Control Command Details
- 37 -
P-touch Template 2.0 Command Reference
^FF Start printing
ASCII: ^ F F
Decimal: 94 70 70
Hexadecimal: 5E 46 46
Parameters
None
Description
Starts printing.
However, the print start trigger must be “when the specified text string is received”.
(Refer to “^PT” and “ESC iXT2”.)
The text string for the print start command can be changed.
(Refer to “^PS” and “ESC iXP2”.)
Example
To print template number 3:
^ T S 0 0 3 ^ F F
(5Eh 54h 53h 30h 30h 33h 5Eh 46h 46h)
- 38 -
7. Control Command Details
(n1*10)+n2:
Length of the text string (can be set between 1 and 20)
data:
Text string (The maximum number of characters that can be set is 20 characters
(bytes).)
^PS Specify print start command text string
ASCII: ^ P S n1 n2 data
Decimal: 94 80 83 nd1 nd2 datad
Hexadecimal: 5E 50 53 nh1 nh2 datah
Parameters
0≤n1≤2
0≤n2≤9
00h≤datah≤FFh
Description
Specifies the text string for the print start command.
P-touch Template 2.0 Command Reference
The default text string for the print start command is “^FF”.
This command is a dynamic command.
Remarks
Invalid if more than 20 characters have been specified
Example
To change the text string for the print start command to “START”:
Since the text string to be specified (data), “START”, contains 5 characters, n1=0 and n2=5. Therefore, the
command will be as follows.
^ P S 0 5 S T A R T
(5Eh 50h 53h 30h 35h 53h 54h 41h 52h 54h)
- 39 -
7. Control Command Details
(n1*100)+(n2*10)+n3:
Print start received character count (bytes) (1 to 999)
^PC Specify print start received character count
ASCII: ^ P C n1 n2 n3
Decimal: 94 80 67 nd1 nd2 nd3
Hexadecimal: 5E 50 43 nh1 nh2 nh3
Parameters
0≤n1≤9
0≤n2≤9
0≤n3≤9
Description
Specifies the number of characters to be received in order to start printing.
The default print start received character count is 10.
P-touch Template 2.0 Command Reference
This command is a dynamic command.
If Unicode(UTF-8) mode is used, 1-4 bytes are used as 1 character.
Example
To change the print start received character count to 100 characters:
Since n1=1, n2=0 and n3=0, the command will be as follows.
^ P C 1 0 0
(5Eh 50h 43h 31h 30h 30h)
7. Control Command Details
- 40 -
P-touch Template 2.0 Command Reference
(n1*10)+n2:
Length of the text string (between 1 and 20)
data:
Text string (The maximum number of characters that can be set is 20 characters (bytes).)
^SS Specify delimiter
ASCII: ^ S S n1 n2 data
Decimal: 94 83 83 nd1 nd2 datad
Hexadecimal: 5E 53 53 nh1 nh2 datah
Parameters
0≤n1≤2
0≤n2≤9
00h≤datah≤FFh
Description
The delimiter is used to indicate when to move to the next object in data that is being sent.
Specifies the text string for the delimiter.
The default text string for the delimiter is “09h” (Tab code).
A text string that will not appear in the print data should be specified.
This command is a dynamic command.
Remarks
Invalid if more than 20 characters have been specified
Example
To change the delimiter to “,” (2Ch):
Since the text string contains one character, n1=0 and n2=1. In addition, with the text string (datah) “,”
(2Ch), the command will be as follows.
^ S S 0 1 ,
(5Eh 53h 53h 30h 31h 2Ch)
- 41 -
7. Control Command Details
(n1*100)+(n2*10)+n3:
Template number (1 to 255)
^TS Select template
ASCII: ^ T S n1 n2 n3
Decimal: 94 84 83 nd1 nd2 nd3
Hexadecimal: 5E 54 53 nh1 nh2 nh3
Parameters
0≤n1≤2
0≤n2≤9
0≤n3≤9
Description
Specifies the number of the template selected from the printer.
The default selection number is 1.
P-touch Template 2.0 Command Reference
This command is a dynamic command.
Remarks
The template numbers that can be set are between 1 and 255.
This command becomes invalid if any other value has been specified or if the number that has been
specified is for a template not transferred to the printer.
Example
To select template number 99:
Since n2=9 and n3=9, the command will be as follows.
^ T S 0 9 9
(5Eh 54h 53h 30h 39h 39h)
7. Control Command Details
- 42 -
n1:
Auto cut setting
(ON: 1 (default); OFF: 0)
(n2*10)+n3:
Auto cut label number setting (1 to 99)
(Default value: 1)
n4:
Cut at end setting
(ON: 1 (default); OFF: 0)
^CO Select cut options
ASCII: ^ C O n1 n2 n3 n4
Decimal: 94 67 79 nd1 nd2 nd3 nd4
Hexadecimal: 5E 43 4F nh1 nh2 nh3 nh4
Parameters
0≤n1≤1
0≤n2≤9
0≤n3≤9
0≤n4≤1
Description
Specifies the various cut options.
P-touch Template 2.0 Command Reference
This command is a dynamic command.
This command is applied to only a printer with auto cutter.
Remarks
The auto cut label number setting can be between 1 and 99.
This command becomes invalid if any other value has been specified.
Example
To cut after every two labels:
Since the auto cut setting will be set to ON and the auto cut label number will be two labels, n1=1, n2=0
and n3=2. Therefore, the command will be as follows.
^ C O 1 0 2 0
(5Eh 43h 4Fh 31h 30h 32h 30h)
7. Control Command Details
- 43 -
P-touch Template 2.0 Command Reference
(n1*100)+(n2*10)+n3:
Number of dots for the line spacing (0 to 255)
^LS Specify line spacing with line feed
ASCII: ^ L S n1 n2 n3
Decimal: 94 76 83 nd1 nd2 nd3
Hexadecimal: 5E 4C 53 nh1 nh2 nh3
Parameters
0≤n1≤2
0≤n2≤9
0≤n3≤9
Description
Specifies the number of dots for the line spacing when a line feed is entered.
The default number of dots for the line spacing when a line feed is entered is the number of dots
determined when the template is created in P-touch Editor.
This command is a dynamic command.
Remarks
The number of dots for the line spacing can be between 0 and 255. This command becomes invalid if any
other value has been specified.
Example
To set the line spacing to 10 dots:
^ L S 0 1 0
(5Eh 4Ch 53h 30h 31h 30h)
7. Control Command Details
- 44 -
n:
Character code
^CC Change the prefix character
ASCII: ^ C C n
Decimal: 94 67 67 nd
Hexadecimal: 5E 43 43 nh
Parameters
00h≤nh≤FFh
Description
Changes the prefix character code.
The default text string for the prefix character is “^”.
This command is a dynamic command.
Example
P-touch Template 2.0 Command Reference
To change the prefix character from “^” to “_”:
^ C C 5Fh
(5Eh 43h 43h 5Fh) (5Fh stands for “_” in ASCII code)
However, if the printer is later not turned off, then on again, the prefix character remains set to “_”, and the
initialize command, for example, will be “_II” instead of “^II”.
7. Control Command Details
- 45 -
(n1*10)+n2:
Length of the text string (can be set between 1 and 20)
data:
Text string (The maximum number of characters that can be set is 20 characters (bytes).)
^RC Specify line feed command text string
ASCII: ^ R C n1 n2 data
Decimal: 94 82 67 nd1 nd2 datad
Hexadecimal: 5E 52 43 nh1 nh2 datah
Parameters
0≤n1≤2
0≤n2≤9
00h≤datah≤FFh
Description
Specifies the text string for the line feed command.
P-touch Template 2.0 Command Reference
The default text string for the line feed command is “^CR”.
This command is a dynamic command.
Remarks
Invalid if more than 20 characters have been specified
Example
To change the text string for the line feed command to “0Dh 0Ah”:
Since the text string to be specified (data) contains 2 characters, n1=0 and n2=2. Therefore, the command
will be as follows.
^ R C 0 2 0Dh 0Ah
(5Eh 52h 43h 30h 32h 0Dh 0Ah)
- 46 -
7. Control Command Details
(n1*100)+(n2*10)+n3:
Number of copies (bytes) (1 to 999)
^CN Specify number of copies
ASCII: ^ C N n1 n2 n3
Decimal: 94 67 78 nd1 nd2 nd3
Hexadecimal: 5E 43 4E nh1 nh2 nh3
Parameters
0≤n1≤9
0≤n2≤9
0≤n3≤9
Description
Specifies the number of copies to be printed.
The default number of copies is 1.
P-touch Template 2.0 Command Reference
This command is a dynamic command.
Remarks
When printing is finished, the number of copies specified with this command returns to the number of
copies (static value) specified from the printer.
Example
To change the number of copies to 100:
Since n1=1, n2=0 and n3=0, the command will be as follows.
^ C N 1 0 0
(5Eh 43h 4Eh 31h 30h 30h)
7. Control Command Details
- 47 -
(n1*100)+(n2*10)+n3:
Number of Numbering copies (bytes) (1 to 999)
^NN Specify number of Numbering copies
ASCII: ^ N N n1 n2 n3
Decimal: 94 78 78 nd1 nd2 nd3
Hexadecimal: 5E 4E 4E nh1 nh2 nh3
Parameters
0≤n1≤9
0≤n2≤9
0≤n3≤9
Description
Specifies the number of copies to be printed with Numbering.
The default number of copies printed with Numbering is 1.
P-touch Template 2.0 Command Reference
This command is a static command.
Remarks
When printing is finished, the number of copies specified with this command returns to the number of
copies (static value) specified from the printer.
Example
To change the number of Numbering copies to 100:
Since n1=1, n2=0 and n3=0, the command will be as follows.
^ N N 1 0 0
(5Eh 4Eh 4Eh 31h 30h 30h)
^ID Initialize template data
ASCII: ^ I D
Decimal: 94 73 68
Hexadecimal: 5E 49 44
Parameters
None
Description
Returns the data in the selected template to what it was when the template was transferred.
7. Control Command Details
- 48 -
n=0:
Priority given to print speed
n=1:
Priority given to print quality
^QS Select print options
ASCII: ^ Q S n
Decimal: 94 81 83 n
Hexadecimal: 5E 51 53 n
Parameters
0≦n≦1
Description
Select the print options.
The default value for the print options is “0” (priority given to print speed).
This command is a dynamic command.
P-touch Template 2.0 Command Reference
Example
To set the print options to give priority to print quality:
Since n=1, the command will be as follows.
^ Q S 1
(5Eh 51h 53h 31h)
7. Control Command Details
- 49 -
P-touch Template 2.0 Command Reference
(n1*10)+n2:
Version number (between 0 and 40)
^QV Specify QR Code version
ASCII: ^ Q V n1 n2
Decimal: 94 81 86 nd1 nd2
Hexadecimal: 5E 51 56 nh1 nh2
Parameters
0≤n1≤4
0≤n2≤9
Description
Specifies the QR Code version.
The default QR Code version is 0.
This command becomes invalid if a value other than those that can be set (between 0 and 40) has been
specified.
This command is a dynamic command.
Example
To change the version to 10:
Since n1=1 and n2=0, the command will be as follows.
Description
Selects whether or not GS codes, which are included in barcode protocols such as GS1-128
(UCC/EAN-128), are replaced with FNC1 codes.
This command is a dynamic command.
Remarks
Invalid if n is a value other than 1 or 0
Example
To disable FNC1 replacement:
Since FNC1 replacement will be disabled, n=0. Therefore, the command will be as follows.
^ F C 0
(5Eh 46h 43h 30h)
7. Control Command Details
- 51 -
(1)
Print start trigger setting
(2)
Print start command text string
(3)
Print start received character count
(4)
Delimiter
(5)
Number of selected template
(6)
Prefix character
(7)
Line feed command text string
(8)
Number of copies setting
(9)
QR Code version setting
(10)
Number of serialize
(11)
FNC1 replacement setting
^II Initialize
ASCII: ^ I I
Decimal: 94 73 73
Hexadecimal: 5E 49 49
Parameters
None
Description
Reve rts all dynamic settings to the printer settings.
P-touch Template 2.0 Command Reference
7. Control Command Details
- 52 -
P-touch Template 2.0 Command Reference
n=1 or 2:
Feeds one label length (feed operation with continuous length tape)
n=3:
Cuts
^OP Perform printer operation (feed)
ASCII: ^ O P n
Decimal: 94 79 80 nd
Hexadecimal: 5E 4F 50 nh
Parameters
1≦n≦3
Description
Causes the printer to perform a feed operation.
Remarks
RJ-4XXX series: Regardless of parameter setting value, feed operation is performed.
Example
To specify that the printer performs a feed operation:
^ O P 1
(5Eh 4Fh 50h 31h)
- 53 -
7. Control Command Details
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
Refer to table (6) below.
5 4 1
Model code
Refer to table (7) below.
6 5 1
Country code
Fixed at “0” (30h)
7 6 1
Power Status
Refer to table (5) below.
8 7 1
Reserved
Fixed at 00h
9 8 1
Error information 1
Refer to table (1) below.
10 9 1
Error information 2
Refer to table (2) below.
11
10
1
Media width
12
11
1
Media type
Refer table (3) below.
13
12
1
Number of colors
Fixed at 00h
14
13
1
Media length (higher order bytes)
15
14
1
Media sensor value
16
15
1
Mode
Fixed at 01h
17
16
1
Density
Fixed at 00h
18
17
1
Media length (lower order bytes)
19
18
1
Status type
Refer to table (4) below.
20
19
1
Phase type
Fixed at 00h
21
20
1
Phase number (higher order bytes)
Fixed at 00h
22
21
1
Phase number (lower order bytes)
Fixed at 00h
23
22
1
Notification number
Not used
24
23
1
Expansion area (number of bytes)
Fixed at 00h
25
24
1
Reserved
Fixed at 00h
26
25
1
Reserved
Fixed at 00h
^SR Status request
ASCII: ^ S R
Decimal: 94 83 82
Hexadecimal: 5E 53 52
Parameters
None
Description
Returns the printer status.
The printer status consists of 32 bytes.
P-touch Template 2.0 Command Reference
7. Control Command Details
- 54 -
P-touch Template 2.0 Command Reference
27
26
1
Reserved
Fixed at 00h
28
27
1
Reserved
Fixed at 00h
29
28
1
Reserved
Fixed at 00h
30
29
1
Reserved
Fixed at 00h
31
30
1
Reserved
Fixed at 00h
32
31
1
Reserved
Fixed at 00h
- 55 -
7. Control Command Details
Flag
Mask
Definition
Bit 0
01h
Not used
Bit 1
02h
“End of media” error
Bit 2
04h
Not used
Bit 3
08h
Battery weak
Bit 4
10h
Not used
Bit 5
20h
Printer turned off
Bit 6
40h
Not used
Bit 7
80h
Not used
Flag
Mask
Definition
Bit 0
01h
Not used
Bit 1
02h
“Expansion buffer is full.” error
Bit 2
04h
Communication error
Bit 3
08h
Not used
Bit 4
10h
“Cover open” error
Bit 5
20h
Not used
Bit 6
40h
Leading edge detection error
Bit 7
80h
System error
Media Type
Value
Remarks
Continuous length tape
4Ah Die-cut label
4Bh
Status Type
Value
Remarks
Reply to status request
00h (Not used)
01h Error occurred
02h (Not used)
03h to FFh
(1) Error information 1
(2) Error information 2
P-touch Template 2.0 Command Reference
(3) Media type
(4) Status type
7. Control Command Details
- 56 -
Value
Battery level
AC adapter
20h
Full
Not connected
21h
High
Not connected
22h
Half
Not connected
23h
Low
Not connected
24h
Charging required
Not connected
30h
Full
Connected
31h
High
Connected
32h
Half
Connected
33h
Low
Connected
34h
Charging required
Connected
37h
No battery
Connected
Other
Undefined
Undefined
Series
Value
Remarks
RJ series
“7” (37h)
TD series
“5” (35h)
Model
Value
Remarks
RJ-4230B
”C” (43h)
RJ-4250WB
”D” (44h)
TD-4410D
”7” (37h)
TD-4420DN
”8” (38h)
TD-4510D
”9” (39h)
TD-4520DN
”A” (41h)
TD-4550DNWB
”B” (42h)
(5) Power Status
P-touch Template 2.0 Command Reference
(6) Series code
(7) Model code
7. Control Command Details
- 57 -
P-touch Template 2.0 Command Reference
^VR Retrieve version information
ASCII: ^ V R
Decimal: 94 86 82
Hexadecimal: 5E 56 52
Parameters
None
Description
Retrieves the version information for the printer as a 8-character text string.
Retrieves the version information for the printer as a 16-character text string.(RJ-4230B)
- 58 -
7. Control Command Details
1
2
3
^CR Line feed in object
ASCII: ^ C R
Decimal: 94 67 82
Hexadecimal: 5E 43 52
Parameters
None
Description
Adds a line feed to the next line in the text object.
Command characters are modifiable.
(Refer to ^RC, ESC iXR2)
Example
To print three lines:
P-touch Template 2.0 Command Reference
Code: 1 ^ C R 2 ^ C R 3 ^ F F
(31h 5Eh 43h 52h 32h 5Eh 43h 52h 33h 5Eh 46h 46h)
Print result:
7. Control Command Details
- 59 -
(n1*10)+n2:
Object number (1 to 99)
^OS Select object (object number)
ASCII: ^ O S n1 n2
Decimal: 94 79 83 nd1 nd2
Hexadecimal: 5E 4F 53 nh1 nh2
Parameters
0≤n1≤9
0≤n2≤9
Description
Selects an object by its object number.
Remarks
The object number can be set between 1 and 99.
P-touch Template 2.0 Command Reference
This command becomes invalid if any other value has been specified.
Use this command to insert data starting with an intermediary object.
Example
To select the 33rd object:
^ O S 3 3
(5Eh 4Fh 53h 33h 33h)
7. Control Command Details
- 60 -
P-touch Template 2.0 Command Reference
data:
Text string (object name)
^ON Select object (object name)
ASCII: ^ O N data 00
Decimal: 94 79 78 datad 00
Hexadecimal: 5E 4F 4E datah 00
Parameters
None
Description
Selects an object by its object name.
Remarks
The maximum length of text that can be set is 20 characters. If text longer than this has been specified, the
command becomes invalid. In addition, the command becomes invalid if no text has been specified.
“00h” should be added at the end of the text. This indicates the end of the text.
Use this command to insert data starting with an intermediary object.
Example
To select an object with the name “TEXT1”:
^ O N T E X T 1 00h
(5Eh 4Fh 4Eh 54h 45h 58h 54h 31h 00h)
7. Control Command Details
- 61 -
P-touch Template 2.0 Command Reference
(nh2*256)+nh1:
Specified number of characters
data:
Text string
1A2
^DI Directly insert object
ASCII: ^ D I n1 n2 data
Decimal: 94 68 73 nd1 nd2 datad
Hexadecimal: 5E 44 49 nh1 nh2 datah
Parameters
00h≤nh1≤FFh
00h≤nh2≤FEh
Description
Inserts a text string for the specified number of characters into the object selected in the selected template.
(Even if a print command or delimiter is within the specified number of characters, they are treated as
data.)
Example
If “A” is specified as the print start text string, and the print start trigger is specified as the print start text
string, easily print “A” with the following command.
Code: ^ D I 03h 00h 1 A 2 A
(5Eh 44h 49h 03h 00h 31h 41h 32h 41h)
Print result:
7. Control Command Details
- 62 -
nh=00h or 30h:
ESC/P mode
nh=01h or 31h:
Raster mode
nh=03h or 33h:
P-touch Template mode (default)
nh=04h or 34h:
CPCL Page Print mode
nh=05h or 35h:
CPCL Line Print mode
ESC i a Select command mode
ASCII: ESC i a n
Decimal: 27 105 97 nd
Hexadecimal: 1B 69 61 nh
Parameters
nh=00h 01h 03h 04h 05h 30h 31h 33h 34h 35h
Description
Switches the mode.
P-touch Template 2.0 Command Reference
This command is a dynamic command.
Remarks
Invalid if n is a value outside of the allowable range.
7. Control Command Details
- 63 -
nh3=00h:
When the specified text string is received (default)
nh3=01h:
When all objects are filled
(Prints with the delimiter at the end of the data.)
nh3=02h:
When the specified number of characters is received
(not including delimiters)
ESC iXT2 Select print start trigger
ASCII: ESC i X T 2 n1 n2 n3
Decimal: 27 105 88 84 50 nd1 nd2 nd3
Hexadecimal: 1B 69 58 54 32 nh1 nh2 nh3
Parameters
nh1=01h (Fixed)
nh2=00h (Fixed)
00h≤nh3≤02h
Description
Selects the type of print start trigger.
P-touch Template 2.0 Command Reference
This command is a static command.
Remarks
Invalid if nh3 is a value other than 00h through 02h
Example
When the print start trigger is “when all objects are filled”:
ESC i X T 2 01h 00h 01h
(1Bh 69h 58h 54h 32h 01h 00h 01h)
7. Control Command Details
- 64 -
nh1+(nh2*256):
Length of the text string (can be set between 1 and 20)
data:
Text string (The maximum number of characters that can be set is 20 characters
(bytes).)
ESC iXP2 Specify print start command text string
ASCII: ESC i X P 2 n1 n2 data
Decimal: 27 105 88 80 50 nd1 nd2 datad
Hexadecimal: 1B 69 58 50 32 nh1 nh2 datah
Parameters
01h≤nh1≤14h
nh2: 00h (Fixed)
00h≤datah≤FFh
Description
Specifies the text string for the print start command.
P-touch Template 2.0 Command Reference
The default text string for the print start command is “^FF”.
This command is a static command.
Remarks
Invalid if more than 20 characters have been specified
Example
To change the text string for the print start command to “START”:
Since the text string to be specified (data), “START”, contains 5 characters, nh1=05h and nh2=00h.
Therefore, the command will be as follows.
ESC i X P 2 05h 00h S T A R T
(1Bh 69h 58h 50h 32h 05h 00h 53h 54h 41h 52h 54h)
- 65 -
7. Control Command Details
nh3+(nh4*256):
Print start received character count (1 to 999)
ESC iXr2 Specify print start received character count
ASCII: ESC i X r 2 n1 n2 n3 n4
Decimal: 27 105 88 114 50 nd1 nd2 nd3 nd4
Hexadecimal: 1B 69 58 72 32 nh1 nh2 nh3 nh4
Parameters
nh1: 02h (Fixed)
nh2: 00h (Fixed)
00h≤nh3≤FFh
00h≤nh4≤03h
Description
Specifies the number of characters to be received in order to start printing.
P-touch Template 2.0 Command Reference
The default print start received character count is 10.
This command is a static command.
If Unicode(UTF-8) mode is being used, maximum 4 bytes are used as 1 character.
Example
To change the print start received character count to 100 characters:
Since nh3=64h and nh4=00h, the command will be as follows.
ESC i X r 2 02h 00h 64h 00h
(1Bh 69h 58h 72h 32h 02h 00h 64h 00h)
7. Control Command Details
- 66 -
P-touch Template 2.0 Command Reference
nh1+(nh2*256):
Length of the text string (between 1 and 20)
data:
Text string (The maximum number of characters that can be set is 20 characters
(bytes).)
ESC iXD2 Specify delimiter
ASCII: ESC i X D 2 n1 n2 data
Decimal: 27 105 88 68 50 nd1 nd2 datad
Hexadecimal: 1B 69 58 44 32 nh1 nh2 datah
Parameters
01h≤nh1≤14h
nh2: 00h (Fixed)
00h≤datah≤FFh
Description
The delimiter is used to indicate when to move to the next object in data that is being sent.
Specifies the text string for the delimiter.
The default text string for the delimiter is “09h” (Tab code).
This command is a static command.
Remarks
Invalid if more than 20 characters have been specified
Example
To change the delimiter to “,” (2Ch):
Since the text string contains one character, nh1=01h and nh2=00h. In addition, with the text string (datah)
“,” (2Ch), the command will be as follows.
ESC i X D 2 01h 00h 2Ch
(1Bh 69h 58h 44h 32h 01h 00h 2Ch)
- 67 -
7. Control Command Details
nh1+(nh2*256):
Length of the text string (0 to 20) + 1
data:
Text string (The maximum number of characters that can be set is 20 characters
(bytes).)
ESC iXa2 Specify non-printed text strings
ASCII: ESC i X a 2 n1 n2 n3 data
Decimal: 27 105 88 97 50 nd1 nd2 nd3 datad
Description
Selects the character set according to the country selected, and switches some character codes in the
code table according to the value for nh3.
The following 12 codes are switched.
The default setting is nh3=00h (USA).
This command is a static command.
Example
To change the international character set to that for Japan:
7. Control Command Details
23h 24h 40h 5Bh 5Ch 5Dh 5Eh 60h 7Bh 7Ch 7Dh 7Eh
(For the characters that are switched, refer to “International character set table”.)
ESC i X j 2 01h 00h 08h
(1Bh 69h 58h 6Ah 32h 01h 00h 08h)
- 75 -
nh1+(nh2*256):
Length of the text string (can be set between 1 and 20)
data:
Text string (The maximum number of characters that can be set is 20 characters
(bytes).)
ESC iXR2 Specify line feed command text string
ASCII: ESC i X R 2 n1 n2 data
Decimal: 27 105 88 82 50 nd1 nd2 datad
Hexadecimal: 1B 69 58 52 32 nh1 nh2 datah
Parameters
01h≤nh1≤14h
nh2: 00h (Fixed)
00h≤datah≤FFh
Description
Specifies the text string for the line feed command.
P-touch Template 2.0 Command Reference
The default text string for the line feed command is “^CR”.
This command is a static command.
Remarks
Invalid if more than 20 characters have been specified
Example
To change the text string for the line feed command to “0Dh 0Ah”:
Since the text string to be specified (data), contains 2 characters, nh1=02h and nh2=00h. Therefore, the
command will be as follows.
ESC i X R 2 02h 00h 0Dh 0Ah
(1Bh 69h 58h 52h 32h 02h 00h 0Dh 0Ah)
- 76 -
7. Control Command Details
nh3+(nh4*256):
Number of copies (bytes) (1 to 999)
ESC iXC2 Specify number of copies
ASCII: ESC i X C 2 n1 n2 n3 n4
Decimal: 27 105 88 67 50 nd1 nd2 nd3 nd4
Hexadecimal: 1B 69 58 43 32 nh1 nh2 nh3 nh4
Parameters
nh1: 02h (Fixed)
nh2: 00h (Fixed)
00h≤nh3≤FFh
00h≤nh4≤03h
Description
Specifies the number of copies to be printed.
P-touch Template 2.0 Command Reference
The default number of copies is 1.
This command is a static command.
Example
To change the number of copies to 100:
Since nh3=64h and nh4=00h, the command will be as follows.
ESC i X C 2 02h 00h 64h 00h
(1Bh 69h 58h 43h 32h 02h 00h 64h 00h)
7. Control Command Details
- 77 -
nh3+(nh4*256):
Number of Numbering copies (bytes) (1 to 999)
ESC iXN2 Specify number of Numbering copies
ASCII: ESC i X N 2 n1 n2 n3 n4
Decimal: 27 105 88 78 50 nd1 nd2 nd3 nd4
Hexadecimal: 1B 69 58 4E 32 nh1 nh2 nh3 nh4
Parameters
nh1: 02h (Fixed)
nh2: 00h (Fixed)
00h≤nh3≤FFh
00h≤nh4≤03h
Description
Specifies the number of copies to be printed with Numbering.
P-touch Template 2.0 Command Reference
The default number of copies printed with Numbering is 1.
This command is a static command.
Example
To change the number of Numbering copies to 100:
Since nh3=64h and nh4=00h, the command will be as follows.
ESC i X N 2 02h 00h 64h 00h
(1Bh 69h 58h 4Eh 32h 02h 00h 64h 00h)
7. Control Command Details
- 78 -
P-touch Template 2.0 Command Reference
nh3=00h:
FNC1 replacement setting OFF
nh3=01h:
FNC1 replacement setting ON
ESC iXF2 FNC1 replacement setting
ASCII: ESC i X F 2 n1 n2 n3
Decimal: 27 105 88 70 50 nd1 nd2 nd3
Hexadecimal: 1B 69 58 46 32 nh1 nh2 nh3
Parameters
nh1: 01h (Fixed)
nh2: 00h (Fixed)
nh3: 00h 01h
Description
Selects whether or not GS codes, which are included in barcode protocols such as GS1-128
(UCC/EAN-128), are replaced with FNC1 codes.
This command is a static command.
Example
To disable FNC1 replacement:
ESC i X F 2 01h 00h 00h
(1Bh 69h 58h 46h 32h 01h 00h 00h)
7. Control Command Details
- 79 -
nh3=00h:
Disable recovery print
nh3=01h:
Enable recovery print
ESC iXd2 Specify recovery setting
ASCII: ESC i X d 2 n1 n2 n3
Decimal: 27 105 88 100 50 nd1 nd2 nd3
Hexadecimal: 1B 69 58 64 32 nh1 nh2 nh3
Parameters
nh1: 01h (Fixed)
nh2: 00h (Fixed)
nh3: 00h, 01h
Description
Select enable or disable of recovery print.
P-touch Template 2.0 Command Reference
The default value of “nh3” is 01h.
This command is a static command.
Example
For being enable recovery print.
Since nh3=01h, the command will be as follows.
ESC i X d 2 01h 00h 01h
(1Bh 69h 58h 64h 32h 01h 00h 01h)
7. Control Command Details
- 80 -
nh1=00h:
Once
nh1=01h:
No limits
ESC iXv2 (0Ch) Specify number of recovery
ASCII: ESC i X v 2 03h 00h 00h 0Ch n1
Decimal : 27 105 88 118 50 3 0 0 12 nd1
Hexadecimal : 1B 69 58 76 32 03 00 00 0C nh1
Parameters
nh1: 00h, 01h
Description
Specify number of recovery print.
Default value is 00h.
This command is a static command.
P-touch Template 2.0 Command Reference
Example
For setting number of recovery to no limit.
Since nh1=01h, the command will be as follows.
ESC i X v 2 03h 00h 00h 0Ch 01h
(1Bh 69h 58h 76h 32h 03h 00h 00h 0Ch 01h)
- 81 -
7. Control Command Details
n3=00h:
Disable
n3=01h:
Enable
ESC iXE2 Specify barcode margin setting
ASCII: ESC i X E 2 n1 n2 n3
Decimal: 27 105 88 64 50 n1 n2 n3
Hexadecimal: 1B 69 58 45 32 n1 n2 n3
Parameters
n1: 01h (Fixed)
n2: 00h (Fixed)
n3: 00h, 01h
Description
Specify barcode margin setting.
P-touch Template 2.0 Command Reference
Default value is 01h (Enable).
This command is a static command.
This setting affects only for 2D codes.
Example
For setting barcode margin to disable:
Since n3=00h, the command will be as follows
ESC i X E 2 01h 00h 00h
(1Bh 69h 58h 45h 32h 01h 00h 00h)
- 82 -
7. Control Command Details
nh3=00h:
No rotation
nh3=01h:
180 degrees rotation
ESC iXh2 Specify rotated print
ASCII: ESC i X h 2 n1 n2 n3
Decimal: 27 105 88 104 50 nd1 nd2 nd3
Hexadecimal: 1B 69 58 68 32 nh1 nh2 nh3
Parameters
nh1: 01h (Fixed)
nh2: 00h (Fixed)
nh3: 00h, 01h
Description
Select rotate setting.
P-touch Template 2.0 Command Reference
The default value for the rotate setting is "00h" (No rotation).
This command is a static command.
Example
To set the rotate setting to 180 degrees rotation:
Since nh3=01h, the command will be as follows.
ESC i X h 2 01h 00h 01h
(1Bh 69h 58h 68h 32h 01h 00h 01h)
7. Control Command Details
- 83 -
nh1=00h:
Te a r-bar
nh1=01h:
Head
ESC iX^2 Specify print stop position
ASCII: ESC i X ^ 2 01h 00h n1
Decimal: 27 105 88 94 50 1 0 nd1
Hexadecimal: 1B 69 58 5E 32 01 00 nh1
Parameters
nh1: 00h, 01h
Description
Select print stop position.
The default value is "00h" (Tear-bar).
This command is a static command.
P-touch Template 2.0 Command Reference
Example
To set the print stop position to head:
Since nh1=01h, the command will be as follows.
ESC i X ^ 2 01h 00h 01h
(1Bh 69h 58h 5Eh 32h 01h 00h 01h)
- 84 -
7. Control Command Details
P-touch Template 2.0 Command Reference
nh1=00h:
Disable
nh1=07h:
Enable
ESC iXv2 (08h) Specify WLAN communication mode of Raw port
ASCII: ESC i X v 2 03h 00h 00h 08h n1
Decimal: 27 105 88 118 50 3 0 0 8 nd1
Hexadecimal: 1B 69 58 76 32 03 00 00 08 nh1
Parameters
nh1: 00h, 07h
Description
Select WLAN Raw port bi-directional communication setting.
The default value is "00h" (Disable).
Setting this value to 07h, the printer returns data when communicating via W LAN Raw port.
This command is a static command.
Example
To enable bi-directional communication for W LAN Raw port:
Since nh1=07h, the command will be as follows.
ESC i X v 2 03h 00h 00h 08h 07h
(1Bh 69h 58h 76h 32h 03h 00h 00h 08h 07h)
- 85 -
7. Control Command Details
n1=00h:
Bold start (Default: “<b>”)
n1=01h:
Bold end (Default: “</b>”)
n1=02h:
Underline start (Default: “<u>”)
n1=03h:
Underline end (Default: “</u>”)
n2+(n3*256):
Length of the text string (can be set between 1 and 8)
data:
Text string (The maximum number of characters that can be set is 8 characters
(bytes).)
ESC iOUe1 Specify the string of text decoration tags
ASCII: ESC i O U e 1 n1 n2 n3 data
Decimal: 27 105 79 85 101 49 n1 n2 n3 data
Description
Specify the string of text decoration tags.
P-touch Template 2.0 Command Reference
This command is a static command.
Example
To modify “Bold start” tag string to ”&b”:
Since the length of the string is 2 (n3=02h), the command will be as follows.
ESC i O U e 1 00h 02h 00h 26h 62h
(1Bh 69h 4Fh 55h 65h 31h 00h 02h 00h 26h 62h)
To modify “Bold end” tag string to ”&&b” :
Since the length of the string is 3 (n3=03h), the command will be as follows
ESC i O U e 1 01h 03h 00h 26h 26h 62h
(1Bh 69h 4Fh 55h 65h 31h 01h 03h 00h 26h 26h 62h)
- 86 -
7. Control Command Details
[1]:
01h (Fixed)
[2]:
00h (Fixed)
[3]:
Setting
02h: When the specified number of characters is received
ESC iXT1 Retrieve print start trigger setting
ASCII: ESC i X T 1 n1 n2
Decimal: 27 105 88 84 49 nd1 nd2
Hexadecimal: 1B 69 58 54 31 nh1 nh2
Parameters
nh1=00h (Fixed)
nh2=00h (Fixed)
Description
The print start trigger is returned as 3-byte data.
P-touch Template 2.0 Command Reference
00h: When the specified text string is received
01h: When all objects are filled
The retrieved value is a value specified by a static command.
Example
The print start trigger specified for the printer is retrieved. W hen the setting is “when the specified text
string is received”:
Code: ESC i X T 1 00h 00h
(1Bh 69h 58h 54h 31h 00h 00h)
Returned value: 01h 00h 00h
7. Control Command Details
- 87 -
P-touch Template 2.0 Command Reference
[1,2]:
nh1 nh2 (number of characters) nh1+(nh2*256)
[3 and later]:
Text string
ESC iXP1 Retrieve print start command setting text string
ASCII: ESC i X P 1 n1 n2
Decimal: 27 105 88 80 49 nd1 nd2
Hexadecimal: 1B 69 58 50 31 nh1 nh2
Parameters
nh1: 00h (Fixed)
nh2: 00h (Fixed)
Description
Retrieves the text string specified for the print start command.
3- to 22-byte data is returned from the printer. (Varies depending on the length of the text string)
The retrieved value is a value specified by a static command.
Example
When the text string for the print start command is specified as “START”:
Code: ESC i X P 1 00h 00h
(1Bh 69h 58h 50h 31h 00h 00h)
Returned value: 05h 00h S T A R T
(05h 00h 53h 54h 41h 52h 54h)
7. Control Command Details
- 88 -
P-touch Template 2.0 Command Reference
[1]:
02h (Fixed)
[2]:
00h (Fixed)
[3,4]:
nh3 nh4 settings
nh3+(nh4*256): Print start received character count
ESC iXr1 Retrieve print start received character count
ASCII: ESC i X r 1 n1 n2
Decimal: 27 105 88 114 49 nd1 nd2
Hexadecimal: 1B 69 58 72 31 nh1 nh2
Parameters
nh1: 00h (Fixed)
nh2: 00h (Fixed)
Description
Retrieves the number of characters specified to be received in order to start printing.
4-byte data is returned from the printer.
The retrieved value is a value specified by a static command.
Example
For a print start received character count of 500 characters:
Code: ESC i X r 1 00h 00h
(1Bh 69h 58h 72h 31h 00h 00h)
Returned value: 02h 00h F4h 01h (244+1*256=F4h+01h*256=500 characters)
7. Control Command Details
- 89 -
P-touch Template 2.0 Command Reference
[1,2]:
nh1 nh2 (number of characters) nh1+(nh2*256)
[3 and later]:
Text string
ESC iXD1 Retrieve delimiter
ASCII: ESC i X D 1 n1 n2
Decimal: 27 105 88 68 49 nd1 nd2
Hexadecimal: 1B 69 58 44 31 nh1 nh2
Parameters
nh1: 00h (Fixed)
nh2: 00h (Fixed)
Description
Retrieves the text string specified for the delimiter.
3- to 22-byte data is returned from the printer. (Varies depending on the length of the text string)
The retrieved value is a value specified by a static command.
Retrieves the specified non-printed text string.
2- to 22-byte data is returned from the printer. (Varies depending on the length of the text string)
The retrieved value is a value specified by a static command.
Example
When “ABCD” is specified as the non-printed text string:
The following command is sent to the printer.
Code: ESC i X a 1 01h 00h 01h
(1Bh 69h 58h 61h 31h 01h 00h 01h)
Returned value: 04h 00h A B C D
(04h 00h 41h 42h 43h 44h)
7. Control Command Details
- 91 -
[1]:
01h (Fixed)
[2]:
00h (Fixed)
[3]:
Setting
05h: CPCL Line Print mode
ESC iXi1 Retrieve command mode setting
ASCII: ESC i X i 1 n1 n2
Decimal: 27 105 88 105 49 nd1 nd2
Hexadecimal: 1B 69 58 69 31 nh1 nh2
Parameters
nh1: 00h (Fixed)
nh2: 00h (Fixed)
Description
Retrieves the setting for the command mode.
3-byte data is returned from the printer.