Seiko Instruments Inc. (hereinafter referred to as “SII”) has prepared this technical reference for use by SII
personnel, licensees, and customers. The information contained herein is the property of SII and shall not be
reproduced in whole or in part without the prior written approval of SII.
SII reserves the right to make changes without notice to the specifications and materials contained herein and
shall not be responsible for any damages (including consequential) caused by reliance on the materials
presented, including but not limited to typographical, arithmetic, or listing errors.
is a trademark of Seiko Instruments Inc.
IrDA Protocol Stack 「μDeepCore(r)1.1」(C)ITX E-Globaledge Corp. All Rights Reserved.
ESC/P is trademarks of SEIKO EPSON CORPORATION.
BHT-Ir is trademarks of DENSO CORPORATION.
Bluetooth is registered trademarks of Bluetooth SIG, Inc.
Page 3
PREFACE
This technical reference describes the DPU-S245 series thermal printer.
(hereinafter referred to as “printer”)
Read the User’s Guide supplied with the printer for details regarding basic operation and maintenance
procedures.
DPU-S245 series have the following models.
・DPU-S245-00A-E
(St andard model)
・DPU-S245-01A-E
(Bluetooth supporting model)
The printer complies with EU RoHS Directive (2002/95/EC)
Page 4
【Manual Configuration】
CHAPTER 1: TERMS USED IN THIS MANUAL
・ This chapter describes the basic terms that are frequently used in this technical reference.
CHAPTER 2: SPECIFICATIONS
・ This chapter describes the printer main body and thermal pape r specifications.
CHAPTER 3: INTERFA CE
・ This chapter describes 4 types of the interface specifications which are required to connect the host
device with the printer.
CHAPTER 4: FUNCTION SETTINGS
・ This chapter describes the function settings, test print and hex dump mode.
CHAPTER 5: LAMP DISPLAY AND SWITCH FUNCTION
・ This chapter describes the printer status by lamp display and functions of switches.
CHAPTER 6: COMMAND DESCRIPTIONS
・ This chapter describes the function of commands supported by the printer.
APPENDIX A: CHARACTE R SETS (CHARACTER CODE TABLE)
6-27 Program Sample 14................................................................................................ 6-79
viii
Page 9
CHAPTER 1
TERMS USED IN THIS MANUAL
This chapter describes the terms used in this manual.
INPUT BUFFER AND LINE BUFFER
When the DPU-S245 (hereinafter it is referred to as “printer”) receives data (character codes and
commands) from the host devices, it stores the data in the printer input buffer . The input buffer has
a capacity of 4K bytes (4096 bytes). Then, the printer retrieves data from the input buffer. If data is
character code, data is stored into the line buffer. If data is command, data is executed as
command immediately.
The printer inputs character codes to the line buffer until the amount of character codes reaches
the amount to be printed on one line, then prints the characters. The printer repeats this operation
to print all the character data.
The relationship between the input buffer and line buffer is illustrated in Figure 1-1.
Host Device
Input Buffer
Line Buffer Print Operation
One Line of Characters
is Printed.
Figure 1-1 Relationship between Input Buffer and Line Buffer
1-byte characters and 2-byte characters
The printer can print two-size characters; 1-byte size characters and 2-byte size characters.
Table 1-1 lists the character types which can be printed by 1-byte size and 2-byte size characters.
Table 1-1 Character Types and Relationship between 1-byte and 2-byte Characters
Character Types
Katakana character (ANK)
1-byte characters
Extended graphics character (IBM Compatible)
Codepage 1252
2-byte characters Kanji, User-defined characters
* The size of a character to be printed differs depending on the font specified. (See 2.1 Printer Specifications.)
1-1
Page 10
Line Spacing
A
Line spacing is the space between the lines of printed characters (See Figure 1-2).
ABC
ABC
Line Spacing
Figure 1-2 Line Spacing
This printer use a line thermal print mechanism, therefore, a paper feed step is necessary before
printing characters or bit images.
The line feed command with printing feeds the paper for height of characters or bit images.
Therefore, a paper feed amount which is smaller than character or bit image height is ignored.
Printing with underline feeds the paper 4 dot lines in addition to the character height.
Line feeding without printing feeds the paper for specified line feed amount.
Character Spacing
Character spacing is the space between each character in the horizontal direction (See Figure
1-3).
B
Character Spacing
Figure 1-3 Character Spacing
Line
The word “line” in this manual indicates a line of characters. For example, the sentence “the printer
feeds paper one line” indicates that the printer feeds paper a line of characters.
Dot Line
The words “dot line” in this manual indicate a line of dots in the vertical direction. For example, the
sentence “the printer feeds paper by one dot line” indicates that the printer feeds paper by the
space of 1 dot.
Notation in the Technical Reference
Hexadecimal
Hexadecimal is showing as follows;
Example: 0AH (a hexadecimal unit 'H' is added behind a hexadecimal number.)
Character string
A character string is showing as follows;
Example: 'G' (a character string 'G' is enclosed with a single quotation mark.)
1-2
Page 11
CHAPTER 2
SPECIFICATIONS
2.1 PRINTER SPECIFICATIONS
Table 2-1 Printer Specifications
Item Specification
Total number of dots 384 dots/line
Effective dot number 384 dots/line
Resolution 8 dots/mm
Printing width / paper width 48 / 58mm
Printing speed Maximum 100mm/s *1
24 dots 1-byte characters :24 characters
Printing figure number
Character size
(height x width)
Character set
Interface
Input buffer size 4K bytes
Dimensions (width x depth x height) 83mm x 130mm x 45mm
Mass Approx. 280g (including the battery pack, excluding paper)
Operating temperature and humidity
range
Storage temperature and humidity
range
EMC
Regulations
The wireless
telegraph law
regulation conformity
Safety CE (LVD)
Countries under the regulations Japan, USA, Canada, EU, EFTA
*1: Using AC adapter, printing ratio is 7.5% or lower, thermal head temperature is 25°C.
*2: SII Japanese font set installed (at shipping).
*3: Only for Bluetooth-supporting model.
(right character space is 4 dots)
24 dots 2-byte characters :12 characters
(left character space is 0 dot, right character space is 8 dots)
24 dots 1-byte characters :24 x 12 dots
16 dots 1-byte characters :16 x 8 dots
24 dots 2-byte characters :24 x 24 dots
16 dots 2-byte characters :16 x 16 dots
Katakana character set *
2
Extended graphics character set
Codepage 1252 character set
JIS 1st and 2nd level of Kanji *
2
Serial (RS-232C conformity)
USB (Ver.2.0 conformity)
Infrared (IrDA Ver.1.2 / BHT-Ir protocol conformity)
Bluetooth (Ver.2.0+EDR conformity) *
3
Temperature:-10 to 50°C
Humidity: 30 to 80%RH (Non condensing)
Temperature: -30 to 70°C
Humidity: 5 to 90%RH (Non condensing)
VCCI Class B, FCC Class B, Industry Canada Class B,
CE (EMC)
FCC, IC, CE (R&TTE), Radio Law of Japan
2-1
Page 12
Dimensions
451.3
Paper
Outlet
130
75.2
9.7
63.5
83
38
Unit : mm
Figure 2-1 Dimensions
2-2
Page 13
2.2 SPECIFIED THERMAL PAPER SPECIFICATIONS
Table 2-2 Thermal Paper Provided by SII
Item Specifications
Model TP-S245L-1
Type Normal paper roll
Paper width
Outside diameter 38mm max.
Paper thickness 59±5μm
Printing surface of Paper roll Outside
Table 2-3 Specified Thermal Paper Specifications
Item Specifications
TF50KS-E2D Nippon Paper Industries Co.
TP50KJ-R Nipp on Paper Industries Co.
TL69KS-LH Nippon Paper Industries Co.
PD160R-63 Oji Paper Co., Ltd.
PD160R-N Oji Paper Co., Ltd.
P220VBB-1 MITSUBISHI PAPER MILLS LIMITED
AP50KS-FZ Jujo Thermal
AP50KS-D Jujo Thermal
Paper mode* Paper roll
AF50KS-E Jujo Thermal
F5041 Mitsubishi Hi-Tech Pap er
P5045 Mitsubishi Hi-Tech Paper
KT55F20 Papierfabrik August Koehler AG
P300 Kanzaki Specialty Papers
P350 Kanzaki Specialty Papers
KIP370 Kanzaki Specialty Papers
KIP470 Kanzaki Specialty Papers
KF50 KANZAN
KPR440 KANZAN
Paper width
58 mm
Outside diameter 38.1mm max.
Inside diameter 8mm min.
Spectral reflectivity Black, near-infrared reflectance should be 6% and below.
Printing surface of Paper roll Outside
* Use each specified thermal paper in an applicable thermal paper mode.
0
58 mm
1-
0
1-
2-3
Page 14
2.2.1 Dimensions of Timing Mark Position
7 5
58 +0/-1.0
b. Cut Position
a. Print start position
Figure 2-2 Dimensions of Timing Mark Position (Back of thermal p aper)
Unavailable
pre-print area
11
9.5
Unit : mm
2-4
Page 15
(1) Example of use of the marked paper roll
An examples of use of the marked paper roll shown Figure 2-2 is explained as below.
(a) Set the function setting of Paper Mode to “Mark Roll Paper”.
(b) Insert the thermal paper.
(c) Set the page length as the length from the beginning of the current mark to the beginning of the
next mark.
(d) Set the skip amount (non-printing area) in order to avoid printing at cutting position.
(e) Print data within the printable area.
(f) Use Form Feed command to find the beginning of the next mark.
The print start position after the beginning of the next mark is placed at position 'a', and the paper
cut position is placed at 'b' as shown in Figure 2-2.
Repeat steps (e) to (f).
(NOTE) When Mark Position Correct of SWDIP 4-5 is set as Enable, the printer operates
paper feeding to backward 5 mm just before printing proce ss after placing print
start position.
If this function set as Enable, use the marked paper roll with 40mm or longer
length of mark distance to prevent paper jamming from feeding paper backward.
2-5
Page 16
2.3 SPECIFIED BATTERY PACK SPECIFICATIONS
Item Specification
Model BP-L0715-A1-E
Available printing lines1* 20000 lines min.
Battery Cycle Life 2* 300 cycles
*1: 25C, character spacing is 4 dots, line spacing is 34 dots, TF50KS-E2D selection, print density is 100%,
continuous printing with 'H' 1-byte characters, serial communication, fully charged with 8.4 V by specified battery charger.
*2: 25C, charged in the printer with specified AC adapter, print ratio is 12.5%, charged with 70%* or more of fully charged.
* the rate in environment of 0 to 50C becomes 40% or more.
2-6
Page 17
2.4 PRECAUTIONS FOR USE
Always print the two-dimensional bar code and ladder bar code (its bar is to be printed verticality to
the printer) within 0 to 40°C to ensure the bar code's reading accuracy.
The two-dimensional bar code and ladder bar code printing always requires the low speed mode to
ensure its reading accuracy. Set the print speed to the low speed mode by using Motor Speed
Select (GS 'E') command.
The height of the ladder bar code requires over 10 mm to ensure its reading accuracy.
Be aware, in particular, that reverse printing and ruled line tend to increase the ratio.
* Parts where many black dots are used when viewed in the direction vertical to the paper feed direction.
Use of the battery pack at low temperature will run out of power in a shorter time.
When printing ruled lines, a 2-dot configuration is needed. In case of a 1-dot configuration, the
printed lines may be invisible.
Always use the printer within the shadowed range depicted in figure belo w Relationship between
Temperature and Humidity.
[% RH]
90
80
40°C, 80%RH
70
60
50
50°C, 47%RH
Humidity
40
30
20
10
0 10 20304050
[°C]
Temperature
When using a Bluetooth interface, the radio environment around the printer may cause a failure in
communications. This is due to the specifications of Bluetooth, which is a radio communications
standard.
2-7
Page 18
When handling this product, be aware of static electricity. If the static electricity is discha rged, this
could case communication failure. When this problem occurs, disco nnect the USB connector that
is connected to the host device and wait few seconds before connect it again.
When the printer is left unused for a long period of time, a white powder appears to the surface of
platen. (This is the powder by which an ingredient of a thermal paper was recrystallized.)
If the powder appears to the platen, wipe the platen with ethanol and use the printer after ethanol
has dried completely.
Also, make sure not to adhere ethanol except the platen area. If ethanol adheres except the platen
area, wipe it off immediately.
(NOTE) Refer to "SAFETY PRECAUTIONS" and "OPERAT ING PRECAUTIONS" on DPU-
S245 SERIES USER'S GUIDE which be included with the printer for other
precautions.
2-8
Page 19
CHAPTER 3
INTERFACE
This chapter describes 4 types of the interface specifications which are required to connect the host device
with the printer.
Irrespective of the interface used, amount of the input buffer in the printer is 4k bytes, and transmission
buffer is 768 bytes. If the transmission buffer becomes the condition of the buffer full, the printer waits data
processing until the buffer can be received data. Be aware that printing process does not performed in that
meantime.
3.1 SERIAL INTERFACE SPECIFICATIONS (RS-232C CONFORMITY)
Data bit length 7 bits or 8 bits
Stop bit length 1 bit or 2 bits
Parity None, odd or even
Reset Break signal input to RXD (20ms or longer)
MARK = –3.0 to –15.0 V: Logic '1'
SPACE= +3.0 to +15.0 V: Logic '0'
(2) Pin assignment
Pin No. Name I/O Function
1 N.C. - No connection
2 TXD O Sends data from the printer to the host device.
3 RXD I
4 - - Internally connected with pin No.6.
5 GND - Signal ground
6 - - Internally connected with pin No.4.
7 CTS I Outputs SPACE when the host device can receive dat a.
8 RTS O Outputs SPACE when the printer can receive data.
Receives data from the host device.
Break signal input (SPACE) resets the printer.
3-1
Page 20
(3) Connector
8
3260-8S3: HIROSE ELECTRIC CO., LTD. or equivalent
1
(4) Examples of connection with the host device (a standard personal computer)
(Shield)
(Shield)
8-pin – 25-pin 8-pin – 9-pin
(5) Data reception
Busy control
In Busy Control, RTS outputs MARK until the printer is ready to receive data after power ON.
After the printer is ready, RTS outputs SPACE and the received data is input to the input buffer.
When there are 33 bytes or less remaining in the input buffer, RTS outputs MARK. The host
device does not transmit data during RTS outputs MARK. When the input buf fer is ready to
receive data (there are 65 bytes or more in the input buffer) after stopping data reception, RTS
once again outputs SPACE. If an error occurs in the printer, RTS outputs MARK and inhibits data
entry until the error is cleared. If an error is cleared, RTS outputs SPACE again.
For RTS output when an error occurs, the setting is changed by Busy Output When Error Occurs at
function setting.
Xon/Xoff control
In Xon/Xoff control, TXD outputs Xon code (11H) from power ON until the printer is ready to receive
data. Received data is input to the input buffer. When there are 65 bytes or less remaining in
the input buffer, TXD outputs Xoff code (13H). The host device does not transmit data while Xoff
code is received. When the input buffer is ready to receive data (there are 129 bytes or more in
the input buffer) after stopping data reception, TXD once again outputs Xon code. When this
control method is selected, the RTS signal always outputs SPACE. If an error occurs in the printer,
TXD outputs Xoff code and inhibits data entry until the error is cleared. When the error is cleared,
TXD outputs Xon code again.
For Xoff code transmission when an error occurs, the setting is changed by Busy Output When
Error Occurs at function setting.
Data reception error in serial communication
When Parity is selected as Yes by the function setting, a '!' is printed next to data in which a parity
error occurred and a '?' is printed next to data in which any other error (framing error, etc.) occurred.
If a serial data reception error occurs, no error indication other than the printing of '!' and '?' is
performed (for example, the ERROR lamp does not light).
3-2
Page 21
(6) Data transmission
Busy control
In Busy Control, the conditions which transmit status information to the host device from the printer
are as follows;
When CTS Control of function setting sets to Enable, the printer sends data from TXD after
confirming CTS status as SPACE.
When CTS Control of function setting sets to Disable, the printer sends data from TXD regardless
of the condition of the host device.
Xon/Xoff control
In Xon/Xoff control, the conditions which transmit status information to the host device from the
printer is that the printer sends data from TXD regardless of the condition of the host device.
(NOTE) Be aware that if the transmission buffer becomes full, the printer does not print
until the buffer is available.
3-3
Page 22
3.2 USB INTERFACE SPECIFICATIONS
(1) General specifications
Item Specification
USB Version Ver 2.0 conformity
USB Printing class specification 1.1
Communication speed Full speed(12Mbps)
Communication protocol Bulk transfer
(2) Pin assignment
Pin No. Name I/O Function
1 Vbus - USB power supply
2 D- I/O USB data signal
3 D+ I/O USB data signal
4 N.C. - No connection
5 GND - GND
(3) Connector
5
1
Mini B type
(4) Data reception
USB data reception uses a bulk-out transfer method.
The data are received even during the printing operation, and when the data accumulate in the input
buffer by the amount of input buffer + 2 packets, the NAK response continues until amount of the input
buffer becomes 129 bytes or more.
The number of bytes that can be received with one packet is maximum 64 bytes. When an error
occurs, the NAK response continues until the error is cleared after receiving data of 2 packets.
For the operation when an error occurs, the setting is changed by Busy Output When Error Occurs at
function setting.
(5) Data transmission
USB data transmission uses a bulk-in transfer method.
The response data are stored temporarily in the transmission buffer, and a response is made to the
bulk-in packet request from the host device. If no transmission data exist, the zero length data is
returned when the bulk-in request is received. The number of bytes that can be transmitted with one
packet is maximum 64 bytes.
(NOTE) Be aware that if the transmission buffer becomes full, the printer does not print
until the buffer is available.
3-4
Page 23
3.3 INFRARED INTERFACE SPECIFICATIONS
The printer can communicate with the host device through the infrared interface.
The infrared interface used in the printer conforms to the physical layer standard (V er 1.2) specified by the
Infrared Data Association (IrDA).
The printer supports the minimum infrared transmission functions as the second station specified by IrDA
and BHT-Ir protocol specified by DENSO CORPORATION.
The printer conforms to IrDA Ver.1.2 and supports only the minimum infrared transmission functions as the
second station.
(1) Transmission specifications
Item Specification
Baud Rate9600 to 115200 bps
Data Size64 to 512 bytes
Window Size1
Additional BOFs0 to 48
Maximum Turn Around T i me500ms
Minimum Turn Around T i me10ms
Link Disconnect/Threshold Time3 to 40 s
(2) Services supported by IrLAP
1. Connect service
2. Data service
3. Disconnect service
IrLAP does not support a transfer for non-number and sniffing services.
The printer does not initiate connections.
Service Hint Printer, IrCOMM
Device Nickname DPU-S245
3-5
Page 24
(3) Services supported by IrLMP
1. Connect service
2. Disconnect service
3. Data service
A single LSAP address does not support multiple connections. Furthermore, LSAP address 7 and 9 can
not share the connection state. If multiple connections are requested, a disconnect request is
transmitted and the printer waits until it receives a disconnect command.
IAS server: LSAP address 0
IAS client: Not supported
Printer application: LSAP address 7 (3-wireraw/IrLPT) and address 9 (3-wire/9-wire)
(4) IAS service
IAS service is supported by 'GetValueByClass' only.
Return values for GetValueByClass inquiries are listed below.
1.
Inquiry Inquiry
Class Device Class IrLPT
Attribute Device Name Attribute IrDA:IrLMP:LsapSel
Return value Return value
Device Name Sll Thermal Printer Lsap address 7
2. 5.
Inquiry Inquiry
Class IrDA:IrCOMM Class IrDA:IrLMP
Attribute Parameters Attribute IrDA:IrLMP:LsapSel
Return value Return value
Service type 3-Wireraw Lsap address 7
Port type Serial
3 6.
Inquiry Inquiry
4.
Class IrDA:IrCOMM Class IrDA:IrCOMM
Attribute IrDA:IrLMP:LsapSel Attribute IrDA:TinyTP:LsapSel
Return value Return value
Lsap address 7 Lsap address 9
(5) TinyTP
Flow control is performed by this layer when connecting with 3-Wire or 9-Wire.
'5' is transferred to the primary station as the initial credit when connecting the LMP layer.
3-6
Page 25
(6) IrCOMM
Supports 3-Wireraw, IrLPT, 3-Wire and 9-Wire.
Flow control is performed only by the IrLAP layer when connecting with 3-Wireraw or IrLPT.
Flow control is performed by the TinyTP layer when connecting with 3-Wire or 9-Wire.
Xon/off control and line status control are not supported.
(7) Command response processing during IrDA transmission
If the printer receives a command that requires transmission of data from the remote station during IrDA
transmission, and then stores the data in the transmission buffer and transfers them at transmit timing to
the remote station.
The printer clears a response data in the transmission buffer when transmission to the remote station is
disconnected for busy state. When the remote station is in disconnection, the printer does not store the
data in the transmission buffer and the data is cleared.
However the printer transfers the status regardless of the remote station state when initial automatic
status transmission is enabled.
The printer transfers status when the remote station is connected again if automatic status transmission
has not deactivated by power off.
(NOTE) Be aware that if the transmission buffer becomes full, the printer does not print
until the buffer is available.
3-7
Page 26
3.3.3 BHT-Ir Specifications
The printer also supports BHT -Ir communication specified by DENSO CORPORATION.
The printer can receive data from the 'BHT-6500' made by DENSO CORPORATION when Data Input Mode
SWDIP2-1 and SWDIP2-2 is selected to BHT-Ir.
The inherent processing of the printer for BHT-Ir communication is shown below:
See BHT-Ir protocol specification for details of the protocol.
(1) ID
Printer ID: 3445H (fixed)
(2) Text format
Only text is valid.
Files with 'PD3', 'FN3' or 'EX3' extension can not be processed.
(3) Input buffer full processing when receiving header.
Upon receiving the header, the printer inhibit s connection with the host device when the remaining
amount of the input buffer becomes 512 bytes or less after subtracting the field number of the data text
indicated in heading text.
(4) Input buffer full processing when receiving data
Upon receiving data, the printer sends WACK supervisory sequence to a host device for requiring
temporarily delay of the data output from the host device as the input buffer full state when the
remaining amount of the input buffer is 255 bytes or less.
Then, the printer sends the ACK supervisory sequence to the host device to restart data transmission
when the remaining amount of the input buffer is 512 bytes or more.
The printer transfers the EOT supervisory sequence and stops when the input buffer full status
continues more than 1 minute.
(5) Command response processing during BHT-Ir transmission
No response command is transferred in BHT-Ir transmission mode.
Although response data is generated, it is discarded.
3-8
Page 27
3.4 BLUETOOTH INTERFACE SPECIFICATIONS
Bluetooth-supporting model can perform wireless communication by Bluetooth communication function.
When Data Input Mode of the function setting is set to Bluetooth/USB, internal Bluetooth module of the
printer operates regardless of its communication method.
When using the printer at the place with radio limitations like a hospital or an airplane, set Data Input Mode
of the function setting as Serial/USB or IrDA/USB to stop Bluetooth communication.
(1) General specifications
Item Specification
Bluetooth version 2.0+EDR comformity
Transmitted electric power class Class 2
Connection mode Peer-to-peer
Profile SPP
PIN code1* None (default)
Device name1* DPU-S245 (default)
*1: can be changed by the command
(2) Security
The printer does not set with PIN code or the Link Key in default. Bluetooth device uses security mode 1,
so no encryption is used.
Bluetooth device becomes security mode 3 if PIN code is set by Set default/Set test print header
command or Bluetooth Link Key selection of the function setting is set to Enable, and encryption is used.
When the setting of Bluetooth Link Key is Disable and selection of PIN code is canceled, Bluetooth
device becomes security mode 1 again, and no encryption is used.
(3) Input buffer
Capacity of input buffer for internal Bluetooth module is 3Kbytes. Received data is stored in the input
buffer of Bluetooth module, and then these data is to be processed after data transfer to the input buffer
of the printer.
If an error occurs, the printer stops receiving data after data that stored into input buffer of Bluetooth
until the error is cleared.
For the operation when an error occurs, the setting is changed by Busy Output When Error Occurs at
function setting.
(NOTE) Be aware that if the transmission buffer becomes full, the printer does not print
until the buffer is available.
(4) Link key saving
If the Bluetooth Link Key selection of the function setting is set to Enable, the printer saves the link key
to connect with the host device in the pairing process.
The host devices can be saved up to 10. When requiring to save the 11th host device, perform the
pairing after clearing the saved host devices in the printer.
To clear the all of saved host device data, set the Bluetooth Link Key selection of the function setting as
Disable after setting Data Input Mode of the function setting as Bluetooth. The printer clears the stored
host device data after the above process.
3-9
Page 28
CHAPTER 4
FUNCTION SETTINGS
4.1 FUNCTION SETTING
The communication method, a paper types, and so on can be preset in this printer.
Preset these functions before using the printer.
The function settings of the printer are stored in FLASH memory. Once these are set, these are stored until
changing again.
The function settings are specified through the software DIP switch (hereinafter referred to as SWDIP
switch), SWDIP1 to 4.
Details for settings of SWDIP 1 to 4 are descri bed below. The value that is indicated by boldface and shaded
cell show a default setting value. The words in parentheses in the table are indicated in test print.
4-1
Page 29
4.1.1 Function Settings(SWDIP1)
Table 4-1 Function Settings (SWDIP1)
SWDIP Function
0 1
1-8 Data Control Xon/Xoff
1-7 Stop Bit 2 bits
1-6
1-5
1-4 Bit Length 7 bits
1-3
1-2
1-1
Data Control selection
Select flow control in serial communication as BUSY (hardware) control or Xon/Xoff control.
In BUSY control, flow control is performed using RTS signal in the printer.
In Xon/Xoff control, flow control is performed using codes of Xon(11H) or Xoff(13H) from the printer.
Stop Bit selection
Select Stop Bit in serial communication as 1 bit or 2 bits.
Parity See table below
Baud Rate See table below
Value
Busy
1 bit
8 bits
Parity selection
Select Parity in serial communication as Even, Odd or None.
Parity SWDIP1- 6 SWDIP1-5
None 0 0
Odd 0 1
None 1 0
Even 1 1
Bit Length selection
Select Bit Length in serial communication as 8 or 7 bits.
4-2
Page 30
Baud Rate selection
Select Baud Rate of communications as Serial and BHT-Ir.
Baud Rate SWDIP1-3 SWDIP1-2 SWDIP1-1
1200* 0 0 0
2400 0 0 1
4800* 0 1 0
9600 0 1 1
19200 1 0 0
38400 1 0 1
57600 1 1 0
115200 1 1 1
* This setting is enabled only when Serial is selected as the communication mode.
When BHT-Ir is selected as the communication mode, the baud rate is set to 2400 bps automatically.
4-3
Page 31
4.1.2 Function Settings(SWDIP2)
Table 4-2 Function Settings (SWDIP2)
SWDIP Function
0 1
2-8 Auto Status Output Enable
2-7 Kanji Code Shift-JIS Code
2-6 Font Size 16 dots
2-5 Auto Power Off Enable
2-4 Character Set IBM Compatible
2-3 Reserved Fix to 1
2-2
2-1
Auto Status Output selection
When Auto Status Output selection sets to Enable, the printer sends printer status to the host
device every one second.
Refer to the descriptions of Automatic Status Response (DC2 'e') co mmand for the code to be sent.
Moreover, refer to 6.7 INITIAL AUTOMATIC STATUS TRANSMISSION for more details.
Data Input Mode See below
Value
Disable
JIS Code
24 dots
Disable
ANK
(NOTE) When this function set to Enable, the printer keeps on storing data into the
transmission buffer if the printer status is not receiv ed.
The condition of the transmission buffer as buffer full may not work because
status data can not be created. Note that the printer does not perform printing
processing until the transmission buffer full is cleared.
Kanji Code selection
Select Kanji Code in default as JIS Code or Shift-JIS Code. This setting can be changed by Select
Kanji code system (FS 'C') command (6.5.11 Kanji Character Set Selection Command).
Font Size selection
Select Font Size in default as 16 or 24 dots. This setting can be changed by Select character font
size (DC2 'F' ) command (6.5.24 Character Set Command).
Auto Power Off selection
When Auto Power Off selection sets to Enable, the printer turns itself off after passing a set time.
This setting can be changed by Set default/Set test print header (DC2 'i' ) command (6.5.25
Auxiliary Function Commands ). The default value is 30 minutes.
Character Set selection
Select Character Set as IBM compatible or ANK. This setting can be changed by Select character
code table (ESC 't') command (6.5.7 1-byte Character Set Selection Commands). See Appendix A
CHARACTER CODE for character code.
4-4
Page 32
Data Input Mode selection
Select the communication method. Refer to CHAPTER 3 INTERFACE for more detail.
Data Input Mode SWDIP2-2 SWDIP2-1
BHT-Ir/USB 0 0
Serial/USB 0 1
IrDA/USB 1 0
Bluetooth/USB * 1 1
* This setting is enabled for Bluetooth-supporting model only.
Bluetooth-supporting model is shipped with this setting value (Bluetooth/USB).
4-5
Page 33
4.1.3 Function Settings(SWDIP3)
Table 4-3 Function Settings (SWDIP3)
SWDIP Function
0 1
3-8 Paper Mode See table below
3-7
3-6
3-5
3-4
3-3
3-2
3-1
Paper Mode selection
Select Paper Mode as the thermal paper in use.
Print Density See table below
Paper Select See table below
Paper Mode SWDIP3-8
Roll Paper 0
Mark Roll Paper 1
Value
(1) Roll Paper mode
This mode assumes that to print the thermal paper roll.
(a) Process of out-of-paper detection
The printer processes the error operation by lighting the lamp if out-of-paper error detected.
(2) Mark Roll Paper mode
This mode assumes that to print the thermal paper roll with the printed mark at regular intervals on the
back side which to detect paper position. Refer to 2.2 SPECIFIED THERMAL PAPER SPECIFICATION
for the paper roll dimensions.
(a) Process of out-of-paper detection
The printer processes the error operation by lighting the lamp if out-of-paper error detected.
4-6
Page 34
Print Density selection
Normally, select the print density as 100%.
Print Density SWDIP3-7 SWDIP3-6
95% 0 0
100% 0 1
105% 1 0
110% 1 1
(NOTE) If too much energy is applied to the thermal head, it would shorten its life span and
cause the paper feed problem. Set an accurate thermal paper selection and print
density.
If selecting the thermal paper that is different from the one specified in the thermal
paper selection or in case of not setting the print density in 100%, verify the
performance with your actual device before printing.
Thermal Paper selection
Select the thermal paper by Paper Select.
Paper Select SWDIP3-5SWDIP3-4SWDIP3-3SWDIP3-2 SWDIP3-1
This function is set to Enable, the printer saves the link key from the host device to connect in the
pairing process. When once a pairing is performed for the host device, the printer can connect to
the host device using the link key from the next time without a pairing.
If this function is set to Enable and PIN code is not specified in advance, the printer processes PIN
code as '0000'.
Value
0 1
4-8
Bluetooth Link Key Selection
(Bluetooth Link Key)
Enable Disable
4-7 Reserved Fix to 1
4-6
Busy Output When Error
Occurs (Error)
Unbusy
4-5 Mark Position Correct Enable
4-4
Bluetooth Baud Rate See below
4-3
4-2 CTS Control
4-1 Auto Activation by AC
Enable
Enable
Busy
Disable
Disable
Disable
Busy Output When Error Occurs
This function can select whether data reception be comes busy status or not when an error occurs.
If this function is disabled, data reception does not become busy status while an error occurs and
data reception is available.
However, regardless of this setting if receiving buffer become s full, data reception turns to busy
status.
Mark Position Correct selection
When Mark Position Correct selection sets to Enable and Paper M ode SWDIP3-8 is selected to
Mark Roll Paper, the printer feeds the paper roll in backward as following conditions:
Beginning of a printing right after power-on or resetting.
Beginning of a printing right after performance paper home feed by FEED switch or page
feed execution.
To use this function, there are several restrictions. Refer to 2.2 SPECIFIED THERMAL PAPER
SPECIFICATION.
4-8
Page 36
Bluetooth Baud Rate selection
Select Bluetooth Baud Rate in Bluetooth communication. Usually, select Bluetooth baud rate to
230400bps.
Bluetooth Baud Rate SWDIP4-4 SWDIP4-3
230400 bps 0 0
57600 bps 0 1
115200 bps 1 0
230400 bps 1 1
CTS Control selection
When CTS Control selection sets to Enable and Data Control SWDIP1-8 is selected to Busy, the
printer transmits data after identifying CTS of the host device as SPACE.
When CTS Control selection sets to Disable or selecting serial communication as Xon/Xoff control,
the printer transmits data regardless of status of the host device.
Auto Activation by AC selection
When Auto Activation by AC selection sets to Enable, the printer turns the power on after plugging
specified AC adapter to the outlet.
4-9
Page 37
4.1.5 Function Settings by Switch Operation
A function setting can be performed by switch operation.
Use the function settings by switch operation in the function settings mode of the printer.
Operate the following procedures to enter the printer to the function settings mo de.
(a) Be sure that the thermal paper is set to the printer and the printer is turned off. If the thermal
paper is not set, set the thermal paper to the printer.
Hint
When an error occurs during the function settings mode, the printer exits the function
setting mode and returns to the power off after blinking the POWER and ERROR lamps.
Therefore, the function setting mode exits the function setting mode if out-of-paper error
occurs in settings. So set the thermal paper of length enough to prevent from occurring an
error.
(b) Press the POWER switch and the FEED switch on the printer at the same time until the
POWER lamp and ERROR lamp light.
Keep on pressing the POWER and FEED switches until two lamps blink in six seconds, and
then release the POWER and FEED switches immediately.
(c) When the following message is printed, press the FEED switch.
Select Function
Setting Mode: Feed SW
HEX Dump Mode: Power SW
Hint
When the POWER switch is pressed at this time, the printer becomes in HEX dump mode.
If you do not press any switch within 30 seconds after a message is printed, the printer
turns off.
When the POWER and ERROR lamps start to blink, release your finger from the POWER
and ERROR switches within 5 seconds. If it is ongoing, the printer exits function setting
mode. In such a case, turn the power off and try the procedure from (a) again.
(d) When the following message is printed, press the FEED switch.
[SETTING MODE]
Yes: Feed SW / No: Power SW
Hint
If the POWER switch pressed, the printer exits the function setting mode and turns the
power off.
If you do not press any switch within 30 seconds after a message is printed, the printer
turns off.
The printer becomes in the function settings mode and becomes i n the state of waiting for switch operation.
In the function setting mode, you can initialize or modify settings. To set the settings to defaults, perform
operation (1). To change settings, perform operation (2).
4-10
Page 38
(1) Initializing SWDIP switch settings
(a) When the following message is printed in the function setting mode, press the FEED switch.
Load Default Setting?
Yes: Feed SW / No: Power SW
(b) When the following message is printed, the printer turns off.
The settings are set to defaults. Initialization is complete.
Default Setting Saved.
Setting Mode Finished.
(2) Changing SWDIP switch settings
(a) When the following message is printed in the function setting mode, press the POWER switch.
Load Default Setting?
Yes: Feed SW / No: Power SW
Hint
There are SWDIP switches from 1 to 4 in the printer, so set 8 bits within SWDIP switches
respectively.
In function setting mode, the POWER lamp blinks once by pressing either the POWER
switch or the FEED switch. Be sure to confirm the POWER lamp blinking in order to
ensure proper operation.
Operation 1: SWDIP switch selection
(a) If pressing the FEED switch after printing the message shown below, the function setting shifts
operation 2.
If pressing the POWER switch instead of the FEED switch, the details of the printed SWDIP
switch (SWDIP switch 1 in this operation) are not changed, and the next SWDIP switch is
selected (operation 1).
"********" in the message indicates the setting of the SWDIP switch. The leftmost bit is the
most significant bit (SWDIP*-8) and the rightmost bit is the least significant bit (SWDIP*-1).
If SWDIP switches 1 to 4 are skipped, the function setting mode can be terminated
(operation 3).
4-11
Page 39
Operation 2: SWDIP switch setting
(a) When the message shown at the following is printed, set the bits from the most significant bit
(SWDIP*-8) to the least significant bit (SWDIP*-1).
Input 8 bits.
1: Feed SW / 0: Power SW
To set 1: Press the FEED switch.
To set 0: Press the POWER switch.
For example, to set 10101110, press the switches in the following sequence:
FEED, POWER, FEED, POWER, FEED, FEED, FEED, POWER.
(b) When the switches are pressed eight times (for eight bits), the following message is printed.
DIP SW-1=********”
Save Setting?
Yes: Feed SW / No: Power SW
When the FEED switch is pressed, the message shown at the following is printed, and the setting is
saved.
DIP SW-1=******** Saved.
When pressing the POWER switch instead of the FEED switch, the message shown at the following is
printed and the setting is not changed.
DIP SW-1 Not Changed.
After this operation, the function setting shifts next SWDIP switch (operation 1). After setting SWDIP switch 4,
the setting function exits setting mode (operation 3).
Operation 3: Exiting function setting mode
(a) If pressing the FEED switch after printing the message shown below, the function setting shifts
operation 1.
DIP Switch setting mode.
Continue: Feed SW
Quit: Power SW
If pressing the POWER switch after printing the message shown below, the printer exits the function
setting mode and turns off. The function setting is now compl ete.
Setting Mode Finished.
4.1.6 Function Settings by Commands
The command is transmitted to the printer by selected communication.
For details of commands, refer to Function Settings (DC2 ’k’) command (“6.5.25 Auxiliary Function
Commands”).
4-12
Page 40
4.2 TEST PRINT
The printer has a test print function that prints the contents of the Function Settings and character strings for
test.
(a) Be sure that the thermal paper is set to the printer and the printer is turned off. If the thermal
paper is not set, set the thermal paper to the printer.
(b) Press the POWER switch and the FEED switch on the printer at the same time until the
POWER lamp lights, release the POWER switch first and then the FEED switch second.
(c) The test print is performed.
(d) The printer goes to print-ready status after test printing is completed.
4-13
Page 41
4.3 HEX DUMP MODE
This function can be used to check whether the host device transmits data to the printer correctly. Perform
the following steps.
(a) Be sure that the thermal paper is installed to the printer and the printer is turned off.
(b) Keep on pressing the POWER and FEED switches in six seconds.
(c) Release the POWER and FEED switches after blinking the POWER and ERROR lamps.
(d) Press the POWER switch after printing the message below.
Select Function
Setting Mode: Feed SW
HEX Dump Mode: Power SW
(e) After printing the message below, the printer enters a HEX dump mode.
[HEX DUMP MODE]
The example of printing using BASIC is shown below:
Input data from host computer. The data input through the printer interface is printed as hexadecimal
code, 8 bytes at a time. If the input buffer contains less than 8 bytes of data, it is printed when the FEED
switch is pressed.
8 bytes
Input PRINT#1,"abcdef" to the host computer and press the Return key.
The printer prints 'abcdef' in hexadecimal number and two co ntrol codes (0DH and 0AH).
OK
PRINT #1 ," abcdef ”
Less than 8 bytes
Host device
[HEX DUMP MODE]
61 62 63 64 65 66 0D 0A
Printer
Input PRINT#1,"abc" to the host computer, press the Return key , and then press the FEED switch.
The printer prints 'abc' in hexadecimal number and two control codes (0DH and 0AH).
OK
PRINT #1 ," abc
Host device
"
4-14
[HEX DUMP MODE]
61 62 63 0D 0A
Printer
Page 42
(f) Press the POWER switch to exit the HEX dump printing.
Hint
Some BASIC use a PR# statement instead of PRINT#. Refer to the computer manual for
details on BASIC.
4-15
Page 43
CHAPTER 5
LAMP DISPLAY AND SWITCH FUNCTION
This chapter explains printer status by lamp display and functions of switches.
5.1 PRINTER STATE LAMP DISPLAY
Table 5-1 lists states of the printer, display that by two lamps (POWER and ERROR lamps).
Table 5-1 Printer Status Signals
Printer status Error
Power OFF - Off Off
Power ON (Print-ready) - On Off
Initializing - On On
Out-of-paper error Thermal paper is not inserted On Blink
Paper cover open error Paper cover is opened On Blink twice
Battery low, power failure
Thermal head temperature
error
Power supply voltage is out of the
stipulated range
Thermal head temperature is out
of the stipulated range
1*
2*
Recharging Battery pack is recharging Blink Off
Function setting mode
Mode where function settings can
be set
Function setting mode shifting - Blink Blink
FLASH memory accessing FLASH memory is operating Short blink Short blink
Hardware error Error occurs in hardware Off Blink
*1: Range of stipulated power supply voltage is 6.5V≦power supply voltage ≦9.7V *2: Range of stipulated temperature is -10°C≦ head temperature ≦80°C
Display
POWER ERROR
Blink On
Blink twice On
Off On
Display Pattern ○: On, ─: Off
Items Pattern
Blink
Short blink
Blink twice
─ ○ ─ ○ ─ ○ ─ ........
○─○─○─○─○─○─○─○─○─○........
○─○ ─ ○─○ ─ ○─○ ─ .......
5-1
Page 44
5.2 ERROR RECOVERY PROCEDURE
When an error occurs, the printer stops printing operation. Moreover, when Busy Output When Error Occurs
is enabled in the Function Settings, the status of data reception becomes busy.
However, some errors can be recovered to a status just before a printing stop after clearing errors.
Error recovery procedure is shown below.
In this case, the printer resumes the printing from next line or next dot line a print stopped.
Table 5-2 Error Recovery Procedure
Item Recovery Procedure
Open the paper cover and replace the thermal paper. Close
Out-of-paper
Paper cover open
Thermal head temperature error
Power failure
Hardware error Non-recoverable error
*1: Range of stipulated temperature is -5°C≦ head temperature ≦ 75°C
*2: Range of stipulated power supply voltage is 6.5V≦power supply voltage ≦9.7V
the paper cover, so the printer returns to print-ready status
automatically one second later.
Close the paper cover, so the printer returns to print-ready
status automatically one second later.
The printer returns to print-ready status automatically if
thermal head temperature becomes within the stipulated
range.
Return the power supply voltage to the stipulated range, and
then press the FEED switch.
1*
2*
5-2
Page 45
5.3 POWER SWITCH
Turning ON / OFF the printer and changing the mode to the print-ready can be performed by the POWER
switch.
(NOTE) Always use the POWER switch to turn off the printer.
Do not power off the printer by removing the AC adapter or the battery pack. If
doing so, the memory may be damaged.
5.4 FEED SWITCH
The paper can be fed by the FEED switch.
The action differs depending upon SWDIP3-8 of the function settings.
Roll Paper mode
The printer feeds a small amount of thermal paper by pressing this switch once and the switch is
held down, the thermal paper is fed continuously.
Mark Roll Paper mode
The printer feeds the paper until paper mark detection by pressing this switch once.
The printer stops its operation if the printer does not detect the mark after feeding the thermal
paper up to paper length which is set.
The amount of maximum paper length to mark detection can be set by Set default/Set test print
header (DC2 'i') command (6.5.25 Auxiliary Function Commands). The default value is 300 mm.
The printer does not feed the thermal paper if pressing FEED switch in the following case.
When the paper cover opens
When power supply voltage is larger than 9.7V.
When the printer is in the download mode. (For the download mode, refer to 6.5.26 Download
Mode)
5-3
Page 46
CHAPTER 6
COMMAND DESCRIPTIONS
This chapter describes the functions of the commands supported by the printer.
6.1 THE SUMMARY OF COMMAND FUNCTION
The commands of DPU-S245 conform to the ESC/P.
Table 6-1 Command Summary (1/4)
Command Function Page
ESC 'C' Set Page Length at n Lines 6-19
ESC 'C' 0 Set Page Length at n Inches 6-19
ESC 'N' Set Bottom Margin 6-19
ESC 'O' Cancel Bottom Margin 6-20
ESC 'Q' Set Right Margin 6-20
ESC 'l' Set Left Margin 6-21
ESC '0' Set 1/8-inch Line Spacing 6-23
ESC '2' Set 1/6-inch Line Spacing 6-23
ESC '3' Set n-dot-line Line Spacing 6-23
ESC 'B' Set Vertical Tab Positions 6-25
ESC 'D' Set Horizontal Tab Positions 6-26
CR Print and Carriage Return 6-27
LF Print and Line Feed 6-27
FF Page Feed (form feed) 6-27
ESC 'J' Print and Feed Paper 6-28
GS '<' Marked Paper Form Feed 6-28
HT Execute Horizontal Tab 6-29
VT Execute Vertical Tab 6-29
ESC '$' Set Absolute Position 6-29
ESC '\' Set Relative Position 6-29
6-1
Page 47
Table 6-1 Command Summary (2/4)
Command Function
Page
ESC 'R' Select International Character 6-31
ESC 't' Select Character Code Table 6-31
DC2 'y' Euro Character Specify 6-32
ESC '%' Set/Cancel Download Character Set 6-34
ESC '&' Define Download Characters 6-34
DC2 'D' Download Characters Area Operation 6-35
SO Select Expanded Character Mode with Automatic Cancellation 6-36
DC4 Cancel Expanded Character Mode with Automatic Cancellation 6-36
ESC 'W' Select/Cancel Expanded Character Mode 6-36
ESC 'w' Select/Cancel Double Height Mode 6-36
ESC 'E' Select Emphasized Print Mode 6-36
ESC 'F' Cancel Emphasized Print Mode 6-37
ESC 'G' Select Double Print Mode 6-37
ESC 'H' Cancel Double Print Mode 6-37
ESC '-' Select/Cancel Underline Mode 6-37
ESC '!' Set Print Mode 6-38
DC2 'Y' Character Rotation 6-39
ESC SP Set Character Spacing 6-40
FS '&' Select Kanji Mode 6-43
FS '.' Cancel Kanji Mode 6-43
FS 'C' Select Kanji Code System 6-43
FS 'r' Select Kanji Quarter Size Character Mode 6-44
FS DC2 Cancel Kanji Quarter Size Character Mode 6-44
FS '2' Define User-defined Character 6-45
DC2 'G' User-defined Character Area Operation 6-46
FS 'J' Select Vertical Writing 6-47
FS 'K' Select Horizontal Writing 6-47
FS 'W' Select/Cancel Quadruple-size Kanji Character 6-47
FS '-' Select/Cancel Kanji Underline Mode 6-48
FS '!' Set Kanji Print Mode 6-49
FS 'S' Set Kanji Left- and Right-side Spacing 6-50
ESC '*' Set Bit Image Mode 6-53
GS 'v' '0' Raster Bit Image Print 6-55
DC2 'T' Stamp Define 6-58
DC2 'S' Stamp Select 6-59
DC2 'V' Stamp Print Out 6-59
DC2 'W' Stamp Abort 6-59
DC2 'U' Stamp Clear 6-59
CAN Cancel Print Data in Buffer 6-61
6-2
Page 48
Table 6-1 Command Summary (3/4)
Command Function
Page
DC3 '+ Ruler Line ON 6-62
DC3 '-' Ruler Line OFF 6-62
DC3 'A' Ruler Line Buffer A 6-62
DC3 'B' Ruler Line Buffer B 6-62
DC3 'C' Ruler Line Buffer Clear 6-63
DC3 'D' Define Ruler Line by Dot 6-63
DC3 'F' Define Ruler Line with Repeating Patterns 6-63
DC3 'L' Define Ruler Line by Line 6-63
DC3 'V' Ruler Line LSB/MSB Image 6-64
DC3 'P' Print One Dot Line after Printing Line Buffer Data 6-64
DC3 '(' Continuous Ruler Line Command Input 6-64
DC2 'P' Define Optional Font 6-66
DC2 'O' Select Optional Font 6-67
DC2 'Q' Erase Optional Font 6-67
GS 'H' Select HRI Character Print Position 6-69
GS 'f' Select HRI Character Font 6-69
GS 'h' Set Bar Code Height 6-69
GS 'k' Print Bar Code 6-70
GS 'w' Set Width of Bar Code 6-71
GS 'P' Set Bar Code Print Position 6-71
GS 'n' Nominal Fine Element Width 6-71
GS 'o' PDF Row Height 6-72
GS 'p' 0 PDF417 Print 6-72
DC2 ';' QR Code and Data Matrix Module Sizes 6-73
GS 'p' 1 QR Code Print 6-73
GS 'p' 2 Data Matrix Print 6-74
GS 'p' 3 Maxi Code Print 6-75
DC2 'E' 0 Set Routine Format 6-81
DC2 'E' 1 Set Routine Parameter Data 6-83
DC2 'E' 2 Execute Routine Format 6-84
DC2 'E' 3 Delete All Routine Data 6-84
DC2 'z' 0 Page Mode Select 6-86
DC2 'z' 1 Page Mode Print 6-87
DC2 'z' 2 Page Mode Vertical Position Specify 6-87
DC2 'z' 4 Page Mode Data Registration 6-87
DC2 'z' 5 Page Mode Data Calling 6-87
6-3
Page 49
Table 6-1 Command Summary (4/4)
Command Function
Page
DC2 '$' '1' Rectangle Print 6-88
DC2 '$' '2' Line Type Property 6-89
DC2 '$' '3' Line Width Property 6-89
DC2 '$' '4' Fill Property 6-89
DC2 'e' Enable/Disable Automatic Status Transmission 6-91
Function codes may or may not have parameters or image data.
The number of bytes per command differs based on the type of command. Some commands are only 1 byte
long, while some are up to several hundred bytes in length.
6.3 CHARACTER CODES
This section describes character codes.
The character code range and User-defined character codes are different depending on JIS code system or
Shift JIS code system which is selected with the Kanji Code System Select command (FS 'C').
6.3.1 JIS Code System
When the JIS Code System is selected with the Kanji Code System Select command (FS ‘C’), Kanji
characters
can be printed using 2-byte character codes after Kanji mode is selected with the Kanji Mode Specify
command (FS '&').
The command functions as 1-byte character code or the first or second byte of 2-byte character code.
If a command is input in 2-byte character codes, the next data is always processed as the first byte. However,
the next data is 1-byte character code for Cancel Kanji Mode, FS '.'.
If a command is input as the second byte of 2-byte character code, the first byte is ignored.
(1) 1-byte character codes
00H - 1FH: Commands are processed as commands.
20H - 7EH: The codes are processed as 1-byte character code.
7FH: Ignored (except that when 7FH is defined as downloaded character and download
character operation is effective).
80H - FEH: The codes are processed as 1-byte character code.
FFH: It differs from each character set.
If the extended graphics character set or the katakana character set are selected,
they are ignored.
If the Codepage 1252 is selected, it is processed as the character code.
(2) 2-byte character codes
2-byte character codes specify Kanji characters, Kanji quarter size characters or User-defined
characters.
- First byte
00H: 1-byte character area in Kanji ROM. Specify the 1-byte character in the Kanji ROM
with the next data of 00H.
21H - 76H: 2-byte character area.
77H: User-defined character area.
78H - 7EH: 2-byte character area.
If the codes other than the above are not commands, these codes are ignored.
The next data to be received is processed as the first byte.
6-5
Page 51
- Second byte
(If the first byte is 00H)
20H - 7EH: The codes are processed as 1-byte character in the Kanji ROM.
80H - FEH: The codes are processed as 1-byte character in the Kanji ROM.
FFH: It differs from each character set.
If the extended graphics character set or the katakana character set are selected,
they are ignored with the first byte.
If the Codepage 1252 is selected, it is processed as the character code.
(If the first byte is not 00H)
21H - 7EH: The codes are processed as the second byte of Kanji characters or user-defined
characters.
If the codes other than the above are not commands, these codes are ignored with the first byte. The next
data to be received is processed as the first byte.
The codes not defined as JIS or special characters in the 2-byte character area are processed as 2-byte
character spaces.
Printed 2-byte character code conforms to JIS X 0208-1997.
(3) 2-byte character codes when mounting Korean character
2-byte character codes specify Korean or User-defined characters.
- First byte
00H: 1-byte character area. Specify the 1-byte character with the next data of 00H.
77H: User-defined character area.
A1H - FDH: Korean character area.
If the codes other than the above are not commands, these codes are ignored with the first byte.
The next data to be received is processed as the first byte.
- Second byte
(If the first byte is 00H)
20H - 7EH: The codes are processed as 1-byte character code.
80H – FEH: The codes are processed as 1-byte character code.
FFH: It differs from each character set.
If the extended graphics character set or the katakana character set are selected,
they are ignored with the first byte.
If the Codepage 1252 is selected, it is processed as the character code.
(If the first byte is 77H)
21H - 7EH: The codes are processed as the second byte of user-defined characters.
6-6
Page 52
(If the first byte is A1H to FDH)
A1H - FEH: The codes are processed as the second byte of Korean.
If the codes other than the above are not commands, these codes are ignored with the first byte.
The next data to be received is processed as the first byte.
6.3.2 Shift JIS Code System
If the Shif
t JIS Code System is selected with the Kanji Code System Select command, Kanji characters can be
printed with 2-byte character codes without entering the Kanji Mode Specify command.
The command functions as 1-byte character code or the second byte of 2-byte character code.
If a command is input for the second byte of 2-byte character code, the first byte is ignored.
(1) 1-byte character codes
00H - 1FH: Commands are processed as commands.
20H - 7EH: The codes are processed as 1-byte character code.
7FH: Ignored (except that when 7FH is defined as downloaded character and download
character operation is effective).
80H - FEH: See (2).
FFH: It differs from each character set.
If the extended graphics character set or the katakana character set are selected,
they are ignored.
If the Codepage 1252 is selected, it is processed as the character code.
(2) 2-byte character codes
2-byte character codes specify Kanji and User-defined characters.
- First byte
81H - 9FH: 2-byte character area.
E0H - EBH: 2-byte character area.
ECH: User-defined character area.
EDH - EFH: 2-byte character area.
The other codes 80H - FEH are processed as 1 byte characters.
- Second byte
40H - 7EH: The codes are processed as the second byte of Shift JIS code or user defined
character.
80H - FCH: The codes are processed as the second byte of Shift JIS code or user defined
character.
If the codes other than the above are not commands, these codes are ignored with the first byte.
The codes not defined as Shift JIS or special characters in the 2-byte character area are processed as
2-byte character spaces.
6-7
Page 53
(3) 2-byte character codes when mounting Korean character
2-byte character codes specify Korean or User-defined characters.
- First byte
A0H: User-defined character area.
A1H - FDH: Korean characters area when selecting Korean.
The codes other than the above are ignored and processed as 1-byte character.
- Second byte
(If the first byte is A0H)
A1H - FEH: The codes are processed as the second byte of user-defined characters.
(If the first byte is A1H-FDH)
A1H - FEH: The codes are processed as the second byte of Korean.
If the codes other than the above are not commands, these codes are ignored with the first byte.
The next data to be received is processed as the first byte.
6-8
Page 54
6.4 MEMORY
Check remaining memory size when using optional fonts, routine command or stamp. Refer to this section to
use those functions.
6.4.1 External RAM Memory
(1) Memory
area
The printer has 232280 bytes of memory for User-defined characters, downloaded characters, optional
fonts, routine command and stamp.
Set or clear memory area for each function.
Setting of the memory area means to create a partition for certain function exclusively.
Clearing the memory area means to remove a partition for a certain function.
Usually users do not need to check it, however, make sure that the required memory does not exceed the
remaining memory size when using optional fonts, routine command, and stamp.
The following memory sizes shown in Table 6-2 are set right after initialization.
able 6-2 Memory Sizes Right After Initialization
T
Uses
Memory size
(bytes)
Availability of clear
User-defined characters 9784 Available
Downloaded characters 6248 Available
Optional fonts 0 Available
Routine command (DC2 'E')0 Available
Stamp 0 Available
Memory area of User-defined characters and downloaded characters are set at initialization.
Memory area can be cleared by a command and can be increased for optional fonts, routine command or
stamp.
When registering optional fonts, routine command or stamp, always check the remaining memory size.
Registering data that exceeds the remaining memory size is ignored.
When setting optional fonts, fixed size format, fixed size parameters, or memory area is set automatically
by command input.
When setting memory area, memory control information is always added to the head of the memory area.
Number of bytes for memory control information differs according to each function. The number of bytes
for memory control information is shown in Table 6-3.
able 6-3 Number of Bytes for Memory Control Information
T
Uses Number of bytes
User-defined characters 8
Downloaded characters 8
Optional fonts 12
Routine command (DC2 'E') 10
Stamp 11
6-9
Page 55
(2) Capacity of memory size
Allocated memory size depend on used function. User-defined character and downloaded character is
allocated size of 9784 and 6248 bytes respectively. Optional fonts, routine function or stamp is allocated
size of (number of data + Memory control Information). Moreover, registration of routine function and
stamp requires the above-mentioned size per registration data.
(3) Precautions for stamp function
Do not use the commands such as which to be allocated or freed as listed below during stamp operation.
Table 6-4 Commands for Allocating or Freeing Memory Area
Command Command name
DC2 'T' Stamp Define
DC2 'U' Stamp Clear
DC2 'P' Define optional font
DC2 'Q' Erase optional font
DC2 'E' 0 Set routine format
DC2 'E' 1 Set routine parameter data
DC2 'E' 3 Delete all routine data
DC2 'z' 0 Page Mode Select
DC2 'D' Downloaded characters area operation
DC2 'G' User-defined character area operation
DC2 'R' User Area Initialization
If the commands listed in Table 6-4 are input during selection of the stamp, the stamp selection is
canceled.
(4) Initialization of memory
The printer does not erase the content of the memory using the AC adapter or the battery pack with active
voltage even if Reset command or Power off command is input or the printer is turned the power off.
However, the printer initializes the memory during its next start-up when disconnecting the power supply
or executing the User Area Initialization command.
(5) Memory usage at two-dimensional bar code function
At two-dimensional bar code print, empty area of the external RAM is used temporarily at bar code print.
The two-dimensional bar code printing performs depending on their parameter, available memory
capacity and settable data size as described below:
When the parameter of the command is outside the range:
CPU ignores the part outside and processes the remaining data as normal codes.
When the available memory capacity is short:
All of data is processed as normal code.
When the command is normal and memory area has been allocated but the data more than
maximum data size is specified:
All of the data is discarded. Since settable data size varies depending on the type of
two-dimensional bar codes, refer to each explanation of two-dimensional bar code commands.
Moreover, note that settable data size changes in accordance with the value of specified parameter.
6-10
Page 56
When the command is normal and memory area has been allocated, but the bar code cannot be
printed within printable area:
The command is ignored.
When the command is normal, memory area has been allocated and the bar code can be printed
within printable area:
The two-dimensional bar code is printed.
The necessary empty capacity differs according to types and sizes of bar codes.
(a) Used Memory Capacity of PDF417
The total empty area of area 1 to 4 shown in Table 6-5 is necessary for PDF417 print.
For an example, when number of bar code dat
a byte =15, error correction level=3, number of column
Area4 = (8+7) 202 = 600 bytes
Total = 2696 bytes
(Empty area size: Even number of bytes)
Table 6-5 GS 'p' 0 Used Memory Capacity of PDF417 Print Command
Area Memory Usage
Area1 N+1 bytes1*
Area2 2048 bytes
()
Area3 2
2L+
bytes2*
Area4 (C+7)R2 bytes3*
*1: N: Number of bar code data byte
When empty capacity of the external RAM is an odd number, one more byte is necessary.
When N+1 is an odd number, one more byte is necessary.
*2: L: Error correction level
*3: C: Number of column, R: Number of row
6-11
Page 57
(b) Used Memory Capacity of QR Code
[
]
The total empty area of area1 to 3 shown in Table 6-6 is necessary for QR Code print.
For an example, when number of bar code dat
a byte=30, model=2, and version=4;
Area1 = 302+560 = 620 bytes
Area2 = 8006 bytes
7+33
Area3 = 33int
8
3+1 = 496 bytes
Total = 9122 bytes
(Empty area size is even number of bytes)
Table 6-6 GS 'p' 1 Used Memory Capacity of QR Code Print Command
Area Memory usage
Area1 N2+560 bytes 1*
Area 2 8006 bytes
+
7M
×int
[]
8
M=17+V
×3 bytes 2*
×4
Area 3
M
*1: N: Number of bar code data
When empty capacity of the external RAM is an odd number, one more byte is necessary.
When number of bar code data byte is an odd number, one more byte is necessary.
*2: M: Number of modules for one side of the QR Code.
V: Version
The int () means that less than a decimal point will be omitted.
When area 3 becomes an odd number, one more byte is necessary.
6-12
Page 58
(c) Used Memory Capacity of Data Matrix
The total empty area of area1 to 4 shown in Table 6-7 is necessary for Data Matrix print.
For an example, when number of bar code dat
Total = 2548 bytes (Area4 uses a value of Area4-A.)
(Empty area size is an even byte number.)
Table 6-7 GS 'p' 2 Used Memory Capacity of Data Matrix Print
Area Memory usage
Area1 N bytes1*
Area2 2230 bytes
Area3 (D+E+1)2 bytes2*
+
16
3*4*
15X
}
2Y
bytes
3*5*
Area4-A I(B+68) 2 bytes
15Xm
+
[][]
{
Area4-B
*1: N: Number of bar code data
When empty capacity of the external RAM is an odd number, one more byte is necessary
When number of bar code data byte is an odd number, one more byte is necessary
*2: D: Number of data code word.
E: Number of error correction code word.
These value are decided from symbol sizes. See Table 6-8
*3: Area 4-A and area 4-B are used commonly. The larger number will be used
*4: The I will be calculated as follows:
I=int
When the above value is an odd number, plus 1 to the value.
B will be calculated as follows:
B=int
*5: X: Horizontal size of the symbol
Y: Vertical size of the symbol
Xm: Horizontal size of the map matrix
Ym: Vertical size of the map matrix
See Table 6-8 for sizes of the map matrixes.
The int () means that less than a decimal point will be omitted.
・When E is 68 or less, I=1
・When E exceeds 68,
()
()
int×
67E +
68
1ID -+
I
16
intYm
+×
6-13
Page 59
Table 6-8 Data Matrix Symbol Sizes
Symbol size Map matrix size Number of the Code Word
Vertical Horizontal Vertical Horizontal Data Error correction
10 10 8 8 3 5
12 12 10 10 5 7
14 14 12 12 8 10
16 16 14 14 12 12
18 18 16 16 18 14
20 20 18 18 22 18
22 22 20 20 30 20
24 24 22 22 36 24
26 26 24 24 44 28
32 32 28 28 62 36
36 36 32 32 86 42
40 40 36 36 114 48
44 44 40 40 144 56
48 48 44 44 174 68
52 52 48 48 204 84
64 64 56 56 280 112
72 72 64 64 368 144
80 80 72 72 456 192
88 88 80 80 576 224
96 96 88 88 696 272
104 104 96 96 816 336
120 120 108 108 1050 408
132 132 120 120 1304 496
144 144 132 132 1558 620
8 18 6 16 5 7
8 32 6 28 10 11
12 26 10 24 16 14
12 36 10 32 22 18
16 36 14 32 32 24
16 48 14 44 49 28
6-14
Page 60
(d) Used Memory Capacity of MaxiCode
The total empty area of area1 to 2 shown in Table 6-9 is necessary for MaxiCode print.
For an example, when number of bar code dat
a byte=33;
Area 1 = 33+1 = 34 bytes
Area 2 = 7684 bytes
Total = 7718 bytes
(Empty area size is an even byte number.)
Table 6-9 GS 'p' 3 Used Memory Capacity of MaxiCode Print
Area Memory Usage
Area 1 N bytes*
Area 2 7684 bytes
* N: Number of bar code data
When empty capacity of the extended RAM is an odd number, one more byte is necessary.
When number of bar code data byte is an odd number, one more byte is necessary.
6-15
Page 61
6.4.2 FLASH Memory
y
The printer stores data such as User-defined character, downloaded character, optional font, routine function,
stamp and template data into FLASH memory. Of these data, User-defined character, downloaded character,
optional font and template data can be used dedicated memory area. Moreover, FLASH memory has shared
memory area as 256K byte user area for routine function and stamp.
Data except template data stored into FLASH memory is used when that is not present into extended RAM.
If data is present in both of FLASH memory and extended RAM, the printer treats data in extended RAM as
priority.
When allocating memory area for User-defined character or downloaded character in extended RAM, the
printer copies data of User-defined character or downloaded character if those data are present in FLASH
memory.
(1) User area in FLASH memory management
Memory in the user area has the following states:
In use state (storage state)
Released state (Erasable state)
Empty state
In use
Release
Empt
All Extension memories are in “Empty state” at shipping.
When some data is saved in the memory, the memory turns to “In use state”.
When the data is in use state is released, the memory turns to “Released state (Erasable condition).” This
area cannot be used again in this state.
[1] Shipping state
Empty state
[2] State that some data are
registered.
Data (1) In use state
Empty state
[3] State that the registered
data is released.
Data (1) Released state
Empty state
[4] State that the registration and a
release are repeated.
Data (1) Released state
Data (2) In use state
Data (3) In use state
Data (4) Released state
Data (5) In use state
Data (6) Released state
Empty state
[5] State that the Extension Memory Area
Control command (DC2*1) is executed.
Data (2) In use state
Data (3) In use state
Data (5) In use state
Empty state
6-16
Page 62
When data storage and release are repeated, the memory state turns to the [4] state.
To use the “Released state (Erasable state)” area again, execute the User Area Defragment (DC2 '*' '1')
command.
The [5] shows the memory state after the command is executed.
Executing Remaining User Area Response (DC2'*' '2') command to check the current remaining area.
Remaining Memory Response command in user area responds the current available amount of FLASH
memory.
(2) Precautions on data in FLASH memory when rewriting, freeing and allocating
The maximum rewritable number of the FLASH memory is approximately 100000 times. Execute the
User Area Defragment command after getting low memory for restraining the numbers of the memory
rewriting.
Do not turn the power off during FLASH memory writing/erasing. If doing so may cause FLASH memory
damage and it may not work. To confirm the FLASH memory writing/erasing, send Execute Response
Request (DC2 ‘j’) command (6.5.23 Status Commands) behind the command as the above-mentioned
and check response code.
6-17
Page 63
6.5 COMMAND DESCRIPTION
(a)
(b)
(c) (a)
(b) (c)
Each command for the printer is described respectively.
This section explains each command.
6.5.1 Command Format
Each command is described in the following format.
6-18
Page 64
6.5.2 Formatting Commands
ESC 'C' n Set Page Length at n Lines
Code 1BH 43H n
n127
1
Function Set page length at n lines.
The page length is (current line spacing x n) dot lines.
If the line spacing is zero, this command is ignored.
The current position becomes the beginning of the page.
The bottom margin set by ESC 'N' is canceled.
If n = 0, the page length is set at n inches.
This setting is canceled by Page Mode Select (DC2 'z' 0) command.
Moreover, this command is ignored in the page mode.
Default Roll Paper mode : No page length setting
Mark Roll Paper mode : 38 lines (line spacing 34 dots lines)
ESC 'C' 0 n Set Page Length at n Inches
Code 1BH 43H 00H n
n22
1
Function Sets the page length at n inches.
The current position becomes the beginning of the page.
The page length is n x 203 dot lines.
The bottom margin set by ESC 'N' is canceled.
If n = 0 or n
This setting is canceled by Page Mode Select (DC2 'z' 0) command.
Moreover, this command is ignored in the page mode.
Default Roll Paper mode : No page length setting
Mark Roll Paper mode : 6.4 inches (1292 dots lines)
23, this command is ignored.
ESC 'N' n Set Bottom Margin
Code 1BH 4EH n
n127
1
Function Sets the bottom margin at n lines.
The last dot (n x current line spacing) of the page is the skip amount (non-printable area).
The skip amount does not change even if the line spacing is set after setting the bottom margin.
The bottom margin is canceled when the page length is modified.
If the bottom margin exceeds the page length, this command is ignored.
If the page length is not specified in the initial state in the Roll Paper mode, this command is
ignored.
This setting is canceled by Page Mode Select (DC2 'z' 0) command.
Moreover, this command is ignored in the page mode.
Default The bottom margin is not defined.
6-19
Page 65
g
ESC 'O' Cancel Bottom Margin
Code 1BH 4FH
Function Cancels bottom margin.
If the page length is not specified in the initial state in the Roll Paper mode, this command is
ignored.
Default The bottom margin is canceled.
Top of the page
Printable area
The defined page
len
th
The defined bottom
margin
Non-printable area
ESC 'Q' n Set Right Margin
Code 1BH 51H n
n255
1
Function Sets the right margin at n columns from the left edge (first column).
Column n (current character pitch x n) from the left edge becomes the right margin.
The character width includes character spacing. The character width is also doubled in
double-width setting. The character width is not calculated by double when Select expanded
character mode with automatic cancellation (SO) command is selecting.
The line buffer data is cleared and the next print position becomes the left margin.
The right margin does not move if the character pitch is changed later.
When n is smaller than the left margin columns, the command is ignored.
If the printable area is one character or less, one character is printed.
This command is ignored in the page mode.
Default Maximum number of digits for printing. (at shipping)
Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')
command.
6-20
Page 66
p
ESC 'I' n Set Left Margin
Code 1BH 6CH n
n255
0
Function Sets the left margin at n columns from the left edge (first column).
Column n (current character pitch x n) from the left edge becomes the left margin.
The character width includes character spacing. The character width is also doubled in
double-width setting. The character width is not calculated by double when Select expanded
character mode with automatic cancellation (SO) command is selecting.
The line buffer data is cleared and the next print position becomes the left margin.
The left margin does not move if the character pitch is changed later.
When n is larger than the right margin columns, the command is ignored.
If the printable area is one character or less, one character is printed.
This command is ignored in the page mode.
Default n=0 (at shipping)
Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')
command.
When the left margin is set at fifth column and the right margin is set at 17th column, the
printable area is as follows:
Columns
1 2 3 4 5 6 7 8 9 10 11121314151617181920 21 22
Non-printable area
Left margin
▼
Printable area
Maximum
rintable area
Right margin
▼
Non-printable area
6-21
Page 67
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
110 PRINT #1,"Page Length : 5 line"
120 PRINT #1,"Skip Length : 2 line"
130 PRINT #1,"Right Margin : 17 char"
140 PRINT #1,"Left Margin : 5 char"
150 PRINT #1,CHR$(&H0D);
160 PRINT #1,CHR$(&H1B);"C";CHR$(5); 'Page Length : 5 line
170 PRINT #1,CHR$(&H1B);"N";CHR$(2); 'Skip Length : 2 line
180 PRINT #1,CHR$(&H1B);"Q";CHR$(17); 'Right Margin : 17 char
190 PRINT #1,CHR$(&H1B);"l";CHR$(5); 'Left Margin : 5 char
200 FOR I=&H20 TO &HFE
210 PRINT #1,CHR$(I);
220 NEXT I
230 PRINT #1,CHR$(&H0D);
240 CLOSE #1
250 END
Figure 6-1 Program Sample 1
Figure 6-2 Print Sample 1
6-22
Page 68
6.5.3 Line Spacing Commands
ESC '0' Set 1/8-inch Line Spacing
Code 1BH 30H
Function Sets the line spacing amount to 1/8 of an inch (26 dots lines).
If the line buffer contains data and the line spacing amount is smaller than the character height,
the data in the buffer is printed and line feeding is performed by the character height.
Default 34 dots lines
Printer initial state after power-on can be changed by Set default/Set test print header (DC2
'i')command.
ESC '2' Set 1/6-inch Line Spacing
Code 1BH 32H
Function Sets the line spacing to 1/6 of an inch (34 dots lines).
If the line buffer contains data and the line spacing amount is smaller than the character height,
the data in the buffer is printed and line feeding is performed by the character height.
Default 34 dots lines
Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')
command.
ESC '3' n Set n-dot-line Line Spacing
Code 1BH 33H n
n255
0
Function Sets line spacing.
The line spacing is set to n dot lines.
If the line buffer contains data and the line spacing amount is smaller than the character height,
the data in the buffer is printed and line feeding is performed by the character height.
Default 34 dots lines
Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')
command.
6-23
Page 69
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
110 PRINT #1,CHR$(&H1B);"0";
120 PRINT #1,"1/8 inch line space"
130 PRINT #1,CHR$(&H1B);"2";
140 PRINT #1,"1/6 inch line space"
150 FOR I=0 TO 96 STEP 24
160 PRINT #1,CHR$(&H1B);"3";CHR$(I);
170 PRINT #1,";I;"dot-line line space"
180 NEXT I
190 PRINT #1,"---------------------------------------"
200 CLOSE #1
210 END
Figure 6-3 Program Sample 2
Figure 6-4 Print Sample 2
6-24
Page 70
6.5.4 Tab Setting Commands
ESC 'B' {DATA} NUL Set Vertical Tab Positions
Code 1BH 42H {p1 p2••• pk} 00H
p255
1
k16
0
Function Sets the vertical tab position.
The tab position is the (current line spacing × p lines) dot position with respect to the page
starting position.
If the line spacing is zero, ESC 'B' is ignored and the subsequent data is processed as normal
data.
The positions, p, are input in ascending order and the command ends with 00H (NUL). The
value of p is equal to or less than the value of the preceding p, the vertical tab position setting
ends, and the following data is processed as normal data.
Preset vertical tabs are cleared.
A maximum of 16 vertical tab positions k can be set. If more tab positions are specified, they are
ignored until the value becomes 00H or the preceding value.
ESC 'B' NUL clears all vertical tab positions.
If p exceeds the page length, the tab position is invalid. The following data is processed as
normal data.
Even if the line spacing is changed after setting vertical tab positions, the tab positions are not
changed.
If the page length is not specified in the initial state in the Roll Paper mode, this command is
ignored.
Default No definition.
When the vertical tab is set at every fifth line and the vertical tab execution (VT command) and
'VTAB' are sent alternately, the print operation is as follows.
Line spacing
Tab position 4
Tab position 4
1
2
VT command
3
4
5
VTAB
6
7
VT command
8
9
10
11
VTAB
12
6-25
Page 71
ESC 'D' {DATA} NUL Set Horizontal Tab Positions
Code 1BH 44H {p1 p2•••pk} 00H
p255
1
k32
1
Function Sets horizontal tab positions.
The tab position is the (current character with × p columns) position with respect to the left
margin.
The character width includes the character spacing. The character width is also doubled in
double-width mode. The character width is not calculated by double when Select expanded
character mode with automatic cancellation (SO) command is selecting.
The positions, p, are input in ascending order and the command ends with 00H (NUL). The
value of p is equal to, or less than the value of the preceding p, the horizontal tab position setting
ends. The following data is processed as normal data.
Tab positions exceeding the right margin are invalid. They become valid when the right margin
is changed so that they are included in the printable area.
Preset horizontal tabs are cleared.
Up to 32 tab positions k can be set. Data which exceeds 32 tab positions will be ignored until the
value becomes 00H or the preceding value.
ESC 'D' NULL clears all horizontal tab positions.
Default Every eight Katakana characters in 24-dot fonts.
When the horizontal tab is set at every seventh column, the horizontal tab execution (HT
command) and 'HTAB' are sent alternately, the printing operation is as follows.
Columns
1 2 3 4 5 6 7 8 9 10 11121314151617181920 21 22
H T A BHT AB
HT command
Tab position
▼
HT command
Tab position
Tab position
HT command
6-26
Page 72
6.5.5 Print and Paper Feed Commands
CR Print and Carriage Return
Code 0DH
Function Functions the same as an LF command.
If the line buffer contains data and the line spacing amount is smaller than the character height,
the data in the buffer is printed and line feeding is performed by the character height.
LF Print and Line Feed
Code 0AH
Function After data in the line buffer is printed out, the printer feeds one line.
The next print starting position becomes the beginning of the next line (left margin).
If the line buffer contains data and the line spacing is smaller than the character height, the data
in the line buffer is printed and one line is fed by the character height.
If the line buffer does not contain data before this code is received, the printer only feeds one line.
The select expanded character mode with automatic cancellation selected by SO is canceled.
The LF command that follows CR is ignored.
FF Page Feed (form feed)
Code 0CH
Function When page length is specified, the printer performs page feed up to specified page length after
data in the line buffer is printed out.
When page length is not specified, the printer performs page feed up to mark by specified value
with Set default/Set test print header (DC2 'i')command after data in the line buffer is printed out.
The next print starting position becomes the beginning of the next line (left margin).
The select expanded character mode with automatic cancellation selected by SO is canceled.
In the cut paper mode:
If an out-of-paper error occurs during page feeding, the page feed ends at the time. Then, the
paper is fed at low speed. When new paper is loaded, it is not fed, and the page insertion
position is regarded as the beginning of the page.
In the Roll Paper mode:
When page length is not specified, this command is ignored. When page length is specified, if an
out-of-paper error occurs during page feeding, the page feed ends at the time. When new paper
is loaded, it is not fed, and the page insertion position is regarded as the beginning of the page.
In the Mark Roll Paper mode:
The paper mark is detected by this command and paper form feed is executed. If an
out-of-paper error occurs, the printer operation is same as in the Roll Paper mode.
6-27
Page 73
ESC 'J' n Print and Feed paper
Code 1BH 4AH n
n255
0
Function Prints the data in the print buffer and feeds the paper one dot line.
If the line buffer contains data and n is smaller than the character height, the data in the line
buffer is printed and one line is fed by the character height.
If the line buffer contains data, the select expanded character mode with automatic cancellation
selected by SO is canceled.
If the line buffer does not contain data before this code is received, the printer only feeds n dot
lines.
The predetermined line spacing remains unchanged.
ABC
n
n
GS '<' Marked Paper Form Feed
Code 1DH 3CH
Function Performs the marked paper form feed.
This command is effective only when marked paper is selected.
In the Mark Roll Paper mode, the printer performs its operation as same as Page feed (FF)
command.
In the Mark Roll Paper mode, the printer executes the paper form feed to the cutting position. If
data is remaining in the line buffer, the printer executes paper feed after printing data in the line
buffer.
The select expanded character mode with automatic cancellation selected by SO is canceled.
6-28
Page 74
6.5.6 Print Position Commands
HT Execute Horizontal Tab
Code 09H
Function Moves the print position to the next horizontal tab position.
This command is ignored if the next horizontal tab position is not set.
This command is ignored if the next horizontal tab position exceeds the right margin.
The horizontal tab position is set using the ESC 'D' command.
Default The default tab positions are at intervals of 8 characters.
VT Execute Vertical Tab
Code 0BH
Function Feeds the paper to the next vertical position.
If the line buffer contains data, it is printed and the print position moves to the next tab position.
When a VT command is input after the last vertical tab position, the command functions in the
same way as the FF command.
If the next vertical tab position is not set, the command functions in the same way as the LF
command.
If the print position enters the perforated line skip area when a VT command is executed, the
paper is fed to the beginning of the next page.
The vertical tab position is set using the ESC 'B' command.
The select expanded character mode with automatic cancellation selected by SO is canceled.
If the page length is not specified in the initial state in the Roll Paper mode, the command
functions in the same way as the LF command.
Default No definition.
ESC '$' nl nh Set Absolute Position
Code 1BH 24H nl nh
nh256+nl2399
0
Function Sets the print starting position at the specified number of dots (nhnl) in the right direction from
the left margin.
Any print start position specification exceeding the right margin is ignored.
ESC '\' nl nh Set Relative Position
Code 1BH 5CH nl nh
nh256+nl2399
-2399
Function Sets the print starting position at the specified number (nhnl) of dots from the current position to
the right or left.
Any specification exceeding the printable area is ignored.
Negative numbers are specified using the 2's complement with the number of dots.
Example: Move N dots to the left.
nhnl=65536-N
Function n selects an international character set from the following table.
n Country
0 U.S.A.
1 France
2 Germany
3 U.K.
4 Denmark I
5 Sweden
6 Italy
7 Spain
8 Japan
9 Norway
10 Denmark II
11 Spain II
12 Latin America
The download characters and optional fonts are not affected by the international character set s.
If n is selected out of range, this command is ignored.
Default n=8 (Japan)
Printer initial state after power-on can be changed by Set default/Set test print header (DC2
'i')command.
ESC 't' n Select Character Code Table
Code 1BH 74H n
Function Selects a character code table.
Only two low-order bits are valid.
n = 0: Extended graphics character set (IBM Compatible)
n = 1: Katakana character set (ANK)
n = 2: Codepage 1252 character set
n = 3: Ignored
00H to 1FH are treated as control codes and no characters are printed regardless of the
selected code table. 7FH is ignored.
For character font, see the Appendix A.1 CHARACTER CODE TABLE.
Default Depends on the setting of bit 4 of SWDIP switch 2.
6-31
Page 77
DC2 'y' n Euro Character Specify
Code 12H 79H n
n=0, 32
Function Exchanges the font of character code n of the one-byte system to Euro characters.
When n is 0, the exchange to the Euro characters is released and the font returns before
selection.
Only one character code to be exchanged to Euro characters is available.
When an exchange to Euro characters for other character code is performed, the last change to
Euro characters for character code is released.
Default n=0 (not selected)
n254 (except 127)
6-32
Page 78
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
110 PRINT #1,CHR$(&H1B);"$";CHR$(&HD8);CHR$(0);"23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E"
120 FOR I=0 TO 12
130 RESTORE 310
140 FOR J=0 TO I
150 READ CNTRY$
160 NEXT J
170 PRINT #1,CNTRY$;CHR$(&H1B);"$";CHR$(&HA8);CHR$(0);:GOSUB 250
180 NEXT I
190 FOR I=0 TO 1
200 PRINT #1,CHR$(&H1B);"t";CHR$(I);
210 PRINT #1,"#$%&01234567ABCDEFGabcdefg
アイウエオ"
220 NEXT I
230 CLOSE #1
240 END
250 PRINT #1,CHR$(&H1B);"R";CHR$(I);" ";
260 PRINT #1,CHR$(&H23);" ";CHR$(&H24);" ";CHR$(&H40);" ";
270 PRINT #1,CHR$(&H5B);" ";CHR$(&H5C);" ";CHR$(&H5D);" ";
280 PRINT #1,CHR$(&H5E);" ";CHR$(&H60);" ";CHR$(&H7B);" ";
290 PRINT #1,CHR$(&H7C);" ";CHR$(&H7D);" ";CHR$(&H7E)
300 RETURN
310 'COUNTRY NAME
320 DATA USA,FRANCE,GERMANY,ENGLAND,ENGLAND,DENMARK 1,SWEDEN
330 DATA ITALY,SPAIN,JAPAN,DENMARK 2,SPAIN 2,LATIN AMERICA
Figure 6-7 Program Sample 4
Figure 6-8 Print Sample 4
6-33
Page 79
6.5.8 1-byte characters Definition Commands
ESC '%' n Set/Cancel Download Character Set
Code 1BH 25H n
Function Sets or cancels the download character set.
Only the least significant bit of n is valid.
n = 0: Cancel the download character set.
n = 1: Set the download character set.
When the download character set is set, it can be printed.
When the download character set is input with undefined character code, the optional font or the
selected internal character set is printed. However, the 7FH character code is ignored.
If the download character set and optional font are defined in the same character code and both
are selected, the download character set is given priority.
Default n=0 (Cancel)
ESC '&' s n m {DATA} Define Download Characters
Code 1BH 26H s n m {d1 d2•••dk}
s=0
nm7FH
20H
Function Defines 1-byte characters in the download character set.
s indicates the character set number of the download character.
n is the beginning of the definition of download characters and m is the end of the definition of
download characters. If either n or m is defined, n must be equal to m.
If n or m is out of range, the data out of range is ignored and the following data will be processed
as normal data.
The font size of the download character registered is decided by current selected font size.
The download characters for 24- or 16-dot fonts are defined simultaneously because both are
registered in separate areas.
d indicates the defining data. The bit corresponding to the dot to be printed is set to 1, and the bit
corresponding to the dot not to be printed is set to 0.
Multiple character codes can be defined at the same time.
If the previously defined character code is defined again, it is overwritten.
The size of data per character for a selected font is as follows:
24-dot font : 48 bytes/character
16-dots font : 16 bytes/character
The total number of character patterns (k) is as follows:
24-dot font : k=48
16-dot font : k=16
Enter font data by using eight vertical dots as one byte.
If the download character area is freed up, ESC '&' is ignored and the following data will be
processed as normal data.
For 24-dot fonts, a character is defined as 24 x 16 dots. The following restrictions apply to the
actual printing. If the right space + character width is 16 dots or more, the character can be
printed as 24 x 16 dots. If it is 16 dots or less, only the (character width + character right-side
spacing) dots are printed. To print the whole character regardless of the character right-side
spacing, the font must be defined as 12 dots (horizontal) or less.
(m-n+1)
(m-n+1)
6-34
Page 80
•24-dot font •16-dot font
d4
d5
d6
16 dots
d46
d47
d48
MSB
LSB
16 dots
8 dots
d3
d1d15
d4
d2
d16
MSB
LSB
d1
24 dots
d2
d3
DC2 'D' n Download Characters Area Operation
Code 12H 44H n
Function Allocates or frees the download character area.
Only the least significant bit (LSB) of n is valid.
n = 0 : Frees the download character area.
n = 1 : Allocates the download character area.
When the download area is freed up, the download character is erased and the download
character set specification is freed up. The following commands are ignored.
ESC '&' :Define download character
ESC '%' :Select/cancel download character set
The download character area after memory initialization is 6248 bytes long. If the download
character area is freed, the remaining memory capacity increases by 6248 bytes.
The remaining memory capacity must be at least 6248 bytes to reallocate the download
character area. If the remaining memory capacity is insufficient, the download character area is
not allocated and DC2 'D' 1 is ignored.
Default n=1 (Allocate the download character area)
6-35
Page 81
6.5.9 Character Decoration Commands
SO Select Expanded Character Mode with Automatic Cancellation
Code 0EH
Function Prints 1-byte characters and 2-byte characters following this code in double-width characters.
This mode is canceled by DC4, LF, VT, FF, ESC 'W', GS '<' or CR, or by buffer-full printing.
When the line buffer is cleared, the expanded character mode is canceled.
DC4 Cancel Expanded Character Mode with Automatic Cancellation
Code 14H
Function Cancels expanded character mode set by SO code for 1-byte characters and 2-byte characters.
The expanded character mode set by ESC 'W' 1 is not canceled.
ESC 'W' n Select/Cancel Expanded Character Mode
Code 1BH 57H n
Function Selects or cancels the expanded character mode for 1-byte characters and 2-byte characters.
Only the least significant bit (LSB) of n is valid.
n = 1: Select the expanded character mode.
n = 0: Cancel the expanded character mode.
ESC 'W' 0 frees up the expanded character mode selected by SO.
Default n=0 (Cancel the expanded character mode)
ESC 'w' n Select/Cancel Double Height Mode
Code 1BH 77H n
Function Selects or cancels the double height mode for 1-byte characters.
Only the least significant bit (LSB) of n is valid.
n = 1: Select the double height mode.
n = 0: Cancel the double height mode.
Default n=0 (Cancel the double height mode)
ESC 'E' Select Emphasized Print Mode
Code 1BH 45H
Function Selects emphasized print mode for 1-byte characters and 2-byte characters.
The emphasized print mode can also be selected or canceled with ESC '!', but the most recently
processed command is effective.
6-36
Page 82
ESC 'F' Cancel Emphasized Print Mode
Code 1BH 46H
Function Cancels the emphasized print mode for 1-byte characters and 2-byte characters.
The emphasized print mode can also be selected or canceled with ESC '!', but the most recently
processed command is effective.
The double print mode is also canceled.
ESC 'G' Select Double Print Mode
Code 1BH 47H
Function Selects the double print mode for 1-byte characters and 2-byte characters.
Same as in emphasized print mode.
ESC 'H' Cancel Double Print Mode
Code 1BH 48H
Function Cancels the double print mode for 1-byte characters and 2-byte characters.
The emphasized print mode is also canceled.
ESC '-' n Select/Cancel Underline Mode
Code 1BH 2DH n
Function Selects or cancels underline mode for 1-byte characters.
Only the least significant bit (LSB) of n is valid.
n = 1: Select the underline mode.
n = 0: Cancel the underline mode.
The underline is attached to all printing characters, including character right-side spacing. The
underline, however, is not attached when skipped by Horizontal Tab (HT), Set Absolute Position
(ESC '$'), or Set Relative Position (ESC '\') command.
This command is not valid for 2-byte characters.
The underline width can also be modified with FS '-'. When the underline width is not specified
by FS '-', default width is set as 1-dot underline.
If the underline is canceled by n=0, the subsequent 1-byte characters are not underlined.
The underline mode can also be selected or canceled with ESC '!', but the most recently
processed command is effective.
Default n=0 (Cancel underline mode)
6-37
Page 83
ESC '!' n Set Print Mode
Code 1BH 21H n
Function Sets a print mode for 1-byte characters.
Each bit of n is used as follows:
BitFunction n=0 n=1
0 Undefined - -
1 Undefined - -
2 Undefined - -
3 Emphasized printing Canceled Set
4 Double printing Canceled Set
5 Double-width Canceled Set
6 Undefined - -
7 Underline Canceled Set
The underline is attached to all character widths, including character right-side spacing.
However, it is not attached when skipped by HT or other commands.
The underline width can also be modified with FS '-'. When the underline width is not specified
by FS '-', default width is set as 1-dot underline.
This command is valid for 2-byte characters, except underlines.
If emphasized printing is canceled, double printing is canceled. If double printing is canceled,
emphasized printing is canceled.
The underline mode can also be selected or canceled by other commands, but the most recently
processed command is effective.
Function Selects the direction of rotation of 1-byte characters and 2-byte characters.
Only two low-order bits are valid.
n = 0: Cancel character rotation.
n = 1: Rotate the character 90° clockwise.
n = 2: Rotate the character 90° counterclockwise.
n = 3: Ignore the command.
If the character is decorated, the decorated character is rotated.
Character decoration applies to a line. If the character rotation is doubled vertically, it is doubled
in the Y direction (character widths are doubled). If the width is doubled, the character is
doubled in the X direction (characters are doubled vertically).
Character rotation cannot be underlined.
The following characters can be rotated:
• Extended graphics characters
• Katakana characters
• Codepage 1252
• Download characters
• Kanji
• Kanji quarter size characters
• User-defined characters
Optional fonts cannot be rotated.
The four rightmost dots of 24
characters are not printed.
When download characters are in 24-dot fonts, they are printed as 24
fonts must be 12 dots or less.
If character rotation and vertical writing are specified in Kanji mode, vertical writing is given
priority.
16 dots fonts of extended graphics characters and Katakana
12 dots. Therefore, the
Default n=0 (Cancel character rotation)
6-39
Page 85
6.5.10 Character Pitch Adjustment Command
ESC SP n Set Character Spacing
Code 1BH 20H n
n127
0
Function Sets the character right-side spacing for 1-byte characters in dot units (n).
If a character code is input after this command, it is printed with (character width + set character
spacing).
The character left-side spacing will be 0 dot.
Only the seven significant bits of n are valid. n must be 0 to 127 dots.
The character right-side spacing for double-width mode is twice the value set by this command.
It can be expanded to up to 254 dots.
This command does not change the spacing of 2-byte characters. This also does not change
the spacing of 1-byte characters in the Kanji ROM. (See FS 'S' for details on the spacing of
2-byte characters.)
Default n=4 (at shipping)
Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')
command.
6-40
Page 86
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
110 PRINT #1,CHR$(&H12);"F0"; '16 dots font
120 PRINT #1,CHR$(&H1B);"&";CHR$(0);"DD"; 'D
130 RESTORE 460 : N=16 : GOSUB 430
140 PRINT #1,CHR$(&H12);"F1"; '24 dots font
150 PRINT #1,CHR$(&H1B);"&";CHR$(0);"oo"; 'o
160 RESTORE 480 : N=48 : GOSUB 430
170 PRINT #1,CHR$(&H1B);"%1"; 'Down Load Select
180 PRINT #1,CHR$(&H12);"F0";"16 dots Down Load Select"
190 PRINT #1,CHR$(&H12);"F1";"24 dots Down Load Select"
200 PRINT #1,CHR$(&HE);"DoubleWidth by SO"
210 PRINT #1,"Normal print"
220 PRINT #1,"Normal";
230 PRINT #1,CHR$(&H1B);"-1";"+UnderLine";
240 PRINT #1,CHR$(&H1B);"W1";"+DoubleWidth";
250 PRINT #1,CHR$(&H1B);"w1";"+DoubleHeight";
260 PRINT #1,CHR$(&H1B);"E";"+Emphasize";
270 PRINT #1,CHR$(&H1B);"-0";"-UnderLine";
280 PRINT #1,CHR$(&H1B);"W0";"-DoubleWidth";
290 PRINT #1,CHR$(&H1B);"w0";"-DoubleHeight";
300 PRINT #1,CHR$(&H1B);"F";"-Emphasize";
310 PRINT #1,CHR$(&H1B);"!";CHR$(&HB8);"+CollectivelySet";
320 PRINT #1,CHR$(&H1B);"!";CHR$(&H00);"-CollectivelyClear"
330 PRINT #1,CHR$(&H12);"Y2";"Rotation Left"
340 PRINT #1,CHR$(&H12);"Y1";"Rotation Right"
350 PRINT #1,CHR$(&H12);"Y0";"Rotation Off";CHR$(&H0D);CHR$(&H0D);
360 PRINT #1,"Character space"
370 FOR I=0 TO 25
380 PRINT #1,CHR$(&H1B);" ";CHR$(I);
390 PRINT #1,CHR$(&H41+I);
400 NEXT I : PRINT #1,CHR$(&H0D);
410 CLOSE #1
420 END
430 FOR I=0 TO N-1
440 READ D$ : PRINT #1,CHR$(VAL("&h"+D$));
450 NEXT I : RETURN
460 '16x8 Font
470 DATA 80,80,C0,C0,E0,E0,F0,F0,F8,F8,FC,FC,FE,FE,FF,FF
480 '24x12 Font
490 DATA 80,80,80,C0,C0,C0,E0,E0,E0,F0,F0,F0,F8,F8,F8,FC
500 DATA FC,FC,FE,FE,FE,FF,FF,FF,00,00,00,00,00,00,00,00
510 DATA 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
Figure 6-9 Program Sample 5
6-41
Page 87
Figure 6-10 Print Sample 5
6-42
Page 88
6.5.11 Kanji Character Set Selection Commands
FS '&' Select Kanji Mode
Code 1CH 26H
Function Selects Kanji mode.
In Kanji mode, only 2-byte character codes are accepted.
1-byte character in SII Japanese font set (at shipping) can be printed by entering 00H
code.
This command is ignored when Shift-JIS is selected as the Kanji code system.
Default Cancel Kanji mode.
+ 1-byte
FS '.' Cancel Kanji Mode
Code 1CH 2EH
Function Cancels Kanji mode.
This command is ignored when Shift-JIS is selected as the Kanji code system.
Default Cancel Kanji mode.
FS 'C' n Select Kanji Code System
Code 1CH 43H n
Function Selects Kanji code system.
Only the least significant bit of n is valid.
n = 0: JIS code system.
n = 1: Shift-JIS code system.
The Kanji mode is canceled and the Shift-JIS is set to the Kanji code system when Shift-JIS is
selected as the Kanji code system by this command.
Refer to 6.3 CHARACTER CODES for character code system or applicable Kanji code
correspond.
Default Depends on the setting of SWDIP2-7.
6-43
Page 89
FS 'r' n Select Kanji Quarter Size Character Mode
Code 1CH 72H n
Function Selects Kanji quarter size character mode.
Only the least significant bit of n is valid.
n = 0: Superscript
n = 1: Subscript
Only the least significant bit of n is valid, and it can be set only in Kanji mode. When Kanji mode
is ineffective, FS 'r' is ignored.
If one of the following Kanji codes is input, a Kanji quarter size character is printed.
2321H to 237EH: Alphanumeric
2421H to 247EH: Hiragana
2521H to 257EH: Katakana
The other Kanji codes are printed as normal 2-bytes size characters, User-defined characters,
or 1-byte characters in Kanji ROM.
Only 2330H to 2339H ('0' to '9') can be printed as 16-dot Kanji quarter size characters.
The other alphanumeric, Hiragana, and Katakana have horizontal 8-dot spacing.
The Kanji quarter size character mode can be canceled with the Cancel Kanji Mode (FS '.')
command.
For character font, see the Appendix A.4 Kanji quarter size character set.
This command is valid for SII Japanese font set (at shipping) mounted.
Default Cancel Kanji Quarter Size Character Mode.
FS DC2 Cancel Kanji Quarter Size Character Mode
Code 1CH 12H
Function Cancels quarter size Kanji character mode.
Quarter size Kanji character mode is canceled and the following characters are printed in Kanji
character mode.
Default Cancel Kanji Quarter Size Character Mode.
6-44
Page 90
6.5.12 Kanji Character Definition Commands
FS '2' c1 c2 {DATA} Define User-defined Character
Code 1CH 32H c1 c2 {d1 d2•••dk}
Function Defines a Kanji User-defined character pattern for the character code specified by c1 and c2.
c1 and c2 indicate a Kanji code for the User-defined character to be defined.
c1 indicates the first byte, and c2, the second byte.
c1 and c2 depend on selected kanji code system or mounted font set, refer to 6.3 CHARACTER
CODES for det
If c1 or c2 is out of range, the range is ignored and the following data will be processed as
normal data.
Since 24-dot User-defined characters and 16-dot User-defined characters are registered in
different areas, up to 94 characters of each type can be defined at the same time.
Whether a 24-dot or 16-dot User-defined character is registered according to the font selected
when this command is input.
The number of bytes (k) of the pattern is as follows:
24-dot: k = 3
16-dot: k = 2
ails.
24 = 72 bytes
16 = 32 bytes
d indicates font data. 8 vertical dots of font data must be input as 1 byte.
Default Undefined
•24-dot font •16-dot font
24 dots
1
2
2
3
24 dots
4
5
6
70
71
72
MSB
131
16 dots
2
LSB
16 dots
3
4
MSB
32
LSB
6-45
Page 91
DC2 'G' n User-defined Character Area Operation
Code 12H 47H n
Function Allocates or frees up the User-defined character area.
Only the least significant bit (LSB) of n is valid.
n = 0: Frees up the User-defined character area.
n = 1: Allocates the User-defined character area.
When the User-defined character area is freed up, the User-defined character is erased and the
User-defined character definition commands are ignored.
The User-defined character area after memory initialization is 9784 bytes. If the User-defined
character area is freed up, the remaining memory capacity increases 9784 bytes.
The remaining memory capacity must be at least 9784 bytes to reallocate the User-defined
character area. If the remaining memory capacity is insufficient, the User-defined character
area is not allocated and DC2 'G' 1 is ignored.
Default n=1 (Allocate the User-defined character area.)
6-46
Page 92
6.5.13 Kanji Character Decoration Commands
FS 'J' Select Vertical Writing
Code 1CH 4AH
Function Selects vertical writing.
Valid in Kanji mode only.
Character decoration applies to a line. If the vertically written character is doubled vertically, it is
doubled in the Y direction (character widths are doubled). If the width is doubled, the character
is doubled in the X direction (characters are doubled vertically).
Default Horizontal writing.
FS 'K' Select Horizontal Writing
Code 1CH 4BH
Function Selects horizontal writing.
Valid in Kanji mode only.
Default Horizontal writing.
FS 'W' n Select/Cancel Quadruple-size Kanji Character
Code 1CH 57H n
Function Selects or cancels quadruple-size Kanji character.
Only the least significant bit of n is valid.
n = 1: Select quadruple-size Kanji character.
n = 0: Cancel quadruple-size Kanji character.
A quadruple-size character is generated by specifying double height and double width.
When a quadruple-size Kanji character is canceled, it becomes a normal character.
Default n=0 (Canceled quadruple-size Kanji character)
6-47
Page 93
FS '-' n Select/Cancel Kanji Underline Mode
Code 1CH 2DH n
Function Select or cancel underline mode.
Only the low two bits of n is valid.
n = 0: Cancel underline mode.
n = 1: Select 1-dot underline mode.
n = 2: Select 2-dot underline mode.
n = 3: Ignore the command.
The underline is attached to all printing characters, including character right-side spacing.
However, the underline is not attached when skipped by HT or other commands.
This command is not valid for 1-byte characters, however underline setting is valid for 1-byte
characters.
If the underline is canceled by n=0, the subsequent 2-byte characters are not underlined.
The underline mode can also be selected or canceled with FS '!', but the most recently
processed command is effective.
Default n=0 (Cancel underline mode.)
6-48
Page 94
FS '!' n Set Kanji Print Mode
Code 1CH 21H n
Function Sets a print mode for 2-byte characters.
Each bit of n is used as follows:
Bit Function n=0 n=1
Printing direction selection Horizontal writingVertical writing
0
1 Undefined - -
2 Double-width Canceled Set
3 Double height Canceled Set
4 Kanji quarter size character Canceled Set
5 Kanji quarter size character position Subscript Superscript
6 Undefined - -
7 Under line Canceled Set
The underline is attached to all character widths, including right- and left-side character spacing.
However, it is not attached to the characters skipped by HT or other commands, or the
characters rotated by 90°.
The underline width is specified by FS '-' regardless of the character size. When the underline
width is not specified by FS '-', default width is set as 1-dot underline.
This command does not affect 1-byte character, however the only double-width mode is valid for
1-byte characters.
If the print mode can also be selected or canceled by another command, the most recently
processed command is effective.
The Kanji quarter size character can be selected or canceled in Kanji mode only. Bit 4 is ignored
in non-Kanji mode.
Default n=0
6-49
Page 95
6.5.14 Kanji Character Pitch Adjustment Command
FS 'S' nl nr Set Kanji Left- and Right-side Spacing
Code 1CH 53H nl nr
nl127
0
nr127
0
Function Sets the left-side spacing nl and the right-side spacing nr of 2-byte characters.
Only the seven least significant bits of nl and nr are valid. Up to 127 dots can be set.
The character spacing specified by this command does not apply to 1-byte characters.
The character spacing for double-width mode is twice the value set by this command.
It can be expanded to up to 254 dots.
Default nl=0, nr=8 (at shipping)
Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')
command.
6-50
Page 96
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1
110 GJ$=CHR$(&H77)+CHR$(&H21)
120 PRINT #1,CHR$(&H12);"F0"; '16 dots font
130 PRINT #1,CHR$(&H1C);"2";GJ$; '7721H
140 RESTORE 570 : N=32 : GOSUB 540
150 PRINT #1,CHR$(&H12);"F1"; '24 dots font
160 PRINT #1,CHR$(&H1C);"2";GJ$; '7721H
170 RESTORE 600 : N=72 : GOSUB 540
180 FOR I=&H30 TO &H33 '2330
~2333
190 K$=K$+CHR$(&H23)+CHR$(I)
200 NEXT I
210 FOR I=&H41 TO &H44 '2341
~2344
220 K$=K$+CHR$(&H23)+CHR$(I)
230 NEXT I
240 FOR I=&H21 TO &H23 '3021
~3023
250 K$=K$+CHR$(&H30)+CHR$(I)
260 NEXT I : K$=K$+GJ$
270 PRINT #1,CHR$(&H1C);"&";
280 FOR J=0 TO 1
290 PRINT #1,CHR$(&H12);"F";CHR$(J);
300 FOR I=0 TO 1
310 PRINT #1,CHR$(&H1C);"W";CHR$(I);
320 PRINT #1,CHR$(&H1C);"r";CHR$(I);K$
330 NEXT I : NEXT J
340 PRINT #1,CHR$(&H1C);"W0";
350 PRINT #1,CHR$(&H1C);"J";
360 FOR I=2 TO 0 STEP -1
370 PRINT #1,CHR$(&H1C);"-";CHR$(I);K$
380 NEXT I
390 PRINT #1,CHR$(&H1C);"K";
400 FOR I=2 TO 0 STEP -1
410 PRINT #1,CHR$(&H1C);"-";CHR$(I);K$
420 NEXT I
430 FOR I=2 TO 0 STEP -1
440 PRINT #1,CHR$(&H12);"Y";CHR$(I);K$ 'Rotation
450 NEXT I
460 PRINT #1,CHR$(&H1C);"!";CHR$(&HBD);K$
470 PRINT #1,CHR$(&H1C);"!";CHR$(&H0);K$
480 FOR I=0 TO 18
490 PRINT #1,CHR$(&H1C);"S";CHR$(I);CHR$(I); 'Kanji space
500 PRINT #1,CHR$(&H30);CHR$(&H21+I);
510 NEXT I : PRINT #1,CHR$(&H0D);CHR$(&H1C);".";
520 CLOSE #1
530 END
540 FOR I=0 TO N-1
550 READ D$ : PRINT #1,CHR$(VAL("&h"+D$));
560 NEXT I : RETURN
570 '16x16 Font
580 DATA 80,80,C0,C0,E0,E0,F0,F0,F8,F8,FC,FC,FE,FE,FF,FF
590 DATA 80,80,C0,C0,E0,E0,F0,F0,F8,F8,FC,FC,FE,FE,FF,FF
600 '24x24 Font
610 DATA 80,80,80,C0,C0,C0,E0,E0,E0,F0,F0,F0,F8,F8,F8,FC
620 DATA FC,FC,FE,FE,FE,FF,FF,FF,80,80,80,C0,C0,C0,E0,E0
630 DATA E0,F0,F0,F0,F8,F8,F8,FC,FC,FC,FE,FE,FE,FF,FF,FF
640 DATA 80,80,80,C0,C0,C0,E0,E0,E0,F0,F0,F0,F8,F8,F8,FC
650 DATA FC,FC,FE,FE,FE,FF,FF,FF
Figure 6-11 Program Sample 6
6-51
Page 97
Figure 6-12 Print Sample 6
6-52
Page 98
6.5.15 Image Command
ESC '*' m nl nh {DATA} Set Bit Image Mode
Code 1BH 2AH m nl nh {d1 d2•••dk}
m: 0,1,32,33 (mode setting)
nh×256+nl4095
0
Function Sets the bit image mode and prints bit image.
m indicates the bit image mode.
The bit image modes are related to the set bit images as shown below when the horizontal
image width is 48mm (384 dots).
m Mode
8-dot
0
single-density
8-dot
1
double-density
24-dot
32
single-density
24-dot
33
double-density
If m is not one of the values listed above, ESC '*' m is ignored and the subsequent data will be
processed as normal data.
Only the 4 least significant bits of nh are valid.
Number of dots in the horizontal direction = nhx256+nl
If nl = nh = 0, the data before nh is ignored, and the following data will be processed as normal
data.
d indicates bit image data. The image data k is as follows:
8-dot bit image: k = (nh
24-dot bit image: k = (nh
256+nl) bytes
256+nl) 3 bytes
Vertical Horizontal
DotsResolution Dots Resolution
8 2.7 dots/mm192 4 dots/mm
8 2.7 dots/mm 384 8 dots/mm
24 8 dots/mm 192 4 dots/mm
24 8 dots/mm 384 8 dots/mm
If the number of dots in the horizontal direction exceeds the printable area, the excess data is
ignored.
6-53
Page 99
•8-dot mode •24-dot mode
MSB
d3d2d1
Bit image data
LSB
d7d4d1
d8d5d2
d9d6d3
Print data Print data
MSB
Bit image data
LSB
6-54
Page 100
d1 d2 d3 dk
GS 'v' '0' m xl xh yl yh {DATA} Raster Bit Image Print
Code 1DH 76H 30H m xl xh yl yh {d1 d2•••dk}
m=0 or 48
xh x 256 + xl 65535
0
yh x 256 + yl 65535
0
Function Prints raster format dot images.
xh, xl: specify the horizontal data by count of bytes.
yh, yl: specify the vertical data by count of dots.
The printer does not print data which exceeds right margin.
Ignores this command when xhxl or yhyl is 0.
Ignores the setting of page length or bottom margin.
If there is any data in the line buffer, the printer prints the raster bit image after data in the line
buffer is printed.
The correspondence between the bits of image data can be selected by the Select image
LSB/MSB (DC2 '='). The LSB initially corresponds to the leftmost dot.
LSB
{(xh×256+xl)×8} dot
MSB
d (xh×256+xl)
(yh×256+yl)dot
d(k-1)
6-55
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.