TM-T20II ESC/POS Quick Reference
TM-T20II ESC/POS Quick Reference
TM-T20II ESC/POS Quick Reference
In page mode, these commands only move the print position and do not
execute actual printing.
ESC ? n
LF
CR
ESC t n
ESC J n
ESC d n
Command Notation
RT : real-time command (executed as soon as received)
fn= : function number of the command
Numbers are written in decimal numeral.
n specifies 1 byte parameter in the range 0255.
nL, nH specify 1 word (2 bytes) parameter as (nL+ n256) in the range
065,535.
pL, pH specify the number of parameters after pH as (pL+pH256) in the range
165,535
p1, p2, p3, p4 specify the number of parameters after p4 as
(p1+p2256+p365,536+p416,777,216) in the range 14,294,967,295.
kc1, kc2 specify key code (2 bytes) of NV graphics or download graphics. Each
range of kc1 and kc2 is 32126.
Control codes are as follows:
name code
NUL 0
EOT 4
ENQ 5
HT 9
LF 10
FF 12
CR 13
DLE 16
DC4 20
CAN 24
ESC 27
FS 28
GS 29
No part of this document may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the
prior written permission of Seiko Epson Corporation.
The contents of this document are subject to change without notice. Please contact us for the latest
information.
While every precaution has been taken in the preparation of this document, Seiko Epson
Corporation assumes no responsibility for errors or omissions.
Neither is any liability assumed for damages resulting from the use of the information contained
herein.
Neither Seiko Epson Corporation nor its affiliates shall be liable to the purchaser of this product
or third parties for damages, losses, costs, or expenses incurred by the purchaser or third parties
as a result of: accident, misuse, or abuse of this product or unauthorized modifications, repairs,
or alterations to this product, or (excluding the U.S.) failure to strictly comply with Seiko Epson
Corporation's operating and maintenance instructions.
Seiko Epson Corporation shall not be liable against any damages or problems arising from the use of
any options or any consumable products other than those designated as Original EPSON Products
or EPSON Approved Products by Seiko Epson Corporation.
EPSON and ESC/POS are registered trademarks of Seiko Epson Corporation in Japan and other
countries/regions.
M00068700
Copyright 2013 Seiko Epson Corporation. All rights reserved.
Character Commands
ESC SP n
ESC n
ESC E n
ESC G n
ESC M n
GS ! n
GS b n
GS B n
ESC { n
ESC R n
n
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
255
code table
PC855: Cyrillic
PC861: Icelandic
PC862: Hebrew
PC864: Arabic
PC869: Greek
ISO8859-2: Latin2
ISO8859-15: Latin9
PC1098: Farsi
PC1118: Lithuanian
PC1119: Lithuanian
PC1125: Ukrainian
WPC1250: Latin2
WPC1251: Cyrillic
WPC1253: Greek
WPC1254: Turkish
WPC1255: Hebrew
WPC1256: Arabic
WPC1257: Baltic Rim
WPC1258: Vietnamese
KZ-1048: Kazakhstan
User-defined page
n country
9 Norway
10 Denmark II
11 Spain II
12 Latin America
13 Korea
14 Slovenia/ Croatia
15 China
16 Vietnam
17 Arabia
ESC % n
n code table
0 PC437: USA, Standard Europe
1 Katakana
2 PC850: Multilingual
3 PC860: Portuguese
4 PC863: Canadian-French
5 PC865: Nordic
11 PC851: Greek
12 PC853: Turkish
13 PC857: Turkish
14 PC737: Greek
15 ISO8859-7: Greek
16 WPC1252
17 PC866: Cyrillic #2
18 PC852: Latin2
19 PC858: Euro
20 KU42: Thai
21 TIS11: Thai
26 TIS18: Thai
30 TCVN-3: Vietnamese
31 TCVN-3: Vietnamese
32 PC720: Arabic
33 WPC775: Baltic Rim
ESC V n
GS L nL nH
GS W nL nH
ESC a n
NV Graphics Commands
ESC $ nL nH Moves print position from the left edge of print area.
nL + nH256: absolute print position
ESC \ nL nH
GS V m
GS V m n
m = "A" or "B"
fn=51
Transmits the unused capacity of NV graphics area.
Send data: "71" + Size + NUL
Size: "0""99999999" [bytes]
GS ( L 4 0 48 64 "KC"
fn=64
Transmits the key code list for defined NV graphics.
ESC m nL nH d1...dk
203/2 dpi
203 dpi
203/2 dpi
203 dpi
8 dots
number of d
(= k)
nL + nH256
GS ( L 5 0 48 65 "CLR"
fn=65
fn=66
fn=112
GS ( L pL pH 48 112 48 bx by 49 xL xH yL yH d1...dk or
GS 8 L p1 p2 p3 p4 48 112 48 bx by 49 xL xH yL yH d1...dk
fn=83
Converts Windows BMP data and defines download
graphics data to key code (kc1, kc2).
GS ( L pL pH 48 83 48 kc1 kc2 1 xL xH yL yH 49 d1...dk or fn=83
bx = 1 or 2: horizontal magnification
by = 1 or 2: vertical magnification
xL + xH256: number of horizontal dots
yL + yH256: number of vertical dots
GS ( L 2 0 48 50 or GS ( L 2 0 48 2
Prints graphics data in standard mode.
GS ( L 6 0 48 85 kc1 kc2 x y
fn=50
fn=81
fn=62
FS ( E 5 0 63 2 kc1 kc2 a
fn=63
fn=64
function
Prints while feeding paper to cut position
Prints at power-on
Prints when Roll paper cover is closed
Prints when buffers are cleared in recovery from error
Prints after fed paper with Feed button
GS ( L 5 0 48 81 "CLR"
GS ( L 4 0 48 66 kc1 kc2
FS ( E 6 0 62 2 kc1 kc2 a n
GS ( L 2 0 48 51 or GS ( L 2 0 48 3
33
fn=48
m = 0, "0", 1, "1"
fn=80
Transmits the key code list for download graphics.
x = 1 or 2: horizontal magnification
y = 1 or 2: vertical magnification
GS ( L 2 0 48 48 or GS ( L 2 0 48 0
GS ( L 4 0 48 80 "KC"
GS ( L 4 0 48 82 kc1 kc2
fn=69
32
fn=67
Converts Windows BMP data and defines NV graphics
data to key code (kc1, kc2).
GS ( L pL pH 48 67 48 kc1 kc2 1 xL xH yL yH 49 d1...dk or fn=67
GS 8 L p1 p2 p3 p4 48 67 48 kc1 kc2 1 xL xH yL yH 49 d1...dk
Defines NV graphics data to key code (kc1, kc2).
GS ( L 6 0 48 69 kc1 kc2 x y
fn=85
Prints download graphics of key code (kc1, kc2) to the
magnified size specified by x, y.
x = 1 or 2: horizontal magnification
y = 1 or 2: vertical magnification
GS ( L 2 0 48 52 or GS ( L 2 0 48 4
fn=52
Transmits the unused capacity of download graphics area.
Send data: "72" + Size + NUL
Size: "0""99999999" [bytes]
FS ( E 4 0 65 2 a n
fn=65
n = "0": Enable
n = "1": Disable
FS ( E 3 0 61 2 c
fn=61
Transmits set values for top or bottom logo printing.
c = "0": Set values for top logo
c = "1": Set values for bottom logo
c = "2": Extended set values for top logo
c
"0"
"1"
"2"
send data
"7H202" + kc1 + kc2 + pos + line + NUL
"7H212" + kc1 + kc2 + pos + NUL
"7H222" + fa + fp + fc + fe + ff + NUL
FS ( E 6 0 60 2 c "CLR"
fn=60
Clears set values in NV memory for top or bottom logo
printing.
c = "0": Top logo, c = "1": Bottom logo
number of d (=k)
11 or 12
6, 7, 8, 11 or 12
12 or 13
7 or 8
1 or more
even
2 or more
GS k m n d1...dn
fn
function
Store symbol data in
memory
number of d (=k)
11 or 12
6, 7, 8, 11 or 12
12 or 13
7 or 8
1 or more
even
2 or more
1255
2255
2255
13
13
13
2255
GS h n
GS w n
GS H n
GS f n
Id
X: horizontal dots
Y: vertical dots
Fl: flag
Ec: error code
nL nH
nL nH
GS a n
72
1
15
15
1
0 or 4
48
"/"
cn
51
52
"O"
"P"
"0""99999"
"0""99999"
"0" = printable, "1" = not printable
N/A (0 byte)
"0000""9999"
49
"6"
50
"7"
RT
Transmits real-time status as 1 byte.
n = 1: Printer status (binary: 0000xx00)
bit 2 = 1: Drawer kick-out connector pin 3: High
= 0: Drawer kick-out connector pin 3: Low
bit 3 = 1: in Offline, 0: in Online
n = 2: Offline cause status (0xx0xx00)
bit 2 = 1: Cover is open, 0: closed
bit 3 = 1: on feeding paper by switch, 0: not
bit 5 = 1: Printing stopped due to paper end, 0: not
bit 6 = 1: in Error state, 0: not
n = 3: Error cause status (0xx0x000)
bit 3 = 1: Autocutter error, 0: not
bit 5 = 1: Unrecoverable error, 0: not
bit 6 = 1: Automatically recoverable error, 0: not
cn = 48: PDF417
49: QR Code
50: MaxiCode
51: 2-dimensional GS1 DataBar
52: composite symbology
52
m a b d1...dk
DLE EOT n
n1 n2
51
m n d1...dk
(m=48)
m (m=48)
m (m=48)
repeat times
interval time (100msec)
repeat continuously
repeat by pressing the Feed button
Status Commands
GS ( k pL pH cn fn [parameters]
n
n
n
n
mn
m
71
number
of bytes
n = 26 (thinthick)
81
82
65
66
67
68
69
70
49
50
m d1...dk
cn
48
80
Print 2D symbol
Send 2D symbol size
Setting columns
rows
module
row height
error correction
options
maximum
width
font
GS r n
Miscellaneous Commands
ESC @
DLE ENQ n
Initializes printer.
RT
Recovers from recoverable errors.
n = 1: Recovers and starts printing from the line where the error
occurred
n = 2: Recovers after clearing both receive and print buffers
ESC = n
b = 0, "0": Disable
b = 1, "1": Enable
n = 0: Disable
DLE DC4 1 m t
fn=1
RT
Outputs pulse to Drawer kick-out port in real-time.
m = 0: connector pin 2, m = 1: connector pin 5
t = 18: On time / Off time (100 ms)
GS ( H 6 0 48 48 d1 d2 d3 d4
fn=48
Transmits process ID specified by (d1, d2, d3, d4) after
execution of prior print or command.
d=32126: visible character
Send data: 55 + 34 + d1 + d2 + d3 + d4 + NUL
GS I n
GS ( K 2 0 50 m
information
ESC ( A 3 0 97 n c
n specifies the sound pattern. (n = 17)
c specifies the repeat times. (c = 0: infinitely)
send data
66
99
3: supported Multi-byte character
2: not supported
Column emulation "=#0"+NUL: normal mode
mode
"=#1"+NUL: 42 column mode
95+strings+NUL
Firmware version
depends on firmware
Manufacturer
95+"EPSON"+NUL
67
Printer name
95+"TM-T20II"+NUL
68
Serial number
69
Type of mounted
additional fonts
2, "2" Type ID
65
fn=97
35
fn=50
Other Commands
DLE DC4 3 0 0 0 1 0
fn=3
RT
Stops sounding optional external buzzer and
transmits 4 bytes: 55, 84, 64, 0.
fn=2
RT
DLE DC4 2 1 8
Executes printer power-off sequence and transmits 3
bytes: 59, 48, 0.
fn=8
RT
DLE DC4 8 1 3 20 1 6 2 8
Clears both receive and print buffers, and transmits 3
bytes: 55, 37, 0, as the Clear response.
GS g 0 0 nL nH
Initialize resettable maintenance counter.
nL + nH256
counter
unit
20
lines
21
times
22
50
times
70
hours
GS g 2 0 nL nH
Transmits value of resettable or cumulative
maintenance counter.
counter
Number of lines fed
unit
nL + nH256
hours
20
148
21
149
22
150
50
178
70
198
GS ( K 2 0 48 m
Selects print control mode.
m = 1, "1": standard
m = 2, "2": best for fence barcode
m = 3, "3": best for ladder barcode
m = 4, "4": best for 2-dimensional code
ESC L
ESC S
FF
resettable cumulative
lines
Page mode is a free layout mode. Any print data can be put in any place on the
print area and be printed by FF or ESC FF command.
fn=48
ESC T n
GS $ nL nH
print direction
left to right
bottom to top
right to left
top to bottom
starting position
upper left
lower left
lower right
upper right
GS \ nL nH
CAN
Character Commands
Selects character font and styles.
ESC !
Miscellaneous Commands
Sets horizontal and vertical motion units.
GS P
Executes test print.
GS ( A
Bit Image Commands
Prints raster bit image
GS v 0
OC
OC
FS p
OC
OC
GS /
OC
Status Commands
Transmits peripheral device status as 1 byte.
ESC u
OC
ESC v
OC
OC
ESC m
OC
Customize Commands
Writes data to NV user memory.
FS g 1
OC
FS g 2
OC
change notice.
Ends User setting mode and performs software
reset.
Sets memory switch setting values.
Transmits memory switch setting values.
Sets customized setting values.
Transmits customized setting value.
Sets configuration item for serial interface.
Transmits configuration value.
Selects configuration item: Class of USB interface.
Transmits configuration value for Class of USB
interface.