ESC iXj1 Retrieve default international character set ................................... 109
ESC iXm2 Select default character code table ................................................110
ESC iXm1 Retrieve default character code table ............................................ 111
・ ..................................................................................................... 112 Character codes
Standard character code table
Eastern European character code table (W
Western European character code table (W
International character set............................................................................... 115
character set .......................................108
for ESC/P codes............................................... 112
indows-1250) ............................... 113
indows 1252) ............................... 114
5
Page 6
Introduction
This material provides the necessary information for directly controlling TD-4000/4100N.
This information is provided assuming that the user has full understanding of the operating
system being used and basic mastery of RS-232C, USB or Ethernet in a developer's
environment.
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
TD-4000/4100N, 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.
These ESC/P
commands have been adapted specifically for this company.
6
Page 7
Control Code List
Character/style selection
ESC R 1B 52 Select international character set
ESC q 1B 71 Select character style
ESC k 1B 6B Select font
ESC t 1B 74 Select character code table
Text printing
ESC 4 1B 34 Apply italic style
ESC 5 1B 35 Cancel italic style
ESC E 1B 45 Apply bold style
ESC F 1B 46 Cancel bold style
ESC G 1B 47 Apply double-strike printing
ESC H 1B 48 Cancel double-strike
ESC P 1B 50 Specify pica pitch (10 cpi)
ESC M 1B 4D Specify elite pitch (12 cpi)
ESC g 1B 67 Specify micron pitch
ESC p 1B 70 Specify proportional characters
ESC W 1B 57 Specify double-width characters
SO 0E Specify auto-cancelling enlarged characters
ESC SO 1B 0E Specify auto-cancelling enlarged characters
SI 0F Specify reduced characters
ESC SI 1B 0F Specify reduced characters
DC2 12 Cancel reduced characters
DC4 14 Cancel auto-cancelling double-width characters
ESC - 1B 2D Apply/cancel underlining
ESC ! 1B 21 Global formatting
ESC SP 1B 20 Specify character spacing
ESC X 1B 58 Specify character size
Line feeds
ESC 0 1B 30 Specify line feed of 1/8 inch
ESC 2 1B 32 Specify line feed of 1/6 inch
ESC 3 1B 33 Specify minimum line feed.
ESC A 1B 41 Specify line feed of n/60 inch
7
Page 8
Horizont
ESC l 1B 6C Specify left margin.
ESC Q 1B 51 Specify right margin.
CR 0D Carriage return
ESC D 1B 44 Specify horizontal tab position
HT 09 Apply horizontal tab
ESC $ 1B 24 Specify absolute horizontal position
ESC \ 1B 5C Specify relative horizontal position
ESC a 1B 61 Specify alignment
Vertical movement
LF 0A Line feed
FF 0C Page feed
ESC J 1B 4A Forward paper feed
ESC B 1B 42 Specify vertical tab position
VT 0B Apply vertical tab
ESC ( V 1B 28 56 Specify absolute vertical position.
ESC ( v 1B 28 76 Specify relative vertical position.
al direction movement
Paper formatting
ESC ( c 1B 28 63 Specify page format.
ESC ( C 1B 28 43 Specify page length
Printer control
ESC @ 1B 40 Defaults
Graphic commands
ESC * 1B 2A Select a bit image.
ESC K 1B 4B 8-dot single-density bit image
ESC L 1B 4C 8-dot double-density bit image
ESC Y 1B 59 8-dot double-speed double-density bit image
ESC Z 1B 5A 8-dot quadruple-density bit image
8
Page 9
Advanced co
ESC i B 1B 69 42 Bar code
ESC i Q 1B 69 51 2D bar code QR codes
ESC i P 1B 69 50 QR code version setting
ESC i V 1B 69 56 2D bar codes PDF417
ESC i D 1B 69 44 2D bar code data matrix
ESC i M 1B 69 4D 2D bar code MaxiCode
ESC i F 1B 69 46 Print downloaded data
ESC i a 1B 69 61 Switch command mode
ESC i S 1B 69 53 Request printer status
ESC i L 1B 69 4C Select landscape orientation
ESC i C 1B 69 43 Specify cutting
[Example] ABC in 24-dot font and DEF in 48-dot font
Code
ESC X 00h 18h 00h ABC
ESC X 00h 30h 00h DEF FF
Print result
ABC
38
DEF
Page 39
Line feed commands
ESC 0 Specify line feed of 1/8 inch
[ASCII] ESC 0
[Decimal] 27 48
[Hexadecimal] 1B 30
[Parameters] None
[Description]
. Specifies a line feed of 1/8 inch (about 0.32 cm).
. Specifies a line feed of 38/300 inch (= 38 dots).
ESC 2 Specify line feed of 1/6 inch
[ASCII] ESC 2
[Decimal] 27 50
[Hexadecimal] 1B 32
[Parameters] None
[Description]
. Specifies a line feed of 1/6 inch (about 0.42 cm).
. Specifies a line feed of 50/300 inch (= 50 dots).
ESC 3 Specify minimum line feed
[ASCII] ESC 3 n
[Decimal] 27 51 n
[Hexadecimal] 1B 33 n
[Parameters] 0 ≤ n ≤ 255
[Description]
. Specifies a line feed of n/300 inch per line.
. The line feed unit is 1 dot.
39
Page 40
ESC A Specify line feed of n/60 inch
[ASCII] ESC A n
[Decimal] 27 65 n
[Hexadecimal] 1B 41 n
[Parameters] 0 ≤ n ≤ 255
[Description]
・Specifies a line feed of n/60 inch.
・The line feed unit is 5 dots.
40
Page 41
Horizontal direction movement commands
ESC l Specify left margin
[ASCII] ESC l n
[Decimal] 27 108 n
[Hexadecimal] 1B 6C n
[Parameters] 0 ≤ n ≤ 255
0 ≤ left margin < right margin
[Description]
・The left margin and the right margin use the left edge of the physically printable area as
the reference.
・The space between the left edge of the physically printable area and the set number of
columns is set as an unprinted area. The left margin position is the right edge of the
specified column. (Character width * n)
・The setting is in the range 0 ≤ (character width * n) ≤ x. Settings outside that range are
ignored. However, x is a value dependent on the media.
・The area between the left edge (first column) to the nth column is specified as an
unprinted area.
・The position
set) from the left edge.
The character width when specifying the margin includes the settings for specifying
character spacing, character spacing for full-width characters or half-width characters. In
addition, when pitches of 10 cpi (= 30 dots), 12 cpi (= 25 dots), or 15 cpi (= 20 dots),
reduced characters, or double-width characters are specified, that character width is
considered the unit.
However, increases in the character width due to character styles are not applied.
of the left margin is the character width * n (at the time that the left margin is
41
Page 42
Columns
Left edge Left margin position
1 2 34 5 678910111213 14
Right margin position
1516
・
・
Unprinted
area
Left margin setting
Right margin setting
Example: Left margin = Column 5; right margin = Column 14
Print area
Printable area
Unprinted
area
42
Page 43
・The horizont
・If the left margin setting is not at the beginning of the line, the left margin is set after a line
feed.
The beginning of the line indicates the left margin position for left alignment; for right and
center alignment, it means that no image or character is entered on the line.
・Even if the character width is changed after the left margin is set, the left margin position
does not change.
・Any left margin setting that puts the left margin position to the right of the right margin
position is ignored.
・When setting the left margin, set it at least one column (10 cpi = 30 dots) smaller than the
right margin.
[(the character width * n at the setting) > (number of dots of right margin - 30 dots) -->
the setting will be ignored.]
・If the difference between the right margin position and the left margin position is less than
one character, that character is ignored.
・When proportional pitch is specified with the ESC p command, a character width of 10
cpi (= 30 dot) is applied.
al direction print position is moved to the left margin position.
・If the print media is continuous length label, the print direction is landscape, and the page
length is not specified, commands specifying the left margin are ignored.
[Example] The left margin is set to Column 3.
Code
ABC CR ESC l 03h EFGHIJ FF
Print result
ABC
EFGHIJ
43
Page 44
ESC Q Specify right margin
[ASCII] ESC Q n
[Decimal] 27 81 n
[Hexadecimal] 1B 51 n
[Parameters] 1≤n≤255
Left margin < character width * n at time of setting ≤ printable area
[Description]
・The left margin and the right margin use the left edge of the physically printable area as
the reference.
・The right margin position is the right edge of the set column. (Character width * n)
・The setting is in the range 0 ≤ (character width * n) ≤ x. ettings outside that range are
ignored. However, x is a value dependent on the media.
・Left margin ≤ print area < right margin
・The position of the right margin is the character width * n (at the time that the right margin
is set) from the left edge.
The character width when specifying the margin includes the settings for specifying
character spacing, character spacing for full-width characters or half-width characters. In
addition, when pitches of 10 cpi (= 30 dots), 12 cpi (= 25 dots), or 15 cpi (= 20 dots),
reduced characters, or double-width characters are specified, that character width is
considered the unit.
However, increases in the character width due to character styles are not applied.
・The horizontal printing position is moved to the left margin position.
・If the right margin setting is not at the beginning of the line, the right margin is set after a
line feed.
The beginning of the line indicates the left margin position for left alignment; for right and
center alignment, it means that no image or character is entered on the line.
・Even if the character width is changed after the right margin is set, the right margin
position does not change.
・Any right margin setting that puts the right margin position to the left of the left margin
position is ignored.
・When setting the right margin, set it at least one column (10 cpi = 30 dots) greater than
the left margin.
(If the character width * n at the time of setting < (left margin + 30 dots), the setting is
ignored.)
・If the dif
character, that character is ignored.
44
ference in the right margin position and the left margin position is less than one
Page 45
・When pro
cpi (= 30 dot) is applied.
・If the print media is continuous length label, the print direction is landscape, and the page
length is not specified, commands specifying the right margin are ignored.
portional pitch is specified with the ESC p command, a character width of 10
45
Page 46
CR Carriage return
[ASCII] CR
[Decimal] 13
[Hexadecimal] 0D
[Parameters] None
[Description]
・Finalizes the input of a line and waits for input of the next line.
・The next print position is the beginning of the next line.
・A line feed command immediately after the carriage return is ignored.
Specifying auto-cancelling double-width characters with SO or ESC SO is cancelled.
・Same processing as LF.
46
Page 47
ESC D Specify horizontal tab position
[ASCII] ESC D [n]k NUL
[Decimal] 27 68 [n]
[Hexadecimal] 1B 44 [n]
k
k
0
00h
[Parameters] 1≤n≤255
0≤k≤32
[Description]
・The position of the horizontal tab is the character width * n (at the time that the
horizontal tab is set) from the left margin.
・Enter n values in ascending order and end the setting with NUL.
・If an n value is smaller than the previous one, the tab setting is finished.
・Even if the character width is changed after the horizontal tab positions are set, those
horizontal tab setting positions do not change.
・ESC D NUL deletes all horizontal tab positions.
・If the left margin is moved, the horizontal tab positions are moved along with it.
・Up to 32 horizontal tab positions can be set. However, horizontal tab positions beyond
the right margin are invalid and only become valid when a change in the right margin
setting or left margin setting moves the print area to those tab positions.
・The character width at the time that the horizontal tabs are set includes the command
settings for specifying character spacing, full-width character spacing, or half-width
character spacing. In addition, when the 10 cpi, 12 cpi, or15 cpi pitch, reduced
characters, or double-width characters are specified, that character width is considered
the unit.
・When proportional pitch is specified with ESC p, horizontal tab positions are set at 10
cpi.
・When the unit is switched on, horizontal tab positions are set every 8 columns at 10 cpi.
Even if the character width is changed before the horizontal tab positions are set, the
horizontal tab positions do not change.
47
Page 48
Left edge Left margin position Tab positionTab position
・
Column
1 2 34 5 678910111213 14 1516
1 2 345678910 11 121314
・
HT code
HT code
Right margin position
・
Unprinted area
Printable area
Example: After the left margin is set to Column 3 and the right
margin to Column 15, horizontal tabs are set at Column 5 and
Column 10, and an HT is performed.
HT Apply horizontal tab
[ASCII] HT
[Decimal] 9
[Hexadecimal] 09
[Parameters] None
[Description]
・Moves the horizontal print position to the nearest horizontal tab position to the right of
the input position.
・If there is no horizontal tab position to the right of the input position or the next
horizontal tab position is beyond the right margin, the HT command is ignored.
・When underlining is specified, no underline is applied between the current position and
Unprinted area
the next horizontal tab position.
・When the unit is switched on, horizontal tab positions are set every 8 columns at 10 cpi.
Even if the character width is changed before the horizontal tab positions are set, the
horizontal tab positions do not change.
・This command is available only with left alignment.
[Example] Specifying horizontal tabs at Column 4, Column 8, and Column 12, and applying
・This returns all commands to their default values. (See the note below.)
Item Default
Input buffer Save
Text buffer Clear
Print buffer Clear
Top margin 0 dot
Bottom margin Depends on media
Left margin 0 dot
Right margin Depends on media
Line feed amount 48 dots
Horizontal tab positions Horizontal tab every 8 characters
Vertical tab positions None
Character size 32 dots
Character spacing 0 dot
Proportional pitch Off
International character set USA
Character style Off
Reduced Off
Horizontal print position Top margin position (TOF position)
Vertical print position Left margin position
Landscape setting Off
Page length setting Off
Cut setting Auto Cut (Manufacturer’s default)
Font Brougham
060DPI60DPI6/300 inch6/300 inch
1120DPI60DPI3/300 inch6/300 inch
2120DPI60DPI3/300 inch6/300 inch
3240DPI60DPI2/300 inch6/300 inch
480DPI60DPI4/300 inch6/300 inch
690DPI60DPI4/300 inch6/300 inch
3260DPI180DPI6/300 inch2/300 inch
33120DPI180DPI3/300 inch2/300 inch
3890DPI180DPI4/300 inch2/300 inch
39180DPI180DPI2/300 inch2/300 inch
40360DPI180DPI1/300 inch2/300 inch
71180DPI360DPI2/300 inch1/300 inch
72360DPI360DPI1/300 inch1/300 inch
73360DPI360DPI1/300 inch1/300 inch
・Horizont
ally neighboring dots are not omitted.
(Limitations) A maximum of 63 can be used with this command.
60
Page 61
When m=0, 1, 2, 3, 4, 6
・n1 and n2 indicate the number of dot positions.
n1: the remainder from dividing the number of dot positions by 256
n2: the quotient from dividing the number of dot positions by 256
B7 B6 B5 B4B3B2B1B0
Relationship between the image data and the dots
・First, the data is lined up in one row as follows:
MSB
1byte
1byte
1byte
1byte
1byte
LSB
…
n1+n2*256 byte
1byte
・One dot of the image data is enlarged as follows according to the value of m.
m=0 m=1 m=2 m=3 m=4 m=6
・As a result, the image is sized depending on the value of m as follows:
m = 0 48 dots vertically x (n1 + n2 *256) * 6 dots horizontally
m = 1 48 dots vertically x (n1 + n2 *256) * 3 dots horizontally
m = 2 48 dots vertically x (n1 + n2 *256) * 3 dots horizontally
m = 3 48 dots vertically x (n1 + n2 *256) * 2 dots horizontally
m = 4 48 dots vertically x (n1 + n2 *256) * 4 dots horizontally
m = 6 48 dots vertically x (n1 + n2 *256) * 4 dots horizontally
61
Page 62
When m = 32, 33, 38, 39, 40
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
・n1 and n2 indicate the number of dot positions.
n1: the remainder from dividing the number of dot positions by 256
n2: the quotient from dividing the number of dot positions by 256
1
B7 B6 B5 B4 B3 B2 B1 B
st
byte 2nd byte 3rd byte
B7B6B5B4B3B2B1B
0
0
. . . . . . . . . .
B7 B6 B5 B4 B3B2B1B
0
......
Relationship between the image data and the dots
・First, the data is lined up in three rows as follows:
MSB
LSB
MSB
LSB
MSB
LSB
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
…
…
…
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
(n1+n2*256)*3 byte
62
Page 63
. One dot of the image dat
a is enlarged as follows according to the value of m.
m = 32
m = 33 m = 38 m = 39 m = 40
・As a result, the image is sized depending on the value of m as follows:
m = 32 48 dots vertically x (n1 + n2 *256) * 6 dots horizontally
m = 33 48 dots vertically x (n1 + n2 *256) * 3 dots horizontally
m = 38 48 dots vertically x (n1 + n2 *256) * 4 dots horizontally
m = 39 48 dots vertically x (n1 + n2 *256) * 2 dots horizontally
m = 40 48 dots vertically x (n1 + n2 *256) * 1 dots horizontally
63
Page 64
When m = 71, 72, 73
・n1 and n2 indicate the number of dot positions.
n1: the remainder from dividing the number of dot positions by 256
n2: the quotient from dividing the number of dot positions by 256
1
B7 B6 B5 B4 B3 B2 B1 B
st
byte 2nd ~ 5thbyte 6th byte
B7B6B5B4B3B2B1B
0
0
. . . . . . . . . .
B7 B6 B5 B4 B3B2B1B
0
......
Relationship between the image data and the dots
64
Page 65
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
y
・First, the dat
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
a is lined up in three rows as follows:
1b
1b
1b
te
te
te
1b
1b
1b
te
te
te
1b
1b
1b
te
te
te
1b
1b
1b
te
te
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
(n1+n2*256)*6 byte
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
…
…
…
…
…
…
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
1b
te
. One dot of the image dat
m = 71
a is enlarged as follows according to the value of m.
m = 72 m = 73
・As a result, the image is sized depending on the value of m as follows:
m = 71 48 dots vertically x (n1 + n2 *256) * 2 dots horizontally
m = 72 48 dots vertically x (n1 + n2 *256) * 1 dots horizontally
m = 73 48 dots vertically x (n1 + n2 *256) * 1 dots horizontally
ESC K 8-dot standard-density bit image
[ASCII] ESC K n1 n2 Data
[Decimal] 27 75 n1 n2 Data
[Hexadecimal] 1B 4B n1 n2 Data
[Parameters] 0≤n1≤255,0≤n2≤3
The data contains n1 + n2 * 256 byte image data.
[Description]
Specifies that an 8-dot standard-density bit image is printed with the number of dot
positions indicated by n1 and n2.
・n1 and n2 indicate the number of dot positions.
65
Page 66
n1: the remainder from dividing the number of dot positions by 256
n2: the quotient from dividing the number of dot positions by 256
B7 B6 B5 B4B3B2B1B0
Relationship between the image data and the dots
・First, the data is lined up in one row as follows:
MSB
1byte
1byte
1byte
1byte
1byte
1byte
LSB
…
n1+n2*256 byte
・One dot of image data is enlarged to 6 dots vertically by 6 dots horizontally.
・As a result, the image is 48 dots vertically by (n1 + n2 *256) * 6 dots horizontally.
66
Page 67
ESC L 8-dot double-density bit image
[ASCII] ESC L n1 n2 Data
[Decimal] 27 76 n1 n2 Data
[Hexadecimal] 1B 4C n1 n2 Data
[Parameters] 0≤n1≤255,0≤n2≤3
The data contains n1 + n2 * 256 byte image data.
[Description]
Specifies that an 8-dot double-density bit image is printed with the number of dot positions
indicated by n1 and n2.
・n1 and n2 are specified in the same way as for ESC K.
・First, the data is lined up in one row as follows:
MSB
1byte
1byte
1byte
1byte
1byte
1byte
LSB
…
n1+n2*256 byte
・One dot of image data is enlarged to 6 dots vertically by 3 dots horizontally.
・As a result, the image is 48 dots vertically by (n1 + n2 *256) * 3 dots horizontally.
67
Page 68
ESC Y 8-dot double-speed double-density bit image
[ASCII] ESC Y n1 n2 Data
[Decimal] 27 89 n1 n2 Data
[Hexadecimal] 1B 59 n1 n2 Data
[Parameters] 0≤n1≤255,0≤n2≤3
The data contains n1 + n2 * 256 byte image data.
[Description]
・Same as for an 8-dot double-density bit image. Horizontally neighboring dots are not
omitted.
ESC Z 8-dot quadruple-density bit image
[ASCII] ESC Z n1 n2 Data
[Decimal] 27 90 n1 n2 Data
[Hexadecimal] 1B 5A n1 n2 Data
[Parameters] 0≤n1≤255,0≤n2≤7
The data contains n1 + n2 * 256 byte image data.
[Description]
Specifies that an 8-dot double-density bit image is printed with the number of dot positions
indicated by n1 and n2.
・n1 and n2 are specified in the same way as for ESC K.
・Horizontally neighboring dots are not omitted.
・First, the data is lined up in one row as follows:
MSB
1byte
1byte
1byte
1byte
1byte
1byte
LSB
…
n1+n2*256 byte
・One dot of image data is enlarged to 6 dots vertically by 2 dots horizontally.
・As a result, the image is 48 dots vertically by (n1 + n2 *256) * 2 dots horizontally.
68
Page 69
Advanced commands
ESC i B Bar code
[ASCII] ESC i [Parameters] B or b [Bar code data] Backslash
Prints 4 dots per cell side.
Prints 5 dots per cell side.
Prints 6 dots per cell side.
Prints 8 dots per cell side.
Prints 10 dots per cell side.
Model 1
Model 2 (default value)
Micro QR
Do not link.
Link. (*1)
Shows the number of the QR code that is linked.
Shows the total number of QR codes linked.
The value of exclusively OR’ing all the print data (print
data before partition) in bytes
High-density level L 7% Standard level M 15% (default value)
High-reliability level Q 25%
Ultra-high-reliability level H 30% (*2)
Auto input (default value)
Manual input
Selects numbers, English alphanumeric
characters, kanji, binaries.
(*1) With Micro QR, the linkage setting is invalid, and the default setting is used.
(*2) With Micro QR, error
correction level 4 is invalid, and the default setting is used.
73
Page 74
Supplement What is the QR code linkage setting?
<>
With QR codes, there are linkage settings.
A long character string can be partitioned into 2 to 16 partitions and printed.
With the ESC/P command, it is necessary to input only the number of partitions.
For example, if the print data is partitioned into 3 partitions, the bar code data is as
follows:
ESC i Q or q [1st parameter] [1st set of bar code data] \\\
ESC i Q or q [2nd parameter] [2nd set of bar code data] \\\
ESC i Q or q [3rd parameter] [3rd set of bar code data] \\\
3. Linkage Setting: This determines whether or not the bar code data is partitioned with
the linkage setting. When not partitioned, input 0.
When not partitioning, the values of 4 (code number), 5 (number of partitions), and 6
(parity data) are ignored; therefore, input 0 as a dummy value for these parameters.
4. Code number: The code number shows which number the ESC/P command for that
QR code is.
For example, if there are four partitions, for the second ESC/P command, this is 2; for
the fourth ESC/P command, this is 4.
5. Number of partitions: For the number of partitions, input the number of existing
partitions.
6. Parity data is the value of exclusively OR’ing all the print data (print data before
partition) in bytes. The same value is input here as for the partitioned QR code
ESC/P command to show that these codes are linked.
What is exclusive OR’ing in bytes?
The data is exclusively OR’ed (XOR’ed) in bytes and in order.
For example, if the character string is put into hexadecimals, this gives 0x31, 0x32,
0x33, 0x34.
XOR of 0x31 and 0x32 0011 0001 ^= 0011 0010 Result: 0000 0011 (0x03)
XOR of 0x03 and 0x33 0000 0011 ^= 0011 0011 Result: 0011 0000 (0x30)
XOR of 0x30 and 0x34 0011 0000 ^= 0011 0100 Result: 0000 0100 (0x04)
Therefore, the parity is 0x04.
Note: If this parity value is incorrect, the correct QR code is not generated.
Summary
Printing the character string "123456789" with a cell size of 4 dots, Model 2, standard
5. Error correction capacity
and value Level input
selection
[Decimal 2 bytes] 0–8
Percentage input selection
[Decimal 2 bytes] 0–400
6. Symbol size X specification
[Decimal 1 byte] 0
[Decimal 1 byte] 1–30
*0 and 1–4 with MicroPDF417
7. Symbol size Y specification
[Decimal 1 byte] 0
[Decimal 1 byte] 3–90
*0 and 4–44 with MicroPDF417
Sets the dot size per cell side.
Prints 3 dots per cell side. (default value)
Prints 4 dots per cell side.
Prints 5 dots per cell side.
Prints 6 dots per cell side.
Prints 8 dots per cell side.
Prints 10 dots per cell side.
Standard (default value)
Truncate
MicroPDF417 standard
MicroPDF417 Code128 emulation
Auto input (default value)
Binary input
Level input setting (default value)
Percentage input setting
Inputs the level. (The default value is 0.)
Inputs the percentage. (The default value is 10.)
Auto setting (default value)
Manual setting
Auto setting (default value)
Manual setting
77
Page 78
8. Aspect
[Decimal 2 bytes] 1–1000
*Notes:
- When the Symbol size X specification or the symbol size specification is input, Aspect
- When the Symbol size X specification or the symbol size specification is input,
- If both large cell size and high level error correction capacity is specified, it may not
[With symbol type MicroPDF417]
- Since the error correction capacity is automatically determined from symbol size X
- The aspect value setting is ignored.
value
value is ignored.
sometimes bar cord is not printed or unreadable barcode is printed.
print because of over print buffer.
specification, the settings for “Error correction capacity and type” and “Error correction
capacity and value” are ignored.
Inputs the aspect value. Actually, this is 0.01–10.0, but
since the decimal point can not be entered, 100x the value
is entered.
The default value is 50. (Actual value of 0.5)
The following table shows the values available for symbol size Y specification according
to symbol size X specification. If an invalid setting is specified for symbol size Y
specification, the default setting is specified.
Symbol size X
specification
AUTO AUTO
1 AUTO 111417202428
2 AUTO 8 111417202326
3 AUTO 6 8 1012152026 32 38 44
4 AUTO 4 6 8 10121520 26 32 3844
2 Bar code data
The numbers of bar code data items that can be input are as follows.
Vertical no. of cells: 104 cells
Vertical no. of cells: 120 cells
Vertical no. of cells: 132 cells
Vertical no. of cells: 144 cells
● ECC200 rectangular
Vertical no. of cells: AUTO (default value)
Vertical no. of cells: 8 cells
Vertical no. of cells: 12 cells
Vertical no. of cells: 16 cells
● ECC200 square
Horizontal no. of cells: Same value as vertical size (x)
● ECC200 rectangular
1 When the vertical size is “AUTO”
Horizontal no. of cells: AUTO (default value)
2 When the vertical size is 8 cells
Horizontal no. of cells: 18 cells
Horizontal no. of cells: 32 cells
3 When the vertical size is 12 cells
Horizontal no. of cells: 26 cells
Horizontal no. of cells: 36 cells
4 When the vertical size is 16 cells
Horizontal no. of cells: 36 cells
Horizontal no. of cells: 48 cells
5 bytes of dummy data (0) is sent.
*Note:
If the vertical size is set to a value other than those listed for ECC200 square, the “AUTO”
setting is selected. If the horizontal size is set to a value different from the vertical size, the
setting is changed to the same value as the horizontal size.
If the vertical or horizontal size for ECC200 rectangular is set to a value other than those
listed, the “AUTO” setting is selected.
② [Bar code dat
The maximum number of bar code data that can be entered is listed below.
2335 alphanumeric characters, 3116 numbers, 1556 bytes of binary data
a]: Bar code data
81
Page 82
*Note:
The numbe
vertical × horizontal cell settings (144 cells × 144 cells). The number of characters that can
be entered may decrease, depending on the specified settings.
③
\\\: End of bar code
There must be three backslashes at the end of 2D bar codes.
Sample input
For data “12345” with symbol type ECC square at 40 × 40 with a 3-dot cell size, the
If the postal code is specified as alphanumeric characters, characters other than
those listed below are invalid.
A~Z “ # $ % & ‘ ( ) * + , - . / 0~9 :
However, lowercase letters (a~z) are converted to the valid uppercase letters (A~Z).
④
\\\: End of bar code
There must be three backslashes at the end of 2D bar codes.
84
Page 85
ESC i F Print downloaded data
[ASCII] ESC i F P n
[Decimal] 27 105 70 80 n
[Hexadecimal] 1B 69 46 50 n
[Parameters]
n :file header index
0≤n≤98
[Description]
・Expands downloaded data in the print buffer as image data.
・Expands downloaded image data from the print position.
・If there is no image data, this command is ignored.
Must be
downloaded
beforehand
Image file
This unit
PC
Abcdefg
ABCDEFG
HIJK
Example: Combination of text and downloaded image
85
Page 86
・As with
text, if the image data does not all fit on the current line, an automatic line feed
is performed, and the data is placed at the beginning of the next line. At that time, the
section exceeding the print area is deleted.
Abcdefg
Abcdefg Abcdefg
1. Enter text.
2. Enter downloaded image
after an automatic line
feed.
Example: Normal size
3. Since the image does not
fit, it is pasted in after an
automatic line feed.
Abc
Abc
Abc
1. Enter text.
2. Enter downloaded
image.
Example: Larger than distance between left and right margins
86
3. Since the image does not
fit, it is pasted in after an
automatic line feed and
trimmed to fit between the
left and right margins.
Page 87
the result of pasting in the downloaded image exceeds the bottom margin position, it
pag
・If
is pasted in after a page feed. However, if the downloaded image is larger than the
entire area between the top and bottom margins, the entire image is ignored.
Abcdefg
WLMBGOr
Dabfdifpdzra
BGHJgmfg
gfdslrt
Abcdefg
WLMBGOr
Dabfdifpdzra
BGHJgmfg
gfdslrt
Abcdefg
1. Enter text.
2. Enter downloaded
image.
3. Since the image does
not fit, it is pasted in
after an automatic
e feed.
Example: Data is smaller than the distance between the top and bottom margins
Abcdefg
WLMBGOr
Dabfdifpdzra
Abcdefg
WLMBGOr
Dabfdifpdzra
Abcdefg
WLMBGOr
Dabfdifpdzra
1. Enter text.
2. Enter downloaded
image.
3. The entire image is
ignored.
Example: Data is larger than the distance between top and bottom margins
87
Page 88
・There
are limits on the amount of image data that can be stored in the main unit. The
size of the storage area is 2048 KB. However, bitmap data is not stored as is, but is
converted into the main unit storage format by the transfer manager.
・Image data larger than the media size is handled by deleting the portion of the image
that does not fit into the size of the media.
The portion of image data deleted depends on the media orientation.
Examples
Portrait (media: die-cut shipping)
Size of downloaded image Print size
1109 vertical x 696 horizontal -> 1109 vertical x 696 horizontal (No deletion)
696 vertical x 1109 horizontal -> 696 vertical x 696 horizontal (Part deleted)
With downloaded image saved as 696 vertical
by 1109 horizontal
Portion not used
Portion used
Landscape (media: die-cut shipping)
Size of downloaded image Print size
696 vertical x 1109 horizontal -> 1109 vertical x 696 horizontal (No deletion)
1109 vertical x 696 horizontal -> 696 vertical x 696 horizontal (Part deleted)
With downloaded image saved as 1109 vertical by
696 horizontal
Portion used
Portion not used
88
Page 89
ESC i a Switch command mode
[ASCII] ESC i a n
[Decimal] 27 105 97 n
[Hexadecimal] 1B 69 61 n
[Parameters]
n :Command mode
0 or 48 = ESC/P standard mode
1 or 49 = Raster graphics
3 or 51 = P-touch Template mode
[Description]
・Sets the command mode to ESC/P, P-touch Template and PTCBP (raster graphics).
・These three modes can be switched dynamically.
・Since this is a dynamic command, after the unit is turned off and on again, the setting
returns to the previously set value.
89
Page 90
ESC i S Request printer status
[ASCII] ESC i S
[Decimal] 27 105 83
[Hexadecimal] 1B 69 53
[Parameters] None
[Description]
・Requests the printer status.
The printer status comprises 32 bytes.
Order Of
10 9 1 Error information 2 See below.
11 10 1 Media width See Page 9 Print Area.
12 11 1 Media type See below.
13 12 1 Number of colors Fixed to 00H
14 13 1 Media length
15 14 1 Media sensor value See Page 9 Print Area.
16 15 1 Mode Fixed to 00H
17 16 1 Density Fixed to 00H
18 17 1 Media length
19 18 1 Status type See below.
20 19 1 Phase type Fixed to 00H
21 20 1 Phase number
22 21 1 Phase number
23 22 1 Notification number Not used
24 23 1 Expansion section
25 24 8 Reservation Fixed to 00H
fset Size Name Value/Standard
1 0 1 Head mark Fixed to 80H
2 1 1 Size Fixed to 20H
3 2 1 Brother code Fixed to "B" (42H)
4 3 1 Series code Fixed to "5" (35H)
5 4 1 Model code TD-4000: Fixed to "1" (31H)
TD-4100N: Fixed to "2" (32H)
6 5 1 Country code Fixed to "0" (30H)
7 6 1 Main unit information Fixed to 00H
8 7 1 Reservation Fixed to 00H
9 8 1 Error information 1 See below.
See Page 9 Print Area.
(upper byte)
See Page 9 Print Area.
(lower byte)
Fixed to 00H
(upper byte)
Fixed to 00H
(lower byte)
Fixed to 00H
(number of bytes)
90
Page 91
Error informa
Bit 0 0x01 No media error
Bit 1 0x02 Media end error
Bit 2 0x04 Cutter jam error
Bit 3 0x08 Not used
Bit 4 0x10 Main unit in use
Bit 5 0x20 Power Off
Bit 6 0x40 Not used
Bit 7 0x80 Fan motor error
Error information 2
Bit 0 0x01 Media change error
Bit 1 0x02 Buffer full error
Bit 2 0x04 Communication error
Bit 3 0x08 Image generation error
Bit 4 0x10 Cover open error
Bit 5 0x20 Not used
Bit 6 0x40 Leading edge detection error
Bit 7 0x80 System error
tion 1
Flag Mask Meaning
Flag Mask Meaning
Media type
Media type Value Remarks
Continuous length label
Die-cut label
Status type
Status type Value
Reply to status request 00H
(Not used) 01H
Error generation 02H
(Not used) 03H - FFH
4AH
4BH
91
Page 92
ESC i L Select landscape orientation
[ASCII] ESC i L n
[Decimal] 27 105 76 n
[Hexadecimal] 1B 69 4C n
[Parameters] n=0, 1 or 48, 49
[Description]
・Specifies and cancels the landscape orientation
・When n = 1 or 49 ("1"), the landscape orientation is specified.
・When n = 0 or 48 ("0"), the landscape orientation is cancelled.
・When this command is executed, all text is cleared.
・Set the paper orientation with this command before creating text.
・When the unit is turned on, landscape orientation is off.
ABC
ABC
92
Page 93
ESC i C Specify cutting
[ASCII] ESC i C n
[Decimal] 27 105 67 n
[Hexadecimal] 1B 69 43 n
[Parameters] n=0,1 or 48,49
[Description]
・Specifies the cutting after printing.
・When n = 1 or 49 ("1"), cutting is specified.
・When n = 0 or 48 ("0"), cutting is cancelled.
・The default auto cut setting can be changed with the P-touch Template Settings Tool
(P-touch Template Settings.exe).
・The number of auto cut copies can be specified with the P-touch Template Settings Tool
・Selects the default character style. n3=00h: Cancel (normal characters)*Manufacturer’s defaultn3=01h: Boldn3=02h: Outlinen3=03h: Shadown3=04h: Shadow and outline
・This command is a static command.
[Remarks]
・Invalid if n3 is a value other than 00h through 04h