Star TSP 600 700 800 Programmers Manual
Star TSP 600 700 800 Programmers Manual
TSP600 Series
TSP700 Series
TSP800 Series
Programmer’s Manual
Notice
• All rights reserved. Reproduction of any part of this manual in any form whatsoever,
without STAR’s express permission is forbidden.
• The contents of this manual are subject to change without notice.
• All efforts have been made to ensure the accuracy of the contents of this manual at the time
of going to press. However, should any errors be detected, STAR would greatly appreciate
being informed of them.
• The above notwithstanding, STAR can assume no responsibility for any errors in this
manual.
©
Copyright 2000 Star Micronics Co., LTD.
TABLE OF CONTENTS
1. OUTLINE ............................................................................................ 1
2. STAR LINE MODE ............................................................................ 2
2-1. Command Summary .................................................................... 2
2-2. Command Specification ............................................................... 6
3. STAR PAGE MODE (TSP800 Only) ............................................... 46
3-1. Command Summary .................................................................. 46
3-2. Command Specification ............................................................. 48
4. DP8340 MODE (TSP800 Only) ....................................................... 69
4-1. Command Summary .................................................................. 69
4-2. Command Specification ............................................................. 70
DIP Switch #1
1-1 Mode Selection
ON STAR Line mode
OFF ESC/POS mode
For the detailed functions and settings of the DIP switches, please refer to the
User's Manual.
DIP Switch #1
1-1 1-2 Mode Selection
ON ON STAR Line mode
OFF ON STAR Page mode
ON OFF DP8340 mode
For the detailed functions and settings of the DIP switches, please refer to the
User's Manual.
–1–
2. STAR LINE MODE
2-1. Command Summary
The details of each command are shown in the following sections.
Commands to Select Characters
Hexadecimal
Control codes Function Page
codes
<ESC> “R” n 1B 52 n Select international character set 6
<ESC> “/” “1” 1B 2F 31 6
Select slash zero
LINE MODE
–2–
Hexadecimal
Control codes Function Page
codes
<ESC> “4” 1B 34 Select highlight printing 14
<ESC> “5” 1B 35 Cancel highlight printing 14
<SI> 0F Inverted printing 14
<DC2> 12 Cancel inverted printing 14
<ESC> “E” 1B 45 Select emphasized printing 15
<ESC> “F” 1B 46 Cancel emphasized printing 15
<ESC><GS> “t” n 1B 1D 74 n Select character code table 15
LINE MODE
Hexadecimal
Control codes Function Page
codes
<ESC> “C” n 1B 43 n Set page length in lines 16
<ESC> “C” <0> n 1B 43 00 n Set page length in inches 16
<ESC> “N” n 1B 4E n Set bottom margin 16
<ESC> “O” 1B 4F Cancel bottom margin 17
<ESC> “l” n 1B 6C n Set left margin 17
<ESC> “Q” n 1B 51 n Set right margin 17
–3–
Commands to Print Dot Graphics
Hexadecimal
Control codes Function Page
codes
<ESC> “K” n <0> 1B 4B n 00 m1 m2 23
Print normal density graphics
m1 m2 ... ...
<ESC> “L” n1 n2 1B 4C n1 n2 m1 m2 25
Print high density graphics
m1 m2 ... ...
<ESC> “k” n <0> d1 ... 1B 6B n 00 d1 ... Print fine density graphics 26
<ESC> “X” n1 n2 d1 ... 1B 58 n1 n2 d1 ... Print fine density graphics 29
<ESC> <FS> “q” n 1B 1C 71 n 30
Define logo data
[x11 x12 y11 y12 d [k1]]1 ... [x11 x12 y11 y12 d [k1]]1 ...
<ESC> <FS>“p” n m 1B 1C 70 n m Print logo image 32
LINE MODE
–4–
Other Commands
Hexadecimal
Control codes Function Page
codes
<CAN> 18 Cancel last line & Initialize printer 37
<ESC> <GS> “# m N n1 1B 1D 23 m N n1 37
Set memory switch
n2 n3 n4 ”<LF> <NUL> n2 n3 n4 0A 00
<ESC> “@” 1B 40 Initialize printer 41
<ENQ> 05 Request status 41
<EOT> 04 Request status 42
<ESC> <ACK> <SOH> 1B 06 01 Request status 42
<ESC> <RS> “a” n 1B 1E 61 n Set status transmission condition 45
LINE MODE
<ESC> “?” <LF> <NUL> 1B 3F 0A 00 Reset printer hardware 45
–5–
2-2. Command Specification
Commands to Select Characters
FUNCTION Select international character set
CODE <ESC> “R” n
HEX 1B 52 n
REMARKS Selects an international character set according to the value of n,
as shown below:
n Character set n Character set
0 U.S.A. 8 Japan
LINE MODE
1 France 9 Norway
2 Germany 10 Denmark II
3 England 11 Spain II
4 Denmark I 12 Latin America
5 Sweden 13 Korea
6 Italy 14 Ireland
7 Spain I 64 Legal
–6–
FUNCTION Select bar code printing
CODE <ESC> “b” n1 n2 n3 n4 di ... dk <RS>
HEX 1B 62 n1 n2 n3 n4 di ... dk 1E
REMARKS Prints bar code according to the value of n1, as shown below:
n1: Type of bar code
0 UPC-E
1 UPC-A
2 JAN/EAN-8
3 JAN/EAN-13
4 CODE 39
LINE MODE
5 ITF
6 CODE 128
7 CODE 93
8 NW-7
The value of n1 can be set to 0(00H) or 8(08H) to “0”(30H) to
“8”(38H).
–7–
CODE 39, NW-7, ITF
CODE 39, NW-7 ITF
1 Narrow : wide 2:6 dots 2:5 dots
2 Narrow : wide 3:9 dots 4:10 dots
3 Narrow : wide 4:12 dots 6:15 dots
4 Narrow : wide 2:5 dots 2:4 dots
5 Narrow : wide 3:8 dots 4:8 dots
6 Narrow : wide 4:10 dots 6:12 dots
7 Narrow : wide 2:4 dots 2:6 dots
8 Narrow : wide 3:6 dots 3:9 dots
9 Narrow : wide 4:8 dots 4:12 dots
LINE MODE
JAN/EAN-8: k = 7 (or 8)
The check digit at the 8th digit is automatically added,
and ignored even if it is specified.
LINE MODE
The check character is automatically added.
The bar code printing start position is at the upper end of the
current line.
If the bar code is positioned beyond the right margin, neither
the bar code nor the character below the bar code will be
printed.
–9–
Express “% (25H)” as “%0 (25H30H)”.
Add “40H - 5FH” after “%” for the control codes (00H - 1FH).
Express the control code (7FH) as “%5(25H35H)”.
Add “1 - 4 (31H - 34H)” after “%” for the function code.
Add “6 - 8 (36H - 38H)” after “%” for the start code.
3) 2-character codes
Control codes Special code
CODE FORMAT CODE FORMAT
NUL 00H %@ 25H 40H % 25H %0 25H 30H
SOH 01H %A 25H 41H
LINE MODE
– 10 –
FUNCTION Select 12-dot pitch printing
CODE <ESC> “M”
HEX 1B 4D
REMARKS Prints 12-dot pitch characters without an extra space.
LINE MODE
ters.
– 11 –
FUNCTION Sets the printing magnified double in character width.
CODE <SO>
HEX 0E
REMARKS Prints the subsequent data including a character spacing set by
<ESC><SP> n, magnified double in character width.
LINE MODE
FUNCTION Sets the magnification rates in character width and height.
CODE <ESC> “i” n1 n2
HEX 1B 69 n1 n2
REMARKS Prints the subsequent data in the size specified by n1, n2.
n1 indicates the height magnification and n2 indicates the width
magnification.
n1 (n2) = 0 Normal height (or width) size.
1 Double height (or width) size.
2 Triple height (or width) size.
3 Quadruple height (or width) size.
4 Quintuple height (or width) size.
5 Sextuple height (or width) size.
The values of n1, n2 are 0(00H) to 5(05H) or “0”(30H)” to
“5”(35H).
FUNCTION Underlining
CODE <ESC> “–” n
HEX 1B 2D n
REMARKS When the value of n is 1, underlines the subsequent data including
a character spacing set by <ESC><SP> n.
The part to be skipped by the horizontal tab setting and the block
graphic characters are not underlined.
Resets the underline mode when the value of n is 0.
The value of n can be set to 0(00H) or “0”(30H), or 1(01H) or
“1”(31H).
– 13 –
FUNCTION Upperlining
CODE <ESC> “_” n
HEX 1B 5F n
REMARKS When the value of n is 1, upperlines the subsequent data including
a character spacing set by <ESC><SP> n.
The part to be skipped by the horizontal tab setting and the block
graphic characters are not upperlined.
Resets the upperline mode when the value of n is 0.
The value of n can be set to 0(00H) or “0”(30H), or 1(01H) or
“1”(31H).
LINE MODE
– 14 –
FUNCTION Select emphasized printing
CODE <ESC> “E”
HEX 1B 45
REMARKS Causes subsequent characters to be emphasized.
LINE MODE
REMARKS Cancels emphasized printing.
– 15 –
Commands to Set the Page Format
FUNCTION Set page length in lines
CODE <ESC> “C” n
HEX 1B 43 n
REMARKS Sets the page length using the current line spacing, where n is
between 1 and 127.
Changing the line spacing later does not alter the physical page
length.
The current line becomes the top of the page.
Resets the bottom margin.
LINE MODE
– 16 –
FUNCTION Cancel bottom margin
CODE <ESC> “O”
HEX 1B 4F
REMARKS Cancels the bottom margin.
Invalid when start position detect is ON.
LINE MODE
HEX 1B 6C n
REMARKS Sets the left margin at column n (where n is between 0 and 255) at
the current character pitch.
The left margin does not move if the character pitch is changed
later.
Setting is invalid if the printing area for one line would be 36mm
or less.
– 17 –
Commands to Move the Print Position
FUNCTION Line feed
CODE <LF>
HEX 0A
REMARKS Prints the current line and feeds the paper to the next line.
If there is no data to print, only line feed is performed.
HEX 0D
REMARKS Prints the current line and feeds the paper to the next line.
This command is ignored when CR code is invalid.
– 18 –
FUNCTION Vertical tab
CODE <VT>
HEX 0B
REMARKS When start position detect is invalid, feeds the paper to the next
vertical tab stop and moves the print position to the left margin.
If no vertical tabs are set, this command is ignored.
Performs a line feed if the current line is at or below the last vertical
tab stop.
This command is ignored when start position detect is valid.
LINE MODE
FUNCTION Set line spacing to 4 mm
CODE <ESC> “z” “1” or <ESC> “z” <1>
HEX 1B 7A 31 or 1B 7A 01
REMARKS Sets the distance the paper advances in subsequent line feeds to
4 mm.
– 19 –
FUNCTION One time n/8 mm feed
CODE <ESC> “I” n
HEX 1B 49 n
REMARKS Performs a line feed n/8mm once only.
The value of n is 1 to 255.
Space setting for lines is not changed.
REMARKS Cancels all current vertical tab stops and sets new vertical tab stops
at lines n1, n2, etc., where n1, n2, etc. are numbers between 1 and
255. A maximum of 16 vertical tab stops can be set.
The tab stops must be specified in ascending order; any violation
of ascending order terminates the tab stop list. Standard termina-
tion is by the <0> control code.
The vertical tab stops are set in terms of the current line spacing and
do not move if the line spacing is changed later.
Invalid when start position detect is valid.
<ESC> "B" <0> cancels all vertical tab.
– 20 –
FUNCTION Absolute position setting
CODE <ESC> <GS> “A” n1 n2
HEX 1B 1D 41 n1 n2
REMARKS Sets the absolute position based on the left margin position for
starting the next printing.
0 n1, n2 255
The start of the next printing is the (n1 + n2 × 256 dot) position from
the left margin position.
Settings that exceed the print area are ignored.
LINE MODE
FUNCTION
CODE <ESC> <GS> “R” n1 n2
HEX 1B 1D 52 n1 n2
REMARKS Sets the relative position based on the current position for starting
the next printing.
0 n1, n2 255
The start of the next printing is the (n1 + n2 × 256 dot) position from
the current position.
1. Settings that exceed the printing area are ignored.
2. When set in the right direction from the current position with
regard to the character direction, this specifies positive inte-
gers and when set in the left direction, this specifies negative
integers.
3. Negative integers are shown with the compliment 65536.
For example, if moving N pitches in the left direction:
n1 + n2 × 256 = 65536 – N.
– 21 –
FUNCTION Alignment
CODE <ESC> <GS> “a” n
HEX 1B 1D 61 n
REMARKS Lines up all print data in one line to the specified position.
Alignment positions are shown below.
n Alignment Position
0 Left
1 Center
2 Right
LINE MODE
ABC
ABCD
ABCDE
} ESC GS a 0
ESC GS a 1
{ ABC
ABCD
ABCDE
ESC GS a 2
{ ABC
ABCD
ABCDE
– 22 –
Commands to Print Dot Graphics
FUNCTION Print normal density graphics
CODE <ESC> “K” n1 n2 d1...dk [k = n1+ n2 × 256]
HEX 1B 4B n1 n2 d1...dk [k = n1+ n2 × 256]
Prints normal density dot graphics. The graphics image is 24 dots
high and (n1+n2 × 256 ) × 3 dots wide.
d1, d2, ... are the dot data, each a 1-byte value from 0 to 255
representing 24 vertical dots, with the most significant bit repre-
senting the top three and the least significant bit representing the
bottom three.
LINE MODE
<Print area>
104mm (TSP800) :1 n1 + n2 × 256 277
72mm (TSP600/700) :1 n1 + n2 × 256 192
52.5mm (TSP700) :1 n1 + n2 × 256 140
80mm (TSP700) :1 n1 + n2 × 256 213
50.8mm (TSP600/700) :1 n1 + n2 × 256 135
Dots beyond the right margin are ignored.
DOT Position D8 D7 D6 D5 D4 D3 D2 D1
1 2 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
– 23 –
EXAMPLE We will create the design below using a bit image.
d1 d2 d3 d4 d5 d 6 d 7 d 8 d 9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30
D8
D7
D6
D5
D4
D3
D2
D1
First, since the volume of data is 30, n1 = (1E)H. If the data d1 ~ d30
is converted to hexadecimal, it appears as shown below.
Hexa- Hexa- Hexa-
LINE MODE
Printing Sample
– 24 –
FUNCTION Print high density graphics
CODE <ESC> “L” n1 n2 d1...dk [k = n1+ n2 × 256]
HEX 1B 4C n1 n2 d1...dk [k = n1+ n2 × 256]
REMARKS Prints high density dot graphics. The graphics image is 24 dots
high and n1 + n2 × 256 dots wide.
d1, d2, ... are the dot data, each a 1-byte value from 0 to 255
representing 24 vertical dots, with the most significant bit repre-
senting the top three and the least significant bit representing the
bottom three.
The number of data bytes must be n1 + n2 × 256.
<Print area>
LINE MODE
104mm (TSP800) :1 n1 + n2 × 256 832
72mm (TSP600/700) :1 n1 + n2 × 256 576
52.5mm (TSP700) :1 n1 + n2 × 256 420
80mm (TSP700) :1 n1 + n2 × 256 640
50.8mm (TSP600/700) :1 n1 + n2 × 256 406
Dots beyond the right margin are ignored.
DOT Position D8 D7 D6 D5 D4 D3 D2 D1
1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
– 25 –
EXAMPLE We will create the design below using a bit image.
d1 d2 d3 d4 d5 d 6 d 7 d 8 d 9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30
D8
D7
D6
D5
D4
D3
D2
D1
First, since the volume of data is 30, n1 = (1E)H. If the data d1 ~ d30
is converted to hexadecimal, it appears as shown below.
Hexa- Hexa- Hexa-
Data Binary decimal Data Binary decimal Data Binary decimal
LINE MODE
Printing Sample
Dot position
d1 d2 dn
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
dn+1 dn+2 d2n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d2n+1 d2n+2 d3n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d3n+1 d3n+2 d4n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
LINE MODE
d4n+1 d4n+2 d5n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d5n+1 d5n+2 d6n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d6n+1 d6n+2 d7n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d7n+1 d7n+2 d8n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d8n+1 d8n+2 d9n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d9n+1 d9n+2 d10n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d10n+1 d10n+2 d11n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d11n+1 d11n+2 d12n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d12n+1 d12n+2 d13n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d13n+1 d13n+2 d14n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d14n+1 d14n+2 d15n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d15n+1 d15n+2 d16n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d16n+1 d16n+2 d17n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d17n+1 d17n+2 d18n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d18n+1 d18n+2 d19n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d19n+1 d19n+2 d20n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d20n+1 d20n+2 d21n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d21n+1 d21n+2 d22n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d22n+1 d22n+2 d23n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
d23n+1 d23n+2 d24n
b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 • • • b7 b6 b5 b4 b3 b2 b1 b0
– 27 –
EXAMPLE Printing Sample
MSB LSB MSB LSB
d1 d2
d3 d4
d5 d6
d7 d8
d9 d10
d11 d12
d13 d14
d15 d16
d17 d18
d19 d20
d21 d22
d23 d24
d25 d26
LINE MODE
d27 d28
d29 d30
d31 d32
d33 d34
d35 d36
d37 d38
d39 d40
d41 d42
d43 d44
d45 d46
d47 d48
LINE MODE
52.5mm (TSP700) :1 n1 + n2 × 256 420
80mm (TSP700) :1 n1 + n2 × 256 640
50.8mm (TSP600/700) :1 n1 + n2 × 256 406
– 29 –
FUNCTION Define logo data
CODE <ESC> <FS> “q” n [x11 x12 y11 y12 d [k1]] 1... [xn1 xn2 yn1
yn2 d[kn]]n
HEX 1B 1C 71 n [x11 x12 y11 y12 d [k1]] 1... [xn1 xn2 yn1
yn2 d[kn]]n
REMARKS Define the logo data specified by n.
n 1 n 255
The number of logo images to define is specified.
[xn1 xn2 yn1 yn2 d[kn]]n
Parameter and data are specified according to the number
LINE MODE
specified by n.
xn1, xn2 1 (xn1 + xn2 × 256) 1023
Horizontal size of the logo image is specified as (xn1 + xn2
× 256) × 8 dots.
yn1, yn2 1 (yn1 + yn2 × 256) 288
Vertical size of the logo image is specified as (yn1 + yn2 ×
256) × 8 dots.
d[kn] kn = (xn1 + xn2 × 256) × (yn1 + yn2 × 256) × 8
Logo data is specified.
Note) This command is specified at the beginning of the line.
This command cancels all logo images that have already been
defined by this command. The printer cannot redefine only one of
several data definitions previously defined. Is this case, all data
needs to be sent again.
Total defined data area is 480K bytes for TSP800 (256K bytes for
TSP600 / 700).
If there is not enough empty area that was specified with the
parameter, or if any mistake in the parameter is turned out, the
processing of this command is terminated. (However, the logo
images whose definition had been completed before termination
are effective.)
When the processing of this command is completed, or terminated,
the printer will be initialized.
Form the beginning of processing of this command till the finish
of hardware reset, error process, mechanical operations and status
processes cannot be performed.
– 30 –
xn = xn1 + xn2 × 256, yn = yn1 + yn2 × 256
LINE MODE
d [12] d [22] d [n2]
(yn1 + yn2 × 256) × 8dot
LSB
– 31 –
FUNCTION Print logo image
CODE <ESC> <FS> “p” n m
HEX 1B 1C 70 n m
REMARKS Prints the logo image n using the mode specified by m.
n 1 n 255
Logo image number defined by the command <ESC> <FS>
“q” is specified.
m 0 m 3 or “0” m “3”
m = 0 or “0” Normal
m = 1 or “1” Double-width
LINE MODE
m = 2 or “2” Double-height
m = 3 or “3” Quadruple ( double-width, double height )
Note) If there is unprinted data in the line buffer, this command will be
executed after the data in the line buffer is printed out.
This command is not affected by print modes (emphasized, under-
line, character size, etc.) except inverted printing.
Print start position in the horizontal direction is the left margin
position. Horizontal print area follows the left and right margin
settings.
If the horizontal size of the logo image exceeds the horizontal print
area, the exceeded data is not printed.
– 32 –
Commands to Print Download Characters
FUNCTION Define download character
CODE <ESC> “&” <1> <1> n m1 m2 ... m48
HEX 1B 26 01 01 n m1 m2 ... m48
REMARKS Defines one new character and stores it in RAM for later use.
n is the character code of the character defined and must be
between 32 and 127.
The character matrix is 12 dots wide and 24 dots high.
Relationship between the character pattern and the character data
is shown below.
LINE MODE
EXAMPLE
Ignored
4 bits
– 33 –
Data Binary Hexa- Data Binary Hexa-
decimal decimal
m1 00011000 18 m2 00000000 00
m3 00111000 38 m4 00000000 00
m5 01111000 78 m6 00000000 00
m7 00011000 18 m8 00000000 00
m9 00011000 18 m10 00000000 00
m11 00011000 18 m12 01100000 60
m13 00011000 18 m14 11000000 C0
m15 00011001 19 m16 10000000 80
m17 00011011 1B m18 00000000 00
m19 00000110 06 m20 00000000 00
m21 00001100 0C m22 00000000 00
LINE MODE
LINE MODE
FUNCTION Control peripheral device #1
CODE <BEL>
HEX 07
REMARKS Executes drive pulse for peripheral device #1.
– 35 –
Commands to Control Auto Cutter
FUNCTION Cut command to the auto cutter
CODE <ESC> “d” n
HEX 1B 64 n
REMARKS n = “0” or <0> : TSP700/800
Cuts the paper fully immediately.
– 36 –
Other Commands
FUNCTION Cancel last line & Initialize printer
CODE <CAN>
HEX 18
REMARKS Clears the line buffer, and initializes the commands set already.
Does not affect the external equipment drive conditions set by the
code <ESC> <BEL> n1 n2. (This is the same during a mechanical
error.)
LINE MODE
CODE <ESC> <GS>“# m N n1 n2 n3 n4” <LF> <NUL>
HEX 1B 1D 23 m N n1 n2 n3 n4 0A 00
REMARKS Set the memory switch. After specifying the memory switch using
m=“,” “+” “-” definition commands, write to the memory using
m=“W” “T”.
– 37 –
1) Use N=1 to set printer conditions. Parameters are follows.
n1 :Always “0”
n2 :Start-position detect
n3 :Zero style
n4 :International character set
(Default)
Parammeter Setting 0 1
n1 Always “0” - -
n2 Start-position delect (*1) OFF ON
n3 Zero style Normal zero Slashed zero
n4 International character set See below
LINE MODE
– 38 –
3) Use N=4 for folloing settings
a) TSP700
Setting 0 1 2 3
n1 Always “0” -
n2 Always “0” -
n3 Print colum See bolow (ESC/POS mode only)
n4 Print area See bolow
LINE MODE
1 Max. 72 mm (576dots) 0 dot 48 colums 64 colums
colum 52.5 mm (420dots) 0 dot 35 colums 46 colums
80 mm (640dots) 0 dot 53 colums 71 colums
50.8 mm (406dots) 0 dot 33 colums 45 colums
b) TSP600
Setting 0 1 2 3
n1 Always “0” -
n2 Always “0” -
n3 Print colum See bolow (ESC/POS mode only)
n4 Print area See bolow
– 39 –
Table 1
MSW3-E MSW3-D MSW3-C MSW3-B MSW3-A MSW3-9 MSW3-8 Character Table
0 0 0 0 0 0 0 Normal*
0 0 0 0 0 0 1 CodePage 437 (USA, Std. Europe)
0 0 0 0 0 1 0 Katakana
0 0 0 0 0 1 1 CodePage 437 (USA, Std. Europe)
0 0 0 0 1 0 0 Codepage 858 (Multilingual)
0 0 0 0 1 0 1 Codepage 852 (Latin-2)
0 0 0 0 1 1 0 Codepage 860 (Portuguese)
0 0 0 0 1 1 1 Codepage 861 (Icelandic)
0 0 0 1 0 0 0 Codepage 863 (Canadian French)
0 0 0 1 0 0 1 Codepage 865 (Nordic)
0 0 0 1 0 1 0 Codepage 866 (Cyrillic Russian)
LINE MODE
– 40 –
FUNCTION Initialize printer
CODE <ESC> “@”
HEX 1B 40
REMARKS Reinitializes the printer. Clears the print buffer and returns settings
to their power-up values.
Does not clear the input buffer, downloaded characters, or condi-
tions for peripheral devices.
LINE MODE
HEX 05
REMARKS Causes the printer to transmit a status byte.
Status byte
b7 b6 b5 b4 b3 b2 b1 b0
Constantly
set at 0 Vertical Parity error
1 : error
Framing error
1 : error
Mechanical error
1 : error
Paper empty
1 : empty
Buffer empty
1 : empty
Buffer overflow
1 : overflow
Compulsion switch
High level
(Switch is set to ON)
– 41 –
FUNCTION Request Status
CODE <EOT>
HEX 04
REMARKS Causes the printer to transmit a status byte.
Status byte
b7 b6 b5 b4 b3 b2 b1 b0
0 0 0 0 0 0
Constantly
LINE MODE
set at 0 Constantly
set at 0
Constantly
set at 0
Near-end sensor
1: Near-end
Paper empty
1 : empty
Constantly
set at 0
Constantly
set at 0
Constantly
set at 0
– 42 –
Number of transmit byte n
Header #1
( 7 n 15)
7 00001111B (0F Hex)
8 00100001B (21 Hex)
9 00100011B (23 Hex)
10 00100101B (25 Hex)
11 00100111B (27 Hex)
12 00101001B (29 Hex)
13 00101011B (2B Hex)
14 00101101B (2D Hex)
15 00101111B (2F Hex)
LINE MODE
Header #2 (2nd byte )
Bit Contents 0 1
0 Always“0” -
1
2 Version No. of the Automatic status
3
4 Always“0” -
5
Version No. of the Automatic status
6
7 Always“0” -
– 43 –
Printer status #1 (3rd byte )
Bit Contents 0 1
0 Always“0” -
1 <ETB> command Unexecuted Executed
2 Compulsion switch Open Close
3 ON Line / OFF Line ON Line OFF Line
4 Always“0” -
5 Cover open Close Open
6 Invalid
7 Always“0” -
LINE MODE
– 44 –
Printer status #4 (6th byte )
Bit Contents 0 1
0 Always“0” -
1 Invalid
2 Near-end Not near-end Near-end
3 Paper empty Not empty Empty
4 Always“0” -
5 Invalid
6 Invalid
7 Always“0” -
LINE MODE
Printer status #5 (7th byte )
Bit Contents 0 1
0 Always“0” -
1 Invalid
2 Invalid
3 Invalid
4 Always“0” -
5 Invalid
6 Invalid
7 Always“0” -
– 45 –
3. STAR PAGE MODE (TSP800 ONLY)
3-1. Command Summary
The printer has the following control commands. Each control code starts with
<ESC> code and ends with <LF> <NUL> codes, except for the Request status
command <ENQ> and the Call Download Character command <ESC> “G”.
Format Definition
Control codes Hexadecimal codes Function Pages
<ESC> “C”<LF> <NUL> 1B 43 0A 00 Clear format 48
<ESC> “D n1n2n3n4” <LF> 1B 44 n1n2n3n4 0A Define print area 48
<NUL> 00
<ESC> “L n1n2 ; x1x2x3x4 1B 4C n1n2 3B x1x2x3x4 2C Define ruled line format 49
, y1y2y3y4, x5x6x7x8 y1y2y3y4 2C x5x6x7x8 2C
, y5y6y7y8, d, w” <LF> y5y6y7y8 2C d 2C w 0A 00
<NUL>
PAGE MODE
– 46 –
Other commands
Control codes Hexadecimal codes Function Pages
<ESC> “I” <LF> <NUL> 1B 49 0A 00 Print Label 59
<ESC> “W s1s2s3s4, 1B 57 s1s2s3s4 2C Print Label 59
h1h2h3h4” <LF> <NUL> h1h2h3h4 0A 00
<ESC> “B d n1n2” <LF> 1B 42 d n1n2 0A Enable cutter 60
<NUL> 00
<ESC> “# N, n1n2n3n4” <LF> 1B 23 N 2C n1n2n3n4 0A Set Memory Switch 60
<NUL> 00
<ESC> “?” <LF> <NUL> 1B 3F 0A 00 Reset printer 61
<ENQ> 05 Request status 62
<EOT> 04 Request status 63
<ESC> <ACK> <SOH> 1B 06 01 Request status 63
<ESC> <RS> “a” n 1B 1E 61 n Set status transmission condition 67
<ESC> “N n1n2” <LF> <NUL> 1B 4E n1n2 0A 00 Select international character set 67
<ESC> “F n1n2 ; d1.....d48” 1B 46 n1n2 3B d1.…d48 Register download character 68
<LF> <NUL> 0A 00
<ESC> “Z n” <LF> <NUL> 1B 5A n 0A 00 Select “zero”style 68
PAGE MODE
– 47 –
3-2. Command Specification
Format Definition
FUNCTION Clear format
CODE <ESC> “C” <LF><NUL>
HEX 1B 43 0A 00
REMARKS When the printer receives this command, all defined format and
image data are cleared.
The format defined by the following commands will be cleared.
<ESC> “D”
<ESC> “E” <ESC> “L” <ESC> “PC” <ESC> “PB”
<ESC> “Y” <ESC> “RC” <ESC> “RB” <ESC> “Q”
<ESC> “H” <ESC> “K” <ESC> “B”
ABCD 40 mm ABCD
EFG EFG
50 mm
ABCD
EFG
ABCD
EFG
– 48 –
FUNCTION Define ruled line format
CODE <ESC> “L n1n2 ; x1x2x3x4 , y1y2y3y4 , x5x6x7x8 ,
y5y6y7y8 , d , w” <LF> <NUL>
HEX 1B 4C n1n2 3B x1x2x3x4 2C y1y2y3y4 2C x5x6x7x8 2C
y5y6y7y82C d 2C w 0A 00
REMARKS This command defines ruled line format.
n1n2 : Line number(00 to 63)
x1x2x3x4 : Position of the starting point in the X direction (0000
to 1040 × 0.1 mm)
y1y2y3y4 : Position of the starting point in the Y direction (0000
to 2000 × 0.1 mm)
x5x6x7x8 : Position of the ending point in the X direction (0000
to 1040 × 0.1 mm)
y5y6y7y8 : Position of the ending point in the Y direction (0000
to 2000 × 0.1 mm)
PAGE MODE
These four parameters work in 1/10 mm unit, and should be given
with four digit numbers.
– 50 –
Character rotation and character string rotation
1) Charcter rotation only(no character string rotaion)
r1=2(180°) r1=3(270°)
Start position r2=0( 0°) r2=0( 0°)
CB A
C
B
A
A B C
C
B
r1=0(0°) r1=1(90°)
r2=0(0°) r2=0( 0°)
A B C
3) Charcter string rotation and character rotation
PAGE MODE
A B C
A B C
A B C
r1=2(180°) r1=3(270°)
r2=2(180°) r2=3(270°)
r1=0(0°) r1=1(90°)
r2=0(0°) r2=1(90°)
– 51 –
FUNCTION Define bar code format
CODE <ESC> “P B n1n2 ; x1x2x3x4 ,
y1y2y3y4 , w , b , m ,
h1h2h3h4”<LF><NUL>
HEX 1B 50 42 n1n2 3B x1x2x3x4 2C
y1y2y3y4 2C w 2C b 2C m 2C
h1h2h3h4 0A 00
REMARKS This command defines start position and type of bar code string.
n1n2 : Bar code string number (00 to 31)
x1x2x3x4 : Print start position in the X direction (0000 to 1040 ×
0.1 mm)
y1y2y3y4 : Print start position in the Y direction (0000 to 2000 ×
0.1 mm)
w : Mode (See Appendix for details)
PAGE MODE
– 52 –
Bar code rotation
m=2 m=3
180° 270°
m=0
0°
PAGE MODE
CODE <ESC> “Y d1d2” <LF><NUL>
HEX 1B 59 d1d2 0A 00
REMARKS This command defines dot space between characters.
d1d2 : Indicates dot space (00 to 63)
– 53 –
Print Data Settings
FUNCTION Set character string data
CODE <ESC> “R C n1n2 ;a1a2.…an” <LF><NUL>
HEX 1B 52 43 n1n2 3Ba1a2.…an 0A 00
REMARKS This command sets character strings defined by the <ESC>
“PC”.
n1n2 : Two digit reference number of character string whose
print position and type are previously defined with
<ESC> “PC”.
a1a2.…an : Character string data (up to 100 characters)
– 54 –
FUNCTION Set bar code data
CODE <ESC> “R B n1n2 ; a1a2.…an”<LF> <NUL>
HEX 1B 52 42 n1n2 3B a1a2.…an 0A 00
REMARKS This command defines the bar code data to be printed.
n1n2 : Two digits reference number of defined bar code
whose print position and type are previously defined
with <ESC>“PB”.
a1a2.…an : Bar code data to be encoded and printed.
PAGE MODE
d) CODE 128 conforms to EAN-128; the start code,
check word, and stop code of CODE 128 are auto-
matically inserted.
e) Start, stop and check characters of CODE 93 are
automatically inserted.
f) Start and stop characters of Interleaved 2 of 5 are
automatically inserted.
g) When the number of digits of lnterleaved 2 of 5 is an
odd number, “0” is automatically inserted as the
highest digit.
h) If “;” is missing, printer goes into an error condition.
– 55 –
FUNCTION Store dot graphic data into image memory
CODE <ESC> “Q n x1x2x3x4 , y1y2y3y4 ,
h1h2h3h4 , w1w2w3 ,n11n12n13n.…n1k
<LF>.…nm1nm2.…nmk” <LF> <NUL>
HEX 1B 51 n x1x2x3x4 2C y1y2y3y4 2C
h1h2h3h4 2C w1w2w3 2Cn11n12n13n.…n1k
<LF>.…nm1nm2.…nmk” 0A 00
REMARKS This command stores graphic data into image memory.
n : “;” : OR mode
“:” : Overwrite mode
x1x2x3x4 : Print start position in the X direction. (0000 to 1040 ×
0.1 mm)
y1y2y3y4 : Print start position in the Y direction. (0000 to 2000 ×
0.1 mm)
h1h2h3h4 : Defines the length (Y direction) of the graphic area.
PAGE MODE
– 56 –
FUNCTION Copy BMP file to printer
CODE <ESC> “H n x1x2x3x4 , y1y2y3y4 ,
(BMP file data) ,” <LF> <NUL>
HEX 1B 48 n x1x2x3x4 2C y1y2y3y4 2C
(BMP file data) 2C 0A 00
REMARKS This command copies BMP file to the printer(Image buffer). BMP
file can be scanned by scanner and edited by a program such as the
PAINT BRUSH in the WINDOWS. The printer can accept non-
compressed monochrome BMP file only.
BMP file contains white pixel (dots). There are two mode in this
command depending on how to handle these white pixels when
there are black pixels already set in the area to be printed on.
n : Mode “;” 3B(hex) “OR” mode : White pixels (area) of
BMP file do not erase black pixels previously set.
“:” 3A(hex) “OVERWRITE” : White pixels (area) of
PAGE MODE
BMP file erase(overwrite) black pixels previously set.
Data previously set BMP graphic file Print out result
OR mode: ABCDEFGHIJK ABCDEFGHIJK
ABCDEFGHIJK ABCDEFGHIJK
ABCDEFGHIJK ABCDEFGHIJK
ABCDEFGHIJK ABCDEFGHIJK
ABCDEFGHIJK ABCDEFGHIJK
ABCDEFGHIJK ABCDEFGHIJK
– 58 –
Other commands
FUNCTION Print Label
CODE <ESC> “I” <LF><NUL>
HEX 1B 49 0A 00
REMARKS This command prints out one label according to the previously
defined format and data.
When print start position detect is ON, the paper will be fed to the
next print start position after printing.
If unrecoverable error occurs during printing, a series of these
operation will be repeated after the printer recovers from the error
condition.
PAGE MODE
REMARKS This command prints out the data within the defined print area.
Print area defined by <ESC>“D” is ignored.
When print start position detect is ON, the paper will be fed to the
next print start position after printing.
If unrecoverable error occurs during printing, a series of these
operation will be repeated after the printer recovers from the error
condition.
s1s2s3s4 : Print start position in the Y direction (unit: 0.1 mm)
h1h2h3h4: Print length from the print start position (unit: 0.1
mm)
– 59 –
FUNCTION Enable cutter
CODE <ESC> “B d n1n2” <LF><NUL>
HEX 1B 42 d n1n2 0A 00
REMARKS This command defines cut position and enables cutter. This
command does not energize cutter.
Cutter will be operated only when receiving<ESC> “I” com-
mand.
d : “+” or “-” indicates the direction of the cut position
from the normal position.
“+” indicates a forward feed, and “-” indicates a
reverse feed from the normal cut position.
n1n2 : Indicates the value to move in 1/10 mm unit.(00 to 50)
– 60 –
(Default)
Parameter Setting 0 1
n1 Always “0” - -
PAGE MODE
FUNCTION Reset printer
CODE <ESC> ? <LF><NUL>
HEX 1B 3F 0A 00
REMARKS Resets the printer and prints self-test. This command will also set
memory switch conditions without the need to turn the printer
power OFF and ON again.
EXAMPLE LPRINT CHR$(&H1B);“?”;CHR$(&H0A);CHR$(&H00);
– 61 –
FUNCTION Request status
CODE <ENQ>
HEX 05
REMARKS When the printer receives this command, the printer sends back a
status byte for the current printer condition immediately to the
host.
Note: Printer conditions are reported by the following status
bytes:
Status byte
b7 b6 b5 b4 b3 b2 b1 b0
Constantly
PAGE MODE
Framing error
1 : error
Mechanical error
1 : error
Paper empty
1 : empty
Buffer empty
1 : empty
Buffer overflow
1 : overflow
Compulsion switch
High level
(Switch is set to ON)
– 62 –
FUNCTION Request status
CODE <EOT>
HEX 04
REMARKS When the printer receives this command, the printer sends back a
status byte for the current printer condition immediately to the
host.
Note: Printer conditions are reported by the following status
bytes:
Status byte
b7 b6 b5 b4 b3 b2 b1 b0
0 0 1
Constantly
PAGE MODE
set at 0 Constantly
set at 1
Constantly
set at 0
Near-end sensor
1: Near-end
Paper empty
1 : empty
Constantly
set at 0
Constantly
set at 0
Constantly
set at 0
– 63 –
Header #1 (1st byte )
Bit Contents 0 1
0 Always“1” -
1
2 Number of printer status byte
3
4 Always“0” -
5 Number of printer status byte
6 Always“0” -
7 Always“0” -
– 64 –
Version No. n Header #2
1 00000010B (02 Hex)
2 00000100B (04 Hex)
3 00000110B (06 Hex)
4 00001000B (08 Hex)
5 00001010B (0A Hex)
6 00001100B (0C Hex)
7 00001110B (0E Hex)
8 00100000B (20 Hex)
9 00100010B (22 Hex)
10 00100100B (24 Hex)
...
...
...
...
PAGE MODE
31 01101110B (6E Hex)
– 65 –
Printer status #3 (5th byte )
Bit Contents 0 1
0 Always“0” -
1 Invalid
2 Invalid
3 Invalid
4 Always“0” -
5 Invalid
6 Buffer overflow Overflow
7 Always“0” -
2 Near-end Near-end
3 Paper empty Empty
4 Always“0” -
5 Invalid
6 Invalid
7 Always“0” -
– 66 –
FUNCTION Set status transmission condition
CODE <ESC> <RS> “a” n
HEX 1B 1E 61 n
REMARKS This command sets the status transmission condition.
n = “0” or <0> : ASB is invalid
n = “1” or <1> : ASB is valid
PAGE MODE
n1n2 Country n1n2 Country n1n2 Country n1n2 Country
00 U.S.A 03 UK 06 Itary 09 Norway
01 France 04 Denmark #1 07 Spain #1 10 Denmark #2
02 Germany 05 Sweden 08 Japan 11 Spain #2
n1n2 Country
12 Latin America
– 67 –
FUNCTION Register download character
CODE <ESC> “F n1n2 ; d1.…d48” <LF><NUL>
HEX 1B 46 n1n2 3B d1.…d48 0A 00
REMARKS This command defines one download character.
n1n2 : Download character reference number.(00 to 31).
d1.…d48 : Character bit map data.
Note: Only standard size character (16 (W) × 24 (H) dots)
can be defined as download characters.
MSB LSB MSB LSB
d1 d2
d3 d4
d5 d6
d7 d7
d9 d10
d45 d46
d47 d48
PAGE MODE
– 68 –
4. DP8340 MODE (TSP800 ONLY)
4-1. Command Summary
Hexadecimal
Control codes Function Page
codes
<LF> 0A Print and line feed instruction 70
<CR> 0D Print and line feed instruction 70
(Same as LF)
<SO> 0E Expanded character instruction 70
<DC4> 14 Expanded character release 70
<ESC> “–” “1” 1B 2D 31 70
Underline isrtruction
<ESC> “–” <1> 1B 2D 01
<ESC> “–” “0” 1B 2D 30 70
Underline release
<ESC> “–” <0> 1B 2D 00
<SI> 0F Inverted print instruction 71
<DC2> 12 Inverted print release 71
<ESC> “E” 1B 45 Emphasized print instruction 71
<ESC> “F” 1B 46 Emphasized print release 71
<ESC> “4” 1B 34 Highlighted character print instruction 71
<ESC> “5” 1B 35 Highlighted character print release 71
DP8340 MODE
<ESC> “R” n 1B 52 n International Character set selection 72
<ESC> “a” n 1B 61 n n-line feed instruction 72
<ESC> “C” n 1B 43 n Sets page length in lines 72
<ESC> “N” n 1B 4E n Set bottom margin in lines 73
<ESC> “O” 1B 4F Cancel bottom margin 73
<FF> 0C Form feed 73
<ESC> “@” 1B 40 Printer initialization instruction 73
<ESC> <BEL> n1 n2 1B 07 n1 n2 Set peripheral unit drive pulse duration 73
<BEL> 07 Trigger peripheral unit drive #1 74
<FS> 1C Trigger peripheral unit drive #1 74
<SUB> 1A Trigger peripheral unit drive #2 74
<ENQ> 05 Enquiry 74
<CAN> 18 Clears print buffer 74
– 69 –
4-2. Command Specification
CODE LF
(0A)H
FUNCTION Print and line feed instruction
OUTLINE The LF code causes the data in the line buffer to be printed,
followed by a single line feed. When the line buffer is empty,
only the feed takes place.
CODE CR
(0D)H
FUNCTION Print and line feed instruction
OUTLINE Same function as of LF code.
However, when the DIP switch 1-3 is ON, the CR code
becomes invalid.
CODE SO
(0E)H
FUNCTION Expanded character instruction
OUTLINE This code causes the printer to print expanded characters
twice as wide as the regular ones. This remains in effect until
DP8340 MODE
CODE DC4
(14)H
FUNCTION Release from expanded characters
OUTLINE The expanded character instruction is released by the DC4
code, and the succeeding data is printed as regular width
characters.
CODE ESC-1
(1B)H (2D)H (01)H or (1B)H (2D)H (31)H
FUNCTION Underline mode selection
OUTLINE All data received after this code is underlined until a ESC-0
is received.
CODE ESC-0
(1B)H (2D)H (00)H or (1B)H (2D)H (30)H
FUNCTION Release from underline mode
OUTLINE The underline mode selection is released by this code.
– 70 –
CODE SI
(0F)H
FUNCTION Inverted print instruction
OUTLINE This function causes the printing to be inverted. This code
must be received at the beginning of a line. If this code is
received anywhere other than at the beginning of a line, it is
disregarded. Accordingly, normal characters and inverted
characters, can not be mixed on the same line.
CODE DC2
(12)H
FUNCTION Release from inverted print instruction
OUTLINE The inverted print instruction is released by this code. This
code must be received at the beginning of a line.
CODE ESC E
(1B)H (45)H
FUNCTION Emphasized print mode instruction
OUTLINE Data following this command is printed with emphasized
characters.
DP8340 MODE
CODE ESC F
(1B)H (46)H
FUNCTION Release from emphasized print instruction
OUTLINE Emphasized print is released.
CODE ESC 4
(1B)H (34)H
FUNCTION Highlighted character print instruction
OUTLINE This command causes subsequent data to be printed with
highlighted characters.
The instruction is released by the code, ESC 5.
CODE ESC 5
(1B)H (35)H
FUNCTION Release from highlighted character print instruction
OUTLINE The highlighted character print instruction is released by this
code.
– 71 –
CODE ESC R n
(1B)H (52)H n
FUNCTION International character set selection
OUTLINE Selects an international character set according to the value of
n, as shown bolow:
n: Character set n: Character set
0: U.S.A. 8: Japan
1: France 9: Norway
2: Germany 10 : Denmark II
3: England 11 : Spain II
4: Denmark I 12 : Latin America
5: Sweden 13 : Korea
6: Italy 14 : Ireland
7: Spain I 64 : Legal
CODE ESC a n
(1B)H (61)H n
FUNCTION n-line feed
OUTLINE After printing the data in the current line, n lines are fed by this
code. The value of n ranges from 1 to 127.
DP8340 MODE
CODE ESC C n
(1B)H (43)H n
FUNCTION Sets page length in lines
OUTLINE This code sets the length of a page to n lines. The value of n
ranges from 1 to 127. On initialization, the page length
default condition will be 42 lines. The line feed pitch is one-
sixth inch.
– 72 –
CODE ESC N n
(1B)H (4E)H n
FUNCTION Sets bottom margin in lines
OUTLINE Upon receiving this code, the bottom margin is set to n lines.
0 n 255; Default Value n = 0
CODE ESC O
(1B)H (4F)H
FUNCTION Cancels bottom margin.
OUTLINE Upon input of this code, bottom margin setting is cleared.
CODE FF
(0C)H
DP8340 MODE
FUNCTION Form feed
OUTLINE The FF code prints the data in the current line and transports
the paper to the start of the next page.
CODE ESC @
(1B)H (40)H
FUNCTION Printer initialization
OUTLINE All printing conditions except ESC BEL n1 n2, the line buffer
and data buffer are set to the power on default condition.
CODE SUB
(1A)H
FUNCTION Trigger peripheral unit drive #2
OUTLINE Causes a peripheral drive pulse to be generated. The drive
pulse width and delay time are fixed at 200 ms.
CODE ENQ
(05)H
FUNCTION Enquiry
OUTLINE When this code is received, the printer outputs status data.
If it is input after text data input in the STX-ETX mode, the
printer outputs status data and the check byte.
CODE CAN
(18)H
FUNCTION Clears print buffer
OUTLINE Upon input of this code the data buffer and line buffer is
cleared.
– 74 –
5 : ESC/POS Mode Command Summary
HT 09 Horizontal tab
LF 0A Print line feed
CR 0D Carriage return
FF 0C Page mode print and return
DLE EOT 10 04 Real time transmission of status
DLE ENQ 10 05 Real time request to printer
DLE DC4 10 14 Generate pulse at real time
CAN 18 Cancel print data in page mode
ESC FF 1B FF Print page mode data
ESC SP 1B 20 Set right space amount of character
ESC ! 1B 21 Select print mode
ESC $ 1B 24 Designate absolute printing
ESC % 1B 25 Designate/cancel download character set
ESC & 1B 26 Define download characters
ESC* 1B 2A Designate bit image mode
ESC - 1B 2D Designate/cancel underline
ESC 2 1B 32 Set 1/6 inch line feed amount
ESC 3 1B 33 Set line feed amount
ESC = 1B 3D Select peripheral equipment
ESC ? 1B 3F Delete download characters
ESC @ 1B 40 Initialize printer
ESC D 1B 44 Set horizontal tab position
ESC E 1B 45 Designate/cancel emphasized print
ESC/POS
ESC G 1B 47 Designate/cancel double print
ESC J 1B 4A Print and paper feed
ESC L 1B 4C Select page mode
ESC M 1B 4D Select character
ESC R 1B 52 Select an international character set
ESC S 1B 53 Select standard mode
ESC T 1B 54 Select character print direction in page mode
ESC V 1B 56 Designate/cancel 90° character rotation
ESC W 1B 57 Set print range in page mode
ESC \ 1B 5C Designate relative position
ESC a 1B 61 Align position
ESC c 3 IB 63 33 Select no-paper detector for output of no-paper signal
ESC c 4 1B 63 34 Select no valid paper detector at print stop
ESC c 5 1B 63 35 Enable/disable panel switch
ESC d 1B 64 Print and paper feed “n” lines
– 75 –
Control Code Hexadecimal Code Function
– 76 –
Appendix 1 : How to set various bar codes
Refer to the industry standards reference material for the features and applica-
tions of each bar code symbology.
This section of this document covers the proper commands to select the bar code
symbology required.
(1) CODE 39
b) Vertical printing
In vertical printing, one dot is added to each white bar which is horizontally
printed. (This is because the width of black bars is made wider due to the
APPENDIX
– 77 –
2) REQUIREMENTS
a) The Start code and the Stop code of CODE 39 are automatically added.
b) The position defined by the control command locates the bar code symbols.
It is necessary to provide space for a quiet zone for bar code symbol.
c) Inter-element space:
Minimum is the same as the narrow-element width.
Maximum is three times the narrow-element width or 1.524 mm, whichever
is greater.
d) Bar height:
For hand scanners, the minimum is 0.25 inch (6.35 mm) or 15% of the bar
code-length, whichever is greater.
For non-hand scanners, the minimum is 0.8 inch (20.3 mm) or 25% of the
bar code-length, whichever is greater.
e) Quiet zone:
Minimum is ten times the narrow-element width or 0.10 inch (2.54 mm),
whichever is greater.
For hand scanners, the minimum is 0.25 inch (6.35 mm) or greater.
EXAMPLE Bar code string number 11 ,starting position of bar code (X,Y)
= 10 mm, 10 mm, use Mode 2 of CODE39, Bar code height
APPENDIX
LPRINT CHR$(&H1B);“PB11;0100;0100,2,1,0,0100”;
CHR$(&H0A);CHR$(&H00);
LPRINT CHR$(&H1B);“RB11;ABCDEFG”;CHR$(&H0A);
CHR$(&H00);
– 78 –
(2) Interleaved 2 of 5 (ITF)
This code can represent numeric characters from 0 to 9. This code can be used for
an application that requires higher character density.
JIS and EAN specify that this code be used for printing on corrugated boxes.
a) Horizontal printing
Item Mode 1 Mode 2 Mode 3 Mode 4 Mode 5 Mode 6 Mode 7 Mode 8 Mode 9
Width of narrow
2 dots 4 dots 6 dots 2 dots 4 dots 6 dots 2 dots 3 dots 4 dots
elements
Width of wide
5 dots 10 dots 15 dots 4 dots 8 dots 12 dots 6 dots 9 dots 12 dots
element
Ratio 1 : 2.5 1 : 2.5 1 : 2.5 1:2 1:2 1:2 1:3 1:3 1:3
Length of one
4 8 12 3.5 7 10.5 4.5 6.75 9
character (mm)
b) Vertical printing
Item Mode 1 Mode 2 Mode 3 Mode 4 Mode 5 Mode 6 Mode 7 Mode 8 Mode 9
Length of two
4.625 8.625 12.625 4.125 7.625 11.125 5.125 7.375 9.625
character (mm)
2) REQUIREMENTS
a) When this code is used, the start and stop patterns are automatically
inserted.
b) When the number of digits for bar code data is an odd number, the printer
automatically adds “0” in the highest digit position.
c) Details conform to the AIM, USS-12/5, ANSI, and JIS X 0502 specifica-
tions
EXAMPLE Bar code string number 25, starting position of bar code (X, Y)
APPENDIX
LPRINT CHR$(&H1B);“PB25;0050,0100,1,2,0,0100”;
CHR$(&H0A); CHR$(&H00);
LPRINT CHR$(&H1B);“RB25;0123456”; CHR$(&H0A);
CHR$(&H00);
– 79 –
(3) CODE 93
a) Horizontal printing
Item Mode 1 Mode 2 Mode 3
Module width 2 dots 3 dots 4 dots
Width of one
2.25 3.375 4.5
character (mm)
Note: The start and stop bars are not included.
b) Vertical printing
Item Mode 1 Mode 2 Mode 3
Module width 2 dots 3 dots 4 dots
Width of one
2.625 3.75 4.875
character (mm)
2) REQUIREMENTS
EXAMPLE Bar code number 00, starting position of bar code (X, Y) = 40
mm, 16 mm Mode 2 of CODE 93, Bar code rotation: 0 degree.
Bar code height 10 mm, Data “ABCDefg”
LPRINT CHR$(&H1B);“PB00;0400,0160,2,3,0,0100”;
CHR$(&H0A);CHR$ (&H00);
LPRINT CHR$(&H1B);“RB00;ABCDefg”;
APPENDIX
CHR$(&H0A);CHR$ (&H00);
– 80 –
(4) UPC (5) JAN/EAN-8 (6) JAN/EAN-13
These codes are common commodity codes, mainly used for miscellaneous
goods or groceries sold at supermarkets.
a) Horizontal printing
Item Mode 1 Mode 2 Mode 3
Module width 2 dots 3 dots 4 dots
Bar code width
JAN/EAN-8 16.75 mm 25.125 mm 33.5 mm
JAN/EAN-13, UPC 23.75 mm 36.625 mm 47.5 mm
Note: Right and left guard bars are included, white spaces are not included.
b) Vertical printing
Item Mode 1 Mode 2 Mode 3
Module width 2 dots 3 dots 4 dots
Bar code width
JAN/EAN-8 13.375 mm 27.75 mm 36.125 mm
JAN/EAN-13, UPC 27.624 mm 39.5 mm 51.375 mm
Note: Right and left guard bars are included, white spaces are not included.
2) REQUIREMENTS
a) JAN/EAN-8
Must consist of a 7 or 8 numeric digits, otherwise, the command is ignored.
The check digit is automatically added using modules 10/3 weight.
When the calculated value and the value in the 8th digit differ, the former
value has precedence over the latter values. APPENDIX
b) JAN/EAN-13
Must consist of a 12 or 13 numeric digits; otherwise, the command is
ignored. The check digit is automatically added using modules 10/3 weight.
When the calculated value and the value in the 13th digit differ, the former
value has precedence over the latter values.
LPRINT CHR$(&H1B);“PB10;0050,0100,1,6,0,0100”;
CHR$(&H0A);CHR$(&H00);
LPRINT CHR$(&H1B);“RB10;246801357956”;
CHR$(&H0A);CHR$(&H00);
b) Vertical printing
Item Mode 1 Mode 2 Mode 3
Module width 2 dots 3 dots 4 dots
Width of one
3.125 mm 4.5 mm 6.5 mm
character
2) REQUIREMENTS
%(25 H) is sent as data %0(25H 35H). Control codes 00H to 1FH and 7FH are
sent as data % followed by 40H to 5FH and 35 H. For example, control code 7FH
is sent as data %5 (25H 35H). Function codes are sent as data % followed by 1
to 4 (31H to 34H). The start code is sent as data % followed by 6 to 8(36H to 38H).
Although CODE 128 data requires START CODE, the printer automatically adds
APPENDIX
START CODE. Please omit START CODE when sending data to the printer.
– 82 –
3) 2-character set codes
Control codes Special code
Code HEX Format HEX Code HEX Format HEX
NUL 00H %@ 25H 40H % 25H %0 25H 30H
SOH 01H %A 25H 41H
STX 02H %B 25H 42H Function codes
ETX 03H %C 25H 43H Code HEX Format HEX
EOT 04H %D 25H 44H FNC1 %1 25H 31H
ENQ 05H %E 25H 45H FNC2 %2 25H 32H
ACK 06H %F 25H 46H FNC3 %3 25H 33H
BEL 07H %G 25H 47H FNC4 %4 25H 34H
BS 08H %H 25H 48H
HT 09H %I 25H 49H Start codes
LF 0AH %J 25H 4AH Code HEX Format HEX
VT 0BH %K 25H 4BH START A %6 25H 36H
FF 0CH %L 25H 4CH START B %7 25H 37H
CR 0DH %M 25H 4DH START C %8 25H 38 H
– 84 –
Appendix 2 : Sensor adjustment mode
(1) No paper / Black mark sensor adjustment
Operation procedure
1) Select sensor adjustment mode with DIP switch setting.
2) Turn the power ON.
3) With the paper roll installed, turn and adjust VR2 until both POWER /
ERROR LEDs light.
4) Turn the power OFF.
5) Select standard mode with DIP switch setting.
APPENDIX
– 85 –
Appendix 3 : Character code tables
A3-1. STAR Line Mode
(Character table: Normal)
APPENDIX
Note: The (7F)H code is a space when neither normal nor katakana.
– 86 –
STAR Line Mode
(Character table: Normal)
APPENDIX
– 87 –
STAR Line Mode
(Character table: Code page 437 )
APPENDIX
Note: Other characters are the same as those for Character table: Normal.
– 88 –
STAR Line Mode
(Character table: Katakana)
APPENDIX
Note: Other characters are the same as those for Character table: Normal.
– 89 –
STAR Line Mode
Code Page #858 Code Page #852
Multi-lingual Latin-2
Note: Other characters are the same as those for Character table: Normal.
– 90 –
STAR Line Mode
Code Page #863 Code Page #865
Canadian French Nordic
APPENDIX
Note: Other characters are the same as those for Character table: Normal.
– 91 –
STAR Line Mode
Code Page #855 Code Page #857
Cyrillic Bulgarian Turkish
8 9 A B C D E F 8 9 A B C D E F
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A A
B B
C C
D D
E E
F F
7 7
8 8
9 9
A A
B B
C C
D D
E E
F F
Note: Other characters are the same as those for Character table: Normal.
– 92 –
STAR Line Mode
Code Page #737 Code Page #851
Greek Greek
APPENDIX
Note: Other characters are the same as those for Character table: Normal.
– 93 –
STAR Line Mode
Code Page #772 Code Page #774
Lithuanian Lithuanian
Note: Other characters are the same as those for Character table: Normal.
APPENDIX
– 94 –
STAR Line Mode
Code Page #874 Code Page #1250
Thai Windows Latin-2
8 9 A B C D E F 8 9 A B C D E F
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A A
B B
C C
D D
E E
F F
7 7
8 8
9 9
A A
B B
C C
D D
E E
F F
Note: Other characters are the same as those for Character table: Normal.
– 95 –
STAR Line Mode
Code Page #3840 Code Page #3841
IBM-Russian Gost
Note: Other characters are the same as those for Character table: Normal.
– 96 –
STAR Line Mode
Code Page #3845 Code Page #3846
Hungarian Turkish
APPENDIX
Note: Other characters are the same as those for Character table: Normal.
– 97 –
STAR Line Mode
Code Page #1001 Code Page #2001
Arabic Lithuanian-KBL
Note: Other characters are the same as those for Character table: Normal.
– 98 –
STAR Line Mode
Code Page #3011 Code Page #3012
Latvian-1 Latvian-2
Note: Other characters are the same as those for Character table: Normal.
APPENDIX
Note: Other characters are the same as Note: Other characters are the same as
those for Character table: Nor- those for Code Page #437.
mal.
– 99 –
STAR Line Mode
International Character Set
The character codes shown in the table are hexadecimal.
APPENDIX
– 100 –
A3-2. STAR Page Mode
APPENDIX
– 101 –
STAR Page Mode
(Character type: Small size or standard)
APPENDIX
– 102 –
STAR Page Mode
(Character type: Boldface)
APPENDIX
– 103 –
STAR Page Mode
International Character Set
APPENDIX
– 104 –
A3-3. DP8340 Mode
(U.S.A. & Europe)
APPENDIX
– 105 –
– 106 –
APPENDIX
DP8340 Mode
(IBM Character Set #1)
APPENDIX
– 107 –
– 108 –
APPENDIX
DP8340 Mode
(IBM Character Set #2)
APPENDIX
– 109 –
– 110 –
APPENDIX
DP8340 Mode
(JAPAN)
APPENDIX
– 111 –
– 112 –
APPENDIX
DP8340 Mode
International Character Set
APPENDIX
– 113 –
ELECTRONIC PRODUCTS DIVISION OVERSEAS SUBSIDIARY COMPANIES
STAR MICRONICS CO., LTD. STAR MICRONICS AMERICA, INC.
536 Nanatsushinnya, Shimizu, Shizuoka, 1150 King Georges Post Road, Edison,
424-0066 Japan NJ 08837-3729 U.S.A.
Tel: 0543-47-0112, Fax: 0543-48-5013 Tel: 732-623-5555, Fax: 732-623-5590
http://www.starmicronics.com
Please access the following URL
http://www.star-micronics.co.jp/service/ STAR MICRONICS U.K. LTD.
frame_sp_spr_e.htm Star House, Peregrine Business Park, Gomm Road,
for the lastest revision of the manual. High Wycombe, Bucks, HP13 7DL, U.K.
Tel: 01494-471111, Fax: 01494-473333
http://www.starmicronics.co.uk
2001.10.12
Printed in Japan, 80872097