0% found this document useful (0 votes)
12 views66 pages

XP-80XX Programmer - Manual

The Programming Manual for the Thermal Printer XP-80X Series provides detailed command instructions for the POS-80XX thermal bill printer, including command names, formats, descriptions, and notes. It covers various commands such as real-time status transfer, printing modes, and character spacing settings, with specific details on their formats in ASCII, hexadecimal, and decimal codes. Additionally, the manual outlines the conditions under which certain commands are valid and their interactions with different printer models.

Uploaded by

melchibaidoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views66 pages

XP-80XX Programmer - Manual

The Programming Manual for the Thermal Printer XP-80X Series provides detailed command instructions for the POS-80XX thermal bill printer, including command names, formats, descriptions, and notes. It covers various commands such as real-time status transfer, printing modes, and character spacing settings, with specific details on their formats in ASCII, hexadecimal, and decimal codes. Additionally, the manual outlines the conditions under which certain commands are valid and their interactions with different printer models.

Uploaded by

melchibaidoo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 66

Programming Manual for the Thermal Printer

XP-80X Series

Printer THERMAL RECEIPT PRINTER 1


Format Description
This manual is applicable to the products of POS-80XX series of 80mm series thermal bill printer which is

produced by the company. Command instructions for this programming manual include the following sections:

1) Command name and function overview. This is the first part of the command description. The command in

ASCII code and the function of the command are given.

2) Format. This part uses ASCII code form, the hexadecimal code form and decimal code 3 forms to describe the

command.

Unless it is specified, the value range is a decimal number. For example, 1 ≤ n ≤ 4 in the following example,

where 1 is the 1 of the decimal number, rather than "1" in the ASCII code coding table.

3) Scope. The range of variables is given.

4) Description. A detailed explanation of the command is given.

5) Notes. Notes for the command are given. The details are given in this section because commands in different

modes and in conjunction with different commands can cause mutual interaction.

6) Reference. Other commands which are related to and similar to this command are given.

7) Some commands are only supported by some models, such as page mode (supports models: C300H, D300N,

R330HT890, T891S300L, A300L, E300N, H300L, etc.)


---> DLE EOT n Real-time status transfer
---> [Format] ASCII code DLE EOT n
Hexadecimal code 10 04 n
Decimal code 16 4 n
---> [Range] 1≤n≤4
---> [Description] The printer status which is specified by parameter n is transmitted in real time:
......
---> [Note] The printer returns the relevant status as soon as it receives the command
......
---> [Reference]
1. HT horizontal positioning
[Format] ASCII code HT
Hexadecimal code 09
Decimal code 9
[Description] Move the print position to the position of the next horizontal positioning.
[Note]  If the position of the next horizontal positioning is not set, the command will be ignored.
 If the position of the next horizontal positioning is outside the print area, the print position
will be moved to the area [Print area width+1].
 The position of the horizontal positioning is set by the ESC D command.

Printer THERMAL RECEIPT PRINTER 2


•When the command is received when the print position is at [Print area width+1], the printer
executes the print buffer to print the current line full, and processes the horizontal positioning at
the beginning of the next line.
•The default horizontal positioning position is also one spacing for every 8 standard ASCII
characters (12×24)(i. e., 9, 17, 25, ... columns).
•When the current line buffer is full, the printer performs the following actions: In standard mode,
the printer prints the contents of the current line and places the print position at the start position
of the next line. In the page mode, the printer wraps lines and places the print position at the start
position of the next line.
[Reference] ESC D
2. LF printing and line feed
[Format] ASCII code LF
Hexadecimal code 0A
Decimal code 10
[Description] The data in the print buffer is printed and the printing paper is moved forward one line at the
current line spacing.
[Note] This command sets the print position to the start position of the line.
[Reference] ESC 2, ESC 3
3. FF prints and returns to the standard mode (in page mode)
[Format] ASCII code FF
Hexadecimal code 0C
Decimal code 12
[Description] Prints all the data in the print buffer in page mode and returns to standard mode.
[Note] •After printing, clear the data in the buffer.
•The print area which is set by ESC W is reset to the default setting.
•The printer does not perform a paper cut action.
•This command sets the print position as the starting point of the line.
•This command is only valid in the page mode.
[Reference] ESC FF, ESC L, ESC S
4. Cancel the printing data in the CAN page mode

[Format] ASCII code CAN


Hexadecimal code 18

Decimal code 24

[Description] In page mode, delete all the printing data in the current print area.
[Note] •This command is only valid in page mode.
•If there is an overlap between the previously set area and the current area, the overlap will also be
also deleted.
[Reference] ESC L, ESC W

Printer THERMAL RECEIPT PRINTER 3


5. DLE EOT n Real-time status transfer
[Format] ASCII code DLE EOT n
Hexadecimal code 10 04 n
Decimal code 16 4 n
[Range] 1≤n≤4
[Description] The printer status is transmitted in real time in line with the following parameters, and the
parameter n is used to specify the printer status to be transferred:
n=1: Transfer printer status
n=2: Transfer offline status
n=3: Transfer error status
n=4: Transfer paper sensor status
[Note] •The printer returns the relevant status as soon as it receives the command
•Try not to insert this command in a 2-byte or other more command sequence.
•This command is valid even if the printer is prohibited by the ESC = (Select the peripheral setting)
command.
•The printer transmits the current state, each represented by 1-byte of data.
•The printer transfer status does not confirm that the host has received it.
•The printer executes as soon as it receives the command.
•This command is only valid for serial printers. The printer executes the command as soon as it is
received in any state.
n=1: Printer status

Bit 0/1 Hexadecimal code Decimal code Function


0 0 00 0 Be fixed to 0
1 1 02 2 Be fixed to 1
0 00 0 One or two cash drawer open
2
1 04 4 Both cash drawer are closed
0 00 0 Online
3
1 08 8 Offline
4 1 10 16 Be fixed to 1
5, 6 --- --- Undefined
7 0 00 00 Be fixed to 0
n=2: Offline status
Bit 0/1 Hexadecimal code Decimal code Function
0 0 00 0 Be fixed to 0
1 1 02 2 Be fixed to 1
0 00 0 Upper cover is closed
2
1 04 4 Upper cover is open
0 00 0 The paper feed key is not pressed
3
1 08 8 The paper feed key is pressed
4 1 10 16 Be fixed to 1
0 00 0 Printer is not running out of paper
5
1 20 32 Printer is running out of paper

Printer THERMAL RECEIPT PRINTER 4


0 00 0 No errors
6
1 40 64 Error condition
7 0 00 0 Be fixed to 0
n=3: Error status
Bit 0/1 Hexadecimal code Decimal code Function
0 0 00 0 Be fixed to 0
1 1 02 2 Be fixed to 1
2 --- --- Undefined
0 00 0 There is no error in the cutter.
3
1 08 8 There is an error in the cutter
4 1 10 16 Be fixed to 1
0 00 0 There are no unrecoverable errors
5
1 20 32 There are unrecoverable errors
0 00 0 Print-head temperature and voltage are normal
6 Print-head temperature or voltage is out of
1 40 64
range
7 0 00 0 Be fixed to 0
n=4: Transfer status
Bit 1/0 Hexadecimal code Decimal code Function
0 0 00 0 Be fixed to 0
1 1 02 2 Be fixed to 1
0 00 0 There are some papers
2, 3
1 0C 12 The paper will be running out
4 1 10 16 Be fixed to 1
0 00 0 There are some papers
5, 6
1 60 96 The papers are used up.
7 0 00 0 Be fixed to 0
[Reference] DLE ENQ, GS a, GS r

6. DLEENQn Real-time request to printer


[Format] ASCII code DLE ENQ n
Hexadecimal code 10 05 n
Decimal code 16 5 n
[Range] 1≤n≤ 2
[Description] The printer responds to a host request. N will specify the following request
n Request content
1 Recover from the error state and resume interrupted printing
2 Restore from error state in the clear command receive the buffer and print buffer

[Note] •This command is only valid in the event of a cutter error.


•In serial port mode, the printer executes the command as soon as it receives it.
•In the parallel mode, this command is not executed when the printer is busy.
•Try not to insert this command in a 2-byte or other more command sequence.

Printer THERMAL RECEIPT PRINTER 5


•This command is valid even if the printer is prohibited by the ESC= (Select the peripheral setting)
command.
[Reference] DLE EOT
7. DLE DC4 n m t real-time generation of cash drawer opening pulse
[Format] ASCII code DLE DC4 n m t
Hexadecimal code 10 14 n m t
[Range] Decimal code 16 20 n m t
n=1
m = 0, 1
1 ≤ t≤ 8
[Description] The set start pulse is generated at the designated pin of cash box socket. The pin is designated by
m:

m Connecting pin
0 Cash drawer socket pin 2
1 Cash drawer socket pin 5
The pulse high time is [t×100 ms] and the low time is [t×100 ms] .
[Note] •This command is ignored when the printer is executing a cash drawer open command (ESC p or
DEL DC4).
•In serial port mode, the printer executes the command as soon as it receives it.
•In the parallel mode, this command is not executed when the printer is busy.
•If the print data contains the same data as this command, the data will be executed as if it were the
command. The user must take this situation into consideration.
•Try not to insert this command in a 2-byte or other more command sequence.
•This command is valid even if the printer is prohibited by the ESC=(Select the peripheral setting)
command.
[Reference] ESC p
8. Printing in the ESC FF page mode
[Format] ASCII code ESC FF
Hexadecimal code 1B 0C
Decimal code 27 12
[Description] In page mode, all the contents of the buffer are printed.
[Note] •This command is only valid in page mode.
•The contents of the print buffer, ESC T and ESC W settings, and the positions of characters will
not be cleared after printing.
[Reference] FF, ESC L, ESC S
9. ESC SP n setting character spacing right
[Format] ASCII code ESC SP n
Hexadecimal code 1B 20 n
Decimal code 27 32 n
[Range] 0 ≤ n≤255
[Description] Sets the right spacing of characters to [n×lateral or longitudinal moving units] inches.
[Note] •When the character is enlarged, the right spacing is enlarged by the same multiple.
•The values set by this command are independent of each other in page mode and standard mode.

Printer THERMAL RECEIPT PRINTER 6


•The lateral or longitudinal movement units is designated by GS P. Changing the lateral or
longitudinal movement unit will not change the current right spacing.
•The GS P command changes the horizontal (and perpendicular) units of motion. However, the
value must not be less than the minimum horizontal movement and must be an even unit of the
minimum horizontal movement.
•In standard mode, use lateral movement units.
•In page mode, you can choose to use the lateral or longitudinal movement units, depending on
the direction and start position of the region, as follows:
1. When the printing start position is set to the position of upper left corner or the lower right
corner of the printing area by ESC T, the lateral movement unit is used;
2. When the printing start position is set to the position of lower left corner or the upper right
corner of the printing area by ESC T, the longitudinal movement unit is used;
•The maximum right spacing is 31.91 mm (255/203 inches). Any setting that exceeds this value is
automatically changed to the maximum right spacing.
[Default] n=0
[Reference] GS P
10. ESC! N Select the printing mode
[Format] ASCII code ESC ! n
Hexadecimal code 1B 21 n
Decimal code 27 33 n
[Range] 0 ≤ n ≤ 255
[Description] Set the character print mode in line with the value of n

Bit 1/0 Hexadecimal code Decimal code Function


0 00 0 Standard ASCII typeface A (12×24)
0
1 01 1 Compressed ASCII typeface B (9×17)
1, 2 --- --- Undefined
0 00 0 Cancel Bold Mode
3
1 08 8 Select bold mode
0 00 0 Cancel double height mode
4
1 10 16 Select double height mode
0 00 0 Cancel double width mode
5
1 20 32 Select double width mode
6 --- --- Undefined
0 00 0 Cancel underline mode
7
1 80 128 Select underline mode
[Note] •When Double width and Double height modes are selected at the same time, the characters are
magnified twice in both the lateral and longitudinal.
•Any character other than the HT space and the characters rotated 90°clockwise can be underlined.
•The degree of underlining is determined by ESC-, regardless of the character.
•When some characters in a line are multiples or higher, all characters are aligned at the bottom.
•ESC E can also select or cancel the bold mode, and the last executed command is valid.
•ESC – Can also select or cancel the underline mode, and the last command executed is valid.
•GS! The character size can also be set so that the last executed command is valid.

Printer THERMAL RECEIPT PRINTER 7


•Bold mode is valid for both the English characters and the Chinese characters. All print modes
except bold mode are valid only for alphanumeric characters.
[Default] n=0
[Reference] ESC -, ESC E, GS !
11. ESC $nL nH Sets the absolute printing position
[Format] ASCII code ESC $ nL nH
Hexadecimal code 1B 24 nL nH
Decimal code 27 36 nL nH
0≤nL ≤ 255
[Range]
0 ≤nH≤255
[Description] Set the current position to the distance from the beginning of the line (nL+nH×256)×(lateral or
longitudinal movement units).
[Note] •If the set position is outside the specified print area, the command will be ignored.
•The lateral and longitudinal movement units are set by GS P.
•Use lateral movement units. In the standard mode
•In the page mode, choose to use the lateral or longitudinal movement units based on the
direction of the print area and the printing start position, which are as follows:
1. When the printing start position is set to the position of upper left corner or the lower right
corner of the printing area by ESC T, the lateral movement unit is used;
2. When the printing start position is set to the position of lower left corner or the upper right
corner of the printing area by ESC T, the longitudinal movement unit is used;
[Reference] ESC \, GS $, GS \, GS P
12. ESC%n Select/cancel user self-defined characters
[Format] ASCII code ESC % n
Hexadecimal code 1B 25 n
Decimal code 27 37 n
[Range] 0 ≤ n ≤255
[Description] Select or cancel user self-defined characters.
•When the least significant bit of n is 0, the user-defined character will not be used.
•When the least significant bit of n is 1, the user-defined character will be used.
[Note] •The internal font library is automatically used when user-defined characters are removed.
•n Only the least significant bit is valid.
[Default] n=0
[Reference] ESC &, ESC ?
13. ESC&yc1c2 [x1d1…d (y×x1) ] .. . [xkd1.. . d (y×xk) ] Define the user-defined characters
[Format] ASCII code ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]
Hexadecimal code 1B 26 y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]
Decimal code
[Range] 27 38 y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]
y=3
32 ≤ c1 ≤ c2 ≤ 127
0 ≤ x ≤ 12 Standard ASCII typeface A (12×24)
0 ≤ x ≤ 9 Compressed ASCII typeface B (9×17)
0 ≤ d1 ... d(y × xk) ≤ 255
[Description] Define the user-defined characters

Printer THERMAL RECEIPT PRINTER 8


•y specifies the number of longitudinal bytes.
•c1 is the start character code and c2 is the end character code.
•x Specifies the number of the lateral points.
[Note] •The allowed range of character code is <20>H to <7F>H (96 characters) for ASCII codes.
•Multiple characters can be defined consecutively if only one character c1=c2 is defined.
•d is the data of the download character. The data for each point starts from the left.
•The size of the custom character is (y×x) bytes.
•1 in each bit of the data indicates that the point should be printed, and the 0 indicates no
printing.
•User-defined characters are cleared when:
1. ESC@is executed.
2. ESC ? is executed.
3. FS q is executed.
4. GS * is executed.
5. The printer is reset or the power is turned off.
•When a user-defined character is defined in font B (9×17), only the most significant bit of the
third byte of data in the perpendicular direction is valid.
[Default] Internal typeface library settings
[Reference] ESC %, ESC ?
[Instances]
• When a standard ASCII typeface (12×24) is selected

• When a compressed ASCII typeface is selected (9×17)

Printer THERMAL RECEIPT PRINTER 9


14. ESC*mnLnHd1... dk Select the bitmap mode
[Format] ASCII code ESC * m nL nH d1...dk
Hexadecimal code 1B 2A m nL nH d1...dk
Decimal code 27 42 m nL nH d1...dk
[Range] m = 0, 1, 32, 33
0 ≤ nL ≤ 255
0 ≤ nH ≤ 3
0 ≤ d ≤255

Printer THERMAL RECEIPT PRINTER 10


[Description] Select a bitmap mode specified by m, the number of bitmap points are being determined by nL
and nH:
Longitudinal Lateral
m Mode Number of
Resolution ration Resolution ration Number of data (k)
points
0 8 points single density 8 67 DPI 100 DPI nL + nH × 256
1 8 points double density 8 67 DPI 200 DPI nL + nH × 256
24 points single
32 24 200 DPI 100 DPI ( nL + nH × 256) × 3
density
24 points double
33 24 200 DPI 200 DPI ( nL + nH × 256) × 3
density
[dpi: point /25.4mm{1”}]
[Note] •If the value of m is beyond the specified range, nL and subsequent data are processed as normal
data.
•The number of lateral print points is determined by nL and nH, and the total number of points is
nL+nH×256.
•The bitmap is truncated beyond the current region.
•D is the data of the bitmap. If each bit of the data is 1, the point will be printed. If it is 0, it will
not be printed.
•After the bitmap data is sent, the printer returns to the normal data processing mode.
•This command is not affected by other print modes (bold, double, underline, character
enlargement, and inversion) except in the inverted mode.
•If the width of the print range set with GS L and GS W is smaller than the width which is
required for the data sent with the ESC*command, do the following for the row in question (but
print cannot exceed the maximum printable range):
1. The width of the print area is expanded to the right to accommodate the amount of data.
2. If step ¬ does not provide enough width for the data, the left edge is reduced to accommodate
the data.
•The relationship between the data and the point to be printed is as follows:
When 8 points density is selected:

Printer THERMAL RECEIPT PRINTER 11


When 24 points density is selected:

15. ESC – n Select/Cancel underline mode


[Format] ASCII code ESC - n
Hexadecimal code 1B 2D n
Decimal code 27 45 n
[Range] 0 ≤ n ≤2, 48 ≤n ≤ 50
[Description] Underline mode is selected or canceled according to the value of n:

n Function
0, 48 Cancel underline mode
1, 49 Underline mode is selected (1 point of width)
2, 50 Underline mode is selected (2 points of width)

[Note] •Underlines can be placed under all characters (including spacing to the right), but do not include
spacing set by HT.
•Underlining cannot be applied to characters that are rotated 90°clockwise and inverted.
•When the underline mode is canceled, the following characters are not underlined and the width of
the underscore does not change The default width is a point of width.
•Changing the character size does not affect the current underline width.
•Underline selection can also be canceled by ESC! To be set. The last executed command is valid.
•This command does not affect the setting of the Chinese characters.
[Default] n=0
[Reference] ESC !

16. ESC 2 Set the default line spacing


[Format] ASCII code ESC 2
Hexadecimal code 1B 32
Decimal code 27 50
[Description] Select approximately 3.75mm line spacing.
[Note] • Line spacing is independent in standard mode and page mode.
[Reference] ESC 3

Printer THERMAL RECEIPT PRINTER 12


17. ESC 3 n Set the line spacing
[Format] ASCII code ESC 3 n
Hexadecimal code 1B 33 n
Decimal code 27 51 n
[Range] 0 ≤ n ≤ 255
[Description] Set the line spacing to [n×movement units longitudinal or lateral] inches.
[Note] •Line spacing settings are independent of each other in the standard mode and page mode.
•The lateral and longitudinal movement units are set by GS P. Changing this setting does
not affect the current line spacing.
•In standard mode, movement units longitudinal.
•In the page mode, choose to use the lateral or longitudinal movement units based on the
direction of the print area and the printing start position, which are as follows:
1. When the printing start position is set to the the position of upper left corner or the lower
right corner of the printing area by ESC T, the longitudinal movement unit is used;
2. When the printing start position is set to the position of lower left corner or the upper
right corner of the printing area by ESC T, the lateral movement unit is used;
•The maximum travel distance is 956 mm. If this distance is exceeded, the maximum
distance is taken.
[Default] The default row height is approximately 3.75mm.
[Reference] ESC 2, GS P
18. ESC=n Select the printer
[Format] ASCII code ESC = n
Hexadecimal code 1B 3D n
Decimal code 27 61 n
[Range] 0≤ n ≤ 1
[Description] Select a printer that can receive the data sent by the host computer:

Bit 1/0 Hexadecimal code Decimal code Function


0 0 00 0 Printer prohibited
1 01 1 Printer allowed
1-7 --- --- Undefined

[Note] •When the printer is prohibited, all other commands are ignored except for the real-time
commands (DLE EOT, DLE ENQ, DLE DC4).
[Default] n=1
19. ESC? N Cancel the user-defined characters
[Format] ASCII code ESC ? n
Hexadecimal code 1B 3F n
Decimal code 27 63 n
[Range] 32 ≤n ≤127
[Description] Cancel the user-defined characters
[Note] •Cancels the code n character in the user-defined character. When it is canceled, this
character uses an internal font library.
•If the custom character does not exist, the command is ignored.

Printer THERMAL RECEIPT PRINTER 13


[Reference] ESC &, ESC %
20. ESC@ Initialize printer
[Format] ASCII code ESC @
Hexadecimal code 1B 40
Decimal code 27 64
[Description] Clear the print buffer data and the print mode is set to the default mode when it is
power-up.
[Note] •The setting of the DIP switch is not tested once again.
•Excluding data retention in the receive buffer.
•The macro definition is preserved.
•NV Bitmap data will not be erased.
•The user NV memory data will not be erased.
21. ESC D n1... nk NUL sets the lateral skip position
[Format] ASCII code ESC D n1...nk NUL
Hexadecimal 1B 44 n1...nk 00
code
Decimal 27 68 n1...nk 0
code
[Range] 1 ≤ n ≤ 255
0 ≤ k ≤ 32
[Description] Sets the lateral skip position.
•Set a skip position in the nth column from the beginning of the row.
•There are a total of k skip positions.
[Note] •The lateral skip position is calculated as follows:
Character width×n, including the spacing of the right. If the character is double in width,
the skip distance is doubled.
•This command cancels the previous skip position setting.
•When n=8, the current position is the 9th column.
•A maximum of 32(k=32) skip positions are set, and data of more than 32 skip positions are
processed as normal data.
•The skip position are arranged in the ascending order, and the ending symbol is NUL.
•When [n] k is less than or equal to the previous value of [n] k-1, the skip setting ends and
the subsequent data is processed as normal data.
•ESC D NUL cancels all skip position settings.
•By changing the character width, the previously specified skip position does not change.
•Character widths are independent in standard mode and page mode.
[Default] The default tick setting is one skip position for every 8 standard ASCII characters (12×24)
(columns 9, 17, 25,...).
[Reference] HT
22. ESCEn Select/cancel bold mode
[Format] ASCII code ESC E n
Hexadecimal code 1B 45 n
Decimal code 27 69 n
[Range] 0 ≤ n ≤ 255

Printer THERMAL RECEIPT PRINTER 14


[Description] Select or cancel bold mode
When the least significant bit of n is 0, the bold mode is canceled.
When the least significant bit of n is 1, the bold mode is selected.
[Note] •n Only the least significant bit is valid.
•ESC! Also the bold mode can be selected/canceled, and the last received command is
valid.
[Default] n=0
[Reference] ESC !
23. ESC G n Select/cancel dual print mode
[Format] ASCII code ESC G n
Hexadecimal code 1B 47 n
[Range] Decimal code 27 71
0 ≤ n ≤ 255
[Description] Select/cancel dual print mode
• When the lowest bit of n is 0, the dual print mode will be canceled.
• When the lowest bit of n is 1, the dual print mode will be selected.
[Note] • n Only the least significant bit is valid.
• This command works the same as the bold printing.
[Default] n=0
[Reference] ESC E
24. ESC J n Print and paper skip
[Format] ASCII code ESC J n
Hexadecimal code 1B 4A n
Decimal code 27 74 n
[Range] 0 ≤n ≤ 255
[Description] Prints buffer data and paper skip [n×movement units longitudinal or lateral] inches.
[Note] • After printing, the current print position will be placed at the beginning of the line.
• The paper travel distance is not affected by the ESC 2 or ESC 3 command settings.
• The lateral and the longitudinal movement units are set by GS P.
• In standard mode, movement units longitudinal.
• In the page mode, you can select to use the longitudinal movement unit or the lateral
movement unit in line with the direction of the printing area and the printing start position
as follows:

1. When the printing start position is set to the the position of upper left corner or the lower
right corner of the printing area by ESC T, the longitudinal movement unit is used;
2. When the printing start position is set to the position of lower left corner or the upper
right corner of the printing area by ESC T, the lateral movement unit is used;
• The maximum travel distance is 956 mm. If this distance is exceeded, the maximum
distance is taken.
[Reference] GS P
25. ESC L Select the page mode
[Format] ASCII code ESC L
Hexadecimal code 1B 4C

Printer THERMAL RECEIPT PRINTER 15


Decimal code 27 76
[Description] Transition from the standard mode to the page mode.
[Note] • This command is only valid at the beginning of the line in the standard mode.
• In page mode, the command has no effect.
• When FF or ESC s is executed, the printer will return to the standard mode.
• This command sets the print position to the position which is determined by the ESC T
command and the ESC W command.
• This command converts the settings of the following commands (where values can be set
separately in standard mode and page mode) to the values in the page mode:
1. Setting character spacing right: ESC SP, FS S
2 Set the line spacing: ESC 2, ESC 3
• The following command changes the flag bit only in the page mode and takes effect after
switching to the standard mode.
1. Rotate 90°clockwise: ESC V
2. Select the alignment mode: ESC a
3. Select the inversion mode: ESC{
4. Set left margin: GS L
5. Set printing area width: GS W
• In the page mode, ignore the following commands:
1. Execute the testing print: GS (A
• The following commands are not available in the page mode:
1. Print the NV Bitmap: FS p
2. Define the NV Bitmap: FS q
3. Write user NV memory: FS g 1
4. Print raster bitmap: GS v 0
• When the power is turned off, the printer is reset, or the ESC@ command is executed,
the printer will return to the standard mode.
[Reference] FF, CAN, ESC FF, ESC S, ESC T, ESC W, GS $, GS \
26. ESC M n Select typeface
[Format] ASCII code ESC M n
Hexadecimal code 1B 4D n
Decimal code 27 77 n
[Range] n = 0, 1, 48, 49
[Description] Select typeface

n Function
0, 48 Select standard ASCII typeface (12×24)
1, 49 Select compressed ASCII typeface (9×17)

27. ESCRn Select international character set


[Format] ASCII code ESC R n
Hexadecimal code 1B 52 n
Decimal code 27 82 n
[Range] 0 ≤n ≤ 15

Printer THERMAL RECEIPT PRINTER 16


[Description] Select an international character set n from the following table:

n Character set
0 The United States
1 France
2 Germany
3 U. K.
4 Denmark I
5 Sweden
6 Italy
7 Spain I
8 Japan
9 Norway
10 Denmark II
11 Spain II
12 Latin America
13 Korea
14 Slovenia/Croatia
15 China

[Default] n=0
28. ESCS Select the standard mode
[Format] ASCII code ESC S
Hexadecimal code 1B 53
Decimal code 27 83
[Description] Set standard mode
[Note] •This command is valid in the page mode.
•This command clears the page buffer print data.
•This command places the current position at the beginning of the line.
•The page mode area is initialized to the default value.
•This command converts the settings of the following commands to values in the standard
mode:
1. Set the right spacing: ESC SP, FS S
2. Select the line spacing: ESC 2, ESC 3

•The following commands can be used to set relevant parameters in the standard mode, but
their settings are not effective until they enter the page mode:
1. Set the printing area in the page mode: ESC W
2. Set the area direction in the page mode: ESC T
•The following command is ignored in the standard mode:
1. Set longitudinal absolute printing position in the page mode: GS $
2. Set the relative printing position in the page mode: GS\
•The printer returns to the standard mode after the printer hardware reset or the ESC@

Printer THERMAL RECEIPT PRINTER 17


command is executed.
[Reference] FF, ESC FF, ESC L
29. ESC T n Select the printing area direction in the page mode
[Format] ASCII code ESC T n
Hexadecimal code 1B 54 n
Decimal code 27 84 n
[Range] 0 ≤ n ≤ 3 48 ≤ n ≤ 51
[Description] Select the direction and start position of the print area in the page mode.
n Specify the direction and start position of the printing area:

n Print direction Start position


Upper left
0.48 Left to right
(A in the figure)
From the bottom to the Lower left
1.49
top (B in the figure)
Lower right
2.50 From the right to the left
(C in the figure)
From the top to the Upper right
3.51
bottom (D in the figure)

[Note] •If the current mode is the standard mode, only the internal flag bit is set without affecting
the printing.
•This command sets the start position of the print content in the printing area.
•Depending on the starting area of printing, the use of lateral or longitudinal movement units
is also different:
1. If the printing start position is at the position of upper left corner or lower right corner of
the printing area, the arrangement direction of the printed contents is perpendicular to the
printing feeding direction.
The following commands employ lateral movement units: ESC SP, ESC $, ESC\
The following commands utilize longitudinal movement units: ESC 3, ESC J, GS $, GS\
2. If the start position of the printer is the position of lower left corner or the upper right
corner of the printing area, the arrangement direction of the printed contents is the same as
the paper feeding direction of the printer.
The following commands employ lateral movement units: ESC 3, ESC J, GS $, GS \
The following commands utilize longitudinal movement units: ESC SP, ESC $, ESC \
[Default] n=0
[Reference] ESC $, ESC L, ESC W, ESC \, GS $, GS P, GS \

30. ESC V n Select/cancel 90 degrees clockwise rotation


[Format] ASCII code ESC V n
Hexadecimal code 1B 56 n
Decimal code 27 86 n
[Range] 0 ≤ n ≤ 1, 48 ≤ n ≤ 49

Printer THERMAL RECEIPT PRINTER 18


[Description] Select/cancel 90 degrees clockwise rotation
The value of n is as follows:

n Function
0, 48 Cancel clockwise 90 degrees mode
1, 49 Select clockwise 90 degree rotation mode

[Note] •This command is only valid in the standard mode.


•When the underline mode is selected, the underline cannot be rotated 90 degrees
clockwise and no underline is added to printing.
•The double height and the double width in the 90 degree clockwise rotation mode are
opposite to those in the normal mode.
[Default] n=0
[Reference] ESC !, ESC -
31. Set the printing area ESCWxLxHyLyHdxLdxHdyLdyH in the page mode
[Format] ASCII code ESC W xL xH yL yH dxL dxH dyL dyH
Hexadecimal code 1B 57 xL xH yL yH dxL dxH dyL dyH
Decimal code 27 87 xL xH yL yH dxL dxH dyL dyH
[Range] 0 ≤ xL, xH, yL, yH, dxL, dxH, dyL, dyH ≤ 255(except dxL=dxH=0 or dyL=dyH=0)
[Description] •Set the area lateral start position, longitudinal start position, area width, and height as follows:
Lateral start position: x0=[ (xL+xH×256) x unit of lateral movement]
Longitudinal start position: y0=[ (yL+yH×256)×unit of longitudinal movement]
Printing area width: dx=[dxL+dxH×256]×lateral movement unit]
Printing area height: dy=[dyL+dyH×256]×unit of longitudinal movement]
[Note] •This command sets only the internal flag bit in the standard mode and does not affect printing.
•If the lateral start position or the longitudinal start position exceeds the print area, the printer
stops processing the command, and the subsequent data is processed as normal.
•If the width or height of the print area is set to 0, the printer stops processing the command, and
the subsequent data is processed as normal data.
•This command, in conjunction with the ESC T command, determines the current printing
position.
•If the value of lateral start position+print area width exceeds the printable area, the width of the
printing area is automatically adjusted to lateral printable width-lateral start position.
•If the longitudinal start position+print area height value exceeds the printable area, the height of
the printing area is automatically adjusted to longitudinal printable height-longitudinal start
position.
•The lateral and longitudinal movement units are specified by GS P. Changing the lateral and
longitudinal movement units does not change the current printing area.
•Set the lateral start position and area width in the lateral movement units, and set the longitudinal
start position and the area height in the longitudinal movement units.
•Assuming that the lateral start position, longitudinal start position, printing area width and
printing area height are X, Y, Dx, Dy, the setting of the printing area is as shown in the following
figure:

Printer THERMAL RECEIPT PRINTER 19


The printable area of the printer is about 73 mm in the lateral direction and about 150 mm in the longitudinal
direction.
[Default] xL = xH = yL = yH = 0
dxL = 72, dxH = 2, dyL = 176, dyH = 4
[Reference] CAN, ESC L, ESC T, GS P
32. ESC\nLnH Set the relative landscape printing position
[Format] ASCII code ESC \ nL nH
Hexadecimal code 1B 5C nL nH
Decimal code 27 92 nL nH
[Range] 0 ≤ nl ≤ 255 0 ≤ nH ≤ 255
[Description] Set the lateral relative displacement in lateral or longitudinal movement units.
•This command sets the print position to [(nL+nH×256)×units of lateral or longitudinal
movement] from the current position.
[Note] •Settings that exceed the printable area are ignored.
•When the printing position moves to the right: nL+nH×256=N.
Use complement when the printing position moves to the left: nL+nH×256=65536 – N.
•The print start position is moved from the current position to [N×units of lateral and longitudinal
movement] .
•The units of lateral and longitudinal movement are set by the GS P command.
•In the standard mode, use lateral movement units.
•In the page mode, you can choose to use either a lateral or longitudinal movement units, based
on the direction and start position of the print area, as follows:
1. When the printing start position is set to the position of upper left corner or the lower right
corner of the printing area by ESC T, the lateral movement unit is used;
2. When the printing start position is set to the position of lower left corner or the upper right
corner of the printing area by ESC T, the longitudinal movement unit is used;
[Reference] ESC $, GS P
33. ESCan Select alignment method
[Format] ASCII code ESC a n

Hexadecimal code 1B 61 n
Decimal code 27 97 n

[Range] 0 ≤ n ≤ 2, 48 ≤ n ≤ 50
[Description] Make all print data be arranged in a specified alignment method.
The corresponding relationship between the value of n and the alignment method is as follows:

Printer THERMAL RECEIPT PRINTER 20


n Alignment method
0, 48 Left justifying
1, 49 Center alignment
2, 50 Right justifying

[Note] •This command is only valid at the beginning of the line in standard mode.
•This command changes only the internal flag bit in page mode.
•This command performs the alignment in the printing area.
•This command adjusts the blank spacing based on HT, ESC $, or ESC\\ commands.
[Default] n=0
[Instances]

AB C ABC AB C
AB C D ABCD ABCD
AB C D E AB C D E ABCDE

Left justifying Centered Right justifying


34. ESC c 3 n Select the print paper sensor to output the paper missing signal
[Format] ASCII code ESC c 3 n
Hexadecimal code 1B 63 33 n
Decimal code 27 99 51 n
[Range] 0 ≤ n ≤ 255
[Description] •Select the print paper sensor to output the paper missing signal.
•The use of each bit of the parameter n is shown in the following table:

Bit Off/On Hexadecimal Decimal Function


Off 00 0 Prohibit paper exhaustion sensor
0
On 01 1 Allow paper exhaustion sensor
Off 00 0 Prohibit paper exhaustion sensor
1
On 02 2 Allow paper exhaustion sensor
Off 00 0 Prohibit print the paper end sensor
2
On 03 3 Allow print the paper end sensor
Off 00 0 Prohibit print the paper end sensor
3
On 04 4 Allow print the paper end sensor
4-7 - - - Undefined
[Description] •A plurality of sensors may be selected to output signals. If any of the sensors detects the shortage
of papers, a paper out signal is shown.
•This command is valid only on parallel interfaces and is ignored in serial interface mode.
•Convert sensors when it is executing this command. Delay the conversion of the paper shortage
signal based on the received buffer status.
•If Bit 0 or Bit 1 is ON, the paper exhaustion sensor is selected as the print paper sensor to output
a paper out signal.
•If Bit 2 or Bit 3 is ON, the print the paper end sensor is selected as the print paper sensor to
output a paper out signal.
•When all sensors are prohibited, a printing paper presence signal is always output as a printing

Printer THERMAL RECEIPT PRINTER 21


paper current status.
[Default] n=15
35. ESC c 4 n Select the print paper sensor to stop printing
[Format] ASCII code ESC c 4 n
Hexadecimal code 1B 63 34 n
Decimal code 27 99 52 n
[Range] 0 ≤ n ≤ 255
[Description] •Select the print paper sensor to output the paper missing signal.
•The use of each bit of the parameter n is shown in the following table:

Bit Off/On Hexadecimal Decimal Function


0 Off 00 0 Prohibit paper exhaustion sensor
On 01 1 Allow paper exhaustion sensor
1 Off 00 0 Prohibit paper exhaustion sensor
On 02 2 Allow paper exhaustion sensor
2-7 - - - Undefined

[Note] •When using this command to allow a print paper sensor to be active, printing is stopped only
when the corresponding paper is selected for the printing.
•When the roll paper sensor detects the end of the printing paper, the printer stops printing and
enters the offline status.
•When Bit 0 or Bit 1 is ON, the printer selects the paper exhaustion sensor as the print paper
sensor to stop printing.
[Default] n=0
36. ESC c 5 n Enable/prohibited button
[Format] ASCII code ESC c 5 n
Hexadecimal code 1B 63 35 n
Decimal code 27 99 53 n
[Range] 0 ≤ n ≤ 255
[Description] Enable/prohibited button
•The key is activated when the lowest bit of n is 0.
•The key is prohibited when the least significant bit of n is 1.
[Note] •Only the least significant bit of n is valid.
•When a key is prohibited, the key does not work.
•Keys are always available when macro commands are executed.
[Default] n=0
37. ESC d n Print and advance forward n lines
[Format] ASCII code ESC d n
Hexadecimal code 1B 64 n
Decimal code 27 100 n
[Range] 0 ≤n ≤ 255
[Description] Prints the data in the buffer and advances forward n lines (lines of characters).
[Note] • This command sets the printing start position of the printer at the beginning of the line.
• This command does not affect the row spacing set by ESC 2 or ESC 3.

Printer THERMAL RECEIPT PRINTER 22


• The maximum paper feed distance is 1016 mm. When the set value is larger than 1016 mm, the
maximum value is taken.
[Reference] ESC 2, ESC 3
38. ESC pm t1 t2 generates cash drawer control pulse
[Format] ASCII code ESC p m t1 t2
Hexadecimal code 1B 70 m t1 t2
Decimal code 27 112 m t1 t2
[Range] m = 0, 1, 48, 49
0 ≤ t1 ≤ 255, 0 ≤ t2 ≤ 255
[Description] Outputs the cash drawer opening pulse set by t1 and t2 to the pin which is designated by m:

M Connecting pin
0, 48 Pin 2 of cash drawer socket
1, 49 Pin 5 of cash drawer socket

[Note] • The high-level time of the cash drawer opening pulse is [t1×2 ms], and the flat time of the low
point is [t2×2 ms].
• If t2 < t1, the time for low level is [t1×2 ms].
[Reference] DLE DC4
39. ESCtn Select character code table
[Format] ASCII code ESC t n
Hexadecimal code 1B 74 n
Decimal code 27 116 n
[Range] 0 ≤n ≤ 10 , 16 ≤n ≤ 19
[Description] Select Page n from the character code table:

n Page
0 PC437 [US, European Standard]
1 Katakana
2 PC850 [Multilingual]
3 PC860 [Portuguese]
4 PC863 [Canada-French]
5 PC865 [Northern Europe]
6 West Europe
7 Greek
8 Hebrew
9 PC755:East Europe
10 Iran
16 WPC1252
17 PC866:Cyrillice*2
18 PC852:Latin2
19 PC858
[Default] n=0

Printer THERMAL RECEIPT PRINTER 23


40. ESC{n Select/Cancel inverted print mode
[Format] ASCII code ESC { n
Hexadecimal 1B 7B N
Decimal 27 123 n
[Range] 0 ≤ n ≤ 255
[Description] Select/Cancel inverted print mode
• When the lowest bit of n is 0, the inverted print mode is canceled.
• When the lowest bit of n is 1, the inverted print mode is selected.
[Note] • Only the least significant bit of n is valid;
• This command is only valid at the beginning of the line in standard mode.
• This command changes only the internal flag bit in the page mode.
• This command has no effect on the page mode printing.
• In the inverted print mode, the printer rotates the lines to be printed by 180 degrees and then
prints.
[Default] n=0
[Instances]

41. FS p n m Print bitmap and download it to FLASH


[Format] ASCII code FS p n m
Hexadecimal code 1C 70 n m
Decimal code 28 112 n m
[Range] 1 ≤ n ≤ 255 0 ≤ m ≤ 3 , 48 ≤ m ≤51
[Description] Print the bitmap and download it to FLASH in the mode specified by m.

m Mode Longitudinal resolution Lateral resolution


(DPI) (DPI)
0, 48 Normal 200 200
1, 49 Double width 200 100
2, 50 Double height 100 200
3, 51 Double width and double height 100 100
• n denotes the drawing number of the bitmap (defined by the command FS q).
• m Specify the mode in which the bitmap is printed.
[Details] • Flash bitmap is a bitmap which is defined by command FS q and stored in the Flash memory
and printed with command FS p.

Printer THERMAL RECEIPT PRINTER 24


• This command has no effect when the Flash bitmap is not defined.
• In the standard mode, this command is valid only if there is no data in the print buffer.
• This command is not affected by other print modes except the inverted print mode (e. g. bold
printing, overlay printing, double height, double width, underline, character enlargement, white
print, 90 degrees clockwise rotation, and so on).
• If the downloaded bitmap which is to be printed exceeds the current print area, the excess is
not printed.
• In normal and double width modes, the command feeds the n point, where n is the NV bitmap
height. In the double height and quadruple size modes, the command feeds n×2 points, where n
is the NV bitmap height, regardless of the line spacing set by ESC 2 or ESC 3.
• After the bitmap is printed, the printer wraps lines and processes the subsequent data in normal
mode.
[Reference] ESC *, FS q, GS /, GS v 0
42 FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n Define the Flash Bitmap
[Format] ASCII code FS q n [ xL xH yL yH d1...dk]...[ xL xH yL yH d1...dk]
Hexadecimal code 1C 71 n [xL xH yL yH d1...dk]...[ xL xH yL yH d1...dk]
Decimal code 28 113 n [xL xH yL yH d1...dk]...[ xL xH yL yH d1...dk]
[Range] 1 ≤ n ≤ 255
0 ≤ xL ≤ 255
1 ≤ ( xL + xH × 256) ≤ 1023
1 ≤ ( yL + yH × 256) ≤ 288
0 ≤ d ≤ 255
k = ( xL + xH × 256) × ( yL + yH × 256) × 8
Flash download capacity is up to 8096 bytes
[Description] Define the Flash Bitmap:
• n specify the number of Flash bitmaps to be defined.
• xL, xH specify the number of lateral points of the flash bitmap (xL+xH×256)×8.
• yL, yH specify the number of longitudinal points of the Flash bitmap (yL+yH×256)×8.
[Note] • Frequent execution of this command can damage the Flash memory. It is recommended that you
write Flash up to 10 times a day.
• This command deletes all Flash bitmaps previously defined by the command. The printer cannot
redefine one of the previously defined bitmaps, in which case all data must be resent.
• Since the printer is busy during the processing of the command, it writes data to Flash and stops
receiving other commands, and therefore, during the execution of the command, sending other
commands to the printer, including real-time commands, is prohibited.
• Flash bitmap is a bitmap which is defined by command FS q and stored in the Flash memory
and printed with command FS p.
• In the standard mode, this kind of command is only valid at the beginning of a line.
• Seven bytes of data from FS to yH are processed as the command data and are not part of the
graphics data.
• When the bitmap data byte count exceeds the range defined by xL, xH, yL, yH to its left, the
printer only processes data in the range defined by xL, xH, yL, yH.
• In that first set of flash bitmap, this command has no effect when any of the parameter xL, xH,
yL, yH are out of the defined range.

Printer THERMAL RECEIPT PRINTER 25


• When we are downloading multiple bitmaps, if the printer processes xL, xH, yL, yH beyond the
defined range, the printer stops executing this command. Bitmaps after this are not valid in the
command. Bitmaps preceding this are valid.
• d is defined bitmap data, in which the corresponding bit of 1 indicates that the point will be
printed, and 0 indicates that therer is no printing.
• This command defines n Flash bitmaps. The sequence number of each bitmap increases from
number 1, so the first data group [xL xH yL yH d1... dk] is the data of Flash bitmap 1 and the last
data group [xL xH yL yH d1.. . dk] is the data of Flash bitmap n. This is also true when printing
bitmaps are with the FS p command.
• The data defining a Flash bitmap consists of [xL xH yL yH d1... dk] . Therefore, when there is
only one bitmap, n=1. The number of bytes of Flash memory employed by the printer is as
follows:
[Number of sub-nodes in bitmap data:(xL+xH×256)×(yL+yH×256)×8]+[Header information: 4]
• In the printer, the maximum Flash download spacing is 64K bits (8K bytes). This command can
define multiple Flash bitmaps, but it cannot define a bitmap whose size exceeds the 64K bits (the
download spacing varies with different printers, please refer to the printer configuration
information).
• The printer is busy immediately before it writes Flash.
• In processing the command, the printer does not transfer the status nor carries out a status query.
• When the command is accepted during macro definition, the printer ends the macro definition
and begins to execute the command.
• If a Flash bitmap is defined, it cannot be erased by executing ESC@ commands, resetting, and
powering down.
• This command only defines the Flash bitmap and does not execute the printing task. The FS p
command is used to print the Flash bitmap.
[Reference] FS p
[Instances] When xL=64, xH=0, yL=96, yH=0

Printer THERMAL RECEIPT PRINTER 26


43. GS! n Select the character size
[Format] ASCII code GS ! n
Hexadecimal code 1D 21 n
Decimal code 29 33 n
[Range] 0 ≤ n ≤ 255
(1 ≤ longitudinal magnification ration ≤ 8, 1 ≤ lateral amplification ration ≤ 8)
[Description] Use 0 to 2 bits to select character height and 4 to 7 bits to select character width
As follows:
Bit 0/1 Hexadecimal code Decimal code Function
0-3 For character height selection, see the Table 2
4-7 For character width selection, see the Table 1
Table 1 Table 2
Character width selection Character height selection
Lateral Longitudinal
Hexadecimal code Decimal code Hexadecimal code Decimal code
magnification magnification
00 0 1 (Normal) 00 0 1 (Normal)
10 16 2 (2 Double width) 01 1 2 (2 Double height)
20 32 3 02 2 3
30 48 4 03 3 4
40 64 5 04 4 5
50 80 6 05 5 6
60 96 7 06 6 7
70 112 8 07 7 8

Printer THERMAL RECEIPT PRINTER 27


[Note] • This command is valid for all characters (ASCII and Kanji), except for the HRI characters.
If n is outside the specified range, this command is ignored.
• In standard mode, the longitudinal direction is the paper feed direction and the lateral direction
is the direction perpendicular to the paper feed direction. But when the character is rotated
90°clockwise, the lateral and longitudinal are reversed.
• In the page mode, the landscape and portrait depend on the orientation of the region.
• When the magnification of a character on the same line is different, all characters will be
underlined.
• ESC! The command can also select or cancel the double width and height of the characters, and
the last received command is valid.
[Default] n=0
[Reference] ESC !
44. Set longitudinal absolute position in the GS $nL nH page mode
[Format] ASCII code GS $ nL nH
Hexadecimal code 1D 24 nL nH
Decimal code 29 36 nL nH
[Range] 0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255
[Description] • Sets the absolute longitudinal position in the page mode.
• This command sets the absolute position to the [(nL+nH×256) x (movement units longitudinal
or lateral)] inches.
[Note] • This command is valid only in the page mode.
• This command is ignored if the value of [(nL+nH×256) × movement units longitudinal or
lateral) ] exceeds the set print area.
• The lateral position will not change after the command is executed
• The reference position is set by the ESC T command.
• Depending on the print area direction and the start position set by the ESC T command, the
command causes the printer to operate as follows:
① If the print start position is either the upper left corner or the lower right corner, this
command sets the absolute position in the direction parallel to the paper feed direction.
② If the print start position is either the upper right corner or the lower left corner, this
command sets the absolute position in the direction which is perpendicular to the paper feed
direction.
• The units of lateral and longitudinal movement are set by the GS P command.
[Reference] ESC $, ESC T, ESC W, ESC \, GS P, GS \
45. GS*x y d1... d (x×y×8) Define the download bitmap
[Format] ASCII code GS * x y d1...d(x × y × 8)
Hexadecimal code 1D 2A x y d1...d(x × y × 8)
Decimal code 29 42 x y d1...d(x × y × 8)
[Range] 1 ≤ x ≤ 255, 1 ≤ y ≤ 48
x × y ≤ 912
0 ≤ d ≤ 255
[Description] Define a download bitmap with points specified by x and y
• x refers to the number of lateral points of the bitmap;
• y is the number of points in the longitudinal direction of the bitmap.

Printer THERMAL RECEIPT PRINTER 28


[Note] • The number of points in the bitmap lateral is x×8; the number of points in the bitmap portrait is
y×8.
• This command has no effect if x×y is beyond the specified range.
• d is bitmap data. The data corresponding bit is 1, which indicates that the point is printed, and a
bit of 0 indicates no printing.
• The downloaded bitmap is cleared in the following cases:
1. Execute the ESC@.
2. Execute the ESC &.
3. Execute the FS q.
4. Reset the printer or turn off the power.
• The relationship between printing data and download bitmap is shown in the following figures:

[Reference] GS/
46. GS (A pL pH n m carries out the hexadecimal dump of print data
[Format] ASCII code GS ( A pL pH n m
Hexadecimal code 1D 28 41 pL pH n m
Decimal code 29 40 65 pL pH n m
[Range] pL=2, pH=0;
n=0, 48 ;m=1, 49;
47. GS/m Print download bitmap
[Format] ASCII code GS / m
Hexadecimal code 1D 2F m
Decimal code 29 47 m
[Range] 0 ≤ m ≤ 3, 48 ≤ m ≤ 51
[Description] Print a download bitmap. The print mode is specified by m. The print mode that m chooses is as
follows:

m Mode Longitudinal resolution Lateral resolution


(DPI) (DPI)
0, 48 Normal 200 200
1, 49 Double width 200 100
2, 50 Double height 100 200
3, 51 Double width and double height 100 100

Printer THERMAL RECEIPT PRINTER 29


[Note] • This command will be ignored if the downloaded bitmap is not defined.
• In the standard mode, this command is valid only if the print buffer has no data;
• Except the inverted print mode, the other inverted print mode have no effect on this command
(including bold, double, underline, font enlargement and reverse printing).
• If the downloaded bitmap exceeds the print area, the excess will not be printed.
• The command print bitmap is downloaded to RAM, not downloaded to FLASH. The
corresponding drawing number is the drawing number which is set by GS* command.
[Reference] GS *, GS *
48. GS: Start/End macro definition
[Format] ASCII code GS :
Hexadecimal code 1D 3A
Decimal code 29 58
[Description] Start/End macro definition.
[Note] • During normal operation, the printer receives the command to start macro definition. When a
macro is defined, the printer receives the command to end the macro definition.
• When the printer receives the GS^ command while it is defining a macro, the macro definition is
over and the macro definition is cleared.
• When the printer powers up, there is no macro definition.
• ESC@ cannot clear the macro definition, so the macro definition content can include the ESC@
command.
• If the printer receives GS on the previous occasion: immediately after the former one, the printer
remains macro undefined.
• Macro definition content can be up to 2048 bytes. If the macro definition exceeds 2048 bytes, the
excess data will be treated as normal data.
[Reference] GS ^
49. GSBn Select/cancel black and white reverse print mode
[Format] ASCII code GS B n
Hexadecimal code 1D 42 n
Decimal code 29 66 n
[Range] 0 ≤ n ≤ 255
[Description] Select/cancel black and white reverse print mode.
• When the least significant bit of n is 0, the reverse print is canceled.
• When the least significant bit of n is 1, the reverse print is selected.
[Note] • n Only the least significant bit is valid.
• This command is valid for all characters except the HRI characters.
• When reverse print is selected, the character spacing which is set by the ESC SP command is
also inverted.
• This command does not affect bitmaps, custom bitmaps, bar-codes, the HRI characters, and
white space set by HT, ESC $, and ESC\.
• This command will not affect the spacing between rows.
• The black-and-white reverse print mode has a higher priority than the underline mode. The
underline mode does not work when the black-and-white reverse print mode is selected. The
underline mode is set only after the black-and-white reverse mode is canceled.
[Default] n=0

Printer THERMAL RECEIPT PRINTER 30


50. GS H n Select the printing position of the HRI characters
[Format] ASCII code GS H n
Hexadecimal code 1D 48 n
Decimal code 29 72 n
[Range] 0 ≤ n ≤ 3, 48 ≤ n ≤ 51
[Description] When printing a bar-code, select a print location for the HRI character.
n specify the HRI print position:

n Print location
0, 48 Do not print
1, 49 Above the bar-code
2, 50 Below the bar-code
3, 51 Print both above and below the
bar-code

• The HRI is a character that comments on the contents of the bar-code.


[Note] • The typeface of the HRI characters is designated by the GS f command.
[Default] n=0
[Reference] GS f, GS k

51. GS L nL nH set the left margin


[Format] ASCII code GS L nL nH
Hexadecimal code 1D 4C nL nH
Decimal code 29 76 nL nH
[Range] 0 ≤ nL ≤ 255
0 ≤ nH ≤ 255
[Description] • Set the left margin by means of nL and nH;
• The left margin is set to [(nL+nH×256)×lateral movement units] inches.

[Note] • In the standard mode, this command is only effective at the beginning of the line.
• In the page mode, this command has no effect and the printer will treat the command as normal
characters.
• This command does not affect printing in the page mode.
• If the setting exceeds the maximum available printing width, then the maximum available print
width will be taken
• The lateral and longitudinal movement units are set by the GS P command, and changing the
longitudinal and lateral movement units does not affect the current left margin.
[Default] nL = 0, nH = 0
[Reference] GS P, GS W

Printer THERMAL RECEIPT PRINTER 31


52. GS P x y sets the lateral and longitudinal movement units
[Format] ASCII code GS P x y
Hexadecimal code 1D 50 x y
Decimal code 29 80 x y
[Range] 0 ≤ x ≤ 255
0 ≤ y ≤255
[Description] • Set the lateral movement units to approximately 25.4/x mm (1/x inch) and the longitudinal
movement units to 25.4/y mm (1/y inch), respectively.
• When x and y are 0, x and y are set as the default values.
[Note] • The direction perpendicular to the paper feed direction is lateral, and the paper feed direction is
the longitudinal direction.
• In the standard mode, the following commands use x or y, even if the character is rotated
(inverted or rotated 90°clockwise does not change;
① Commands by using x: ESC SP, ESC $, ESC\, FS S, GS L, GS W
② Commands by using y: ESC 3, ESC J, GS V
• In the page mode, x or y is determined according to the direction of the area and the printing
start position:
① When the printing start position is set to the upper left corner (print direction from left to
right) or the lower right corner (print direction from right to left) with the ESC T command:
Commands by using x: ESC SP, ESC $, ESC W, ESC \, FS S
Commands by using y: ESC 3, ESC J, ESC W, GS $, GS \, GS V
② When the printing start position is set to the upper right corner (from top to bottom in the print
direction) or the lower left corner (from bottom to top in the print direction) with the ESC T
command:
Commands by using x: ESC 3, ESC J, ESC W, GS $, GS \
Commands by using y: ESC SP, ESC $, ESC W, ESC \, FS S, GS V
• This command does not affect other settings which are previously set.
• The smallest unit of movement is the result of a combination of this very command and other
commands.
• One inch is equal to 25.4 mm.
[Default] x=200, y=200, where one movement unit is a print point. The lateral distance is about 1/8 mm
and the longitudinal distance is about 1/7 mm.
[Reference] ESC SP, ESC $, ESC 3, ESC J, ESC W, ESC \, GS $, GS L, GS V, GS W, GS \
53. ① GS V m ② GS V m n Select the paper cutting mode and cut paper
[Format] ①ASCII code GS V m
Hexadecimal code 1D 56 m
Decimal code 29 86 m
②ASCII code GS V m n
Hexadecimal code 1D 56 m n
Decimal code 29 86 m n
[Range] ①m = 0, 48, 1, 49
②m = 66, 0 ≤n ≤255
[Description] Select the paper cutting mode and cut the paper.
Select the paper cutting mode based on the value of m as follows:

Printer THERMAL RECEIPT PRINTER 32


M Paper cutting mode
0, 48 Full cut
1, 49 Partial cut
66 Feed ( [n×(longitudinal movement units) inches] ) and partial cut of the paper
[Notes ① and ②]
• This command is valid only at the beginning of the line.
[Note ①]
• M=0, 48, 1, 49, the printer cuts paper directly.
• When n=66, the printer feeds the paper [the distance from the printing position to the cutter+n×
(longitudinal movement units) ] and then cuts the paper.
• The lateral and longitudinal movement units are set by the GS P command.
• The amount of paper feed is calculated in longitudinal movement units.
54. GS W nL nH set printing area width
[Format] ASCII code GS W nL nH
Hexadecimal code 1D 57 nL nH
Decimal code 29 87 nL nH
[Range] 0 ≤ nL ≤ 255
0 ≤ nH ≤ 255
[Description] Set the print area width by using nL and nH.
• Set the width of the printing area to [(nL+nH×256)×lateral movement units] inches.

[Note] • In the standard mode, this command is only valid at the beginning of the line.
• This command is not valid in the page mode. Command data will be treated as normal
characters.
• This command does not affect the printing in the page mode.
• If [Left Margin+Print Area Width] exceeds the printable area, the print area width will be the
printable area width minus the left margin.
• The units of lateral and longitudinal movement are set by the GS P command. Changing the
lateral and longitudinal units of movement does not affect the current left margin and area width.
• The width of the plot area is calculated in units of lateral movement.
[Default] nL = 76, nH = 2
[Reference] GS L, GS P
55. Set the longitudinal relative position in the GS\nL nH page mode
[Format] ASCII code GS \ nL nH
Hexadecimal code 1D 5C nL nH
Decimal code 29 92 nL nH
[Range] 0 ≤ nL ≤ 255
0 ≤ nH ≤ 255

Printer THERMAL RECEIPT PRINTER 33


In the page mode, the longitudinal movement distance is set with the current point as the
[Description] reference point.
• This command sets the longitudinal movement distance which is relative to the current point to
[(nL+nH×256)×units of longitudinal or lateral movement] inches.
[Note] • This command is valid only in the page mode and is ignored in other modes.
• When the printing position moves down: nL+nH×256=N
• When the print position moves up, use the complement to calculate: NL+nH×256=65536-N
• Any settings beyond the printing area are ignored.
• This command determines the use of units of movement in accordance with the direction of the
print area set by ESC T:
① When the printing start position is set to the upper left corner (from left to right in the print
direction) or the lower right corner (from right to left in the print direction), use the longitudinal
movement units.
② When the printing start position is set to the upper right corner (from top to bottom in the print
direction) or the lower left corner (from bottom to top in the printing direction), use the lateral
movement units.
• The units of lateral and longitudinal movement are set by the GS P command.
• The GS P command can change the units of lateral and longitudinal movement.
[Reference] ESC $, ESC T, ESC W, ESC \, GS $, GS P
56. GS ^ r t m Execute macro commands
[Format] ASCII code GS ^ r t m
Hexadecimal code 1D 5E r t m
Decimal code 29 94 r t m
[Range] 0 ≤ r ≤ 255
0 ≤ t ≤ 255
m = 0, 1
[Description] Execute macro commands.
• r Specifies the number of times which the macro is executed.
• t Specifies the waiting time for the macro to execute.
• m specifies the mode in which the macro is executed.
When the least significant bit of m is 0:
The macro is executed r times which is consecutively with an interval of t×100 ms.
When the least significant bit of m is 1:
After the printer waits t×100 ms, the indicator flashes until the user presses the paper feed key
before the printer executes the macro. This is repeated r times.
[Note] • The waiting time for each macro execution will be t×100 ms.
• If this command is received during the macro definition, the macro definition stops and the
macro which is being defined is cleared.
• If that macro is not defined or r is 0, the command is invalid.
• When the macro is running (m=1), the paper cannot be fed with the paper feed key.
[Reference] GS :
57. GS a n Turns on/off the automatic status returning function (ASB)
[Format] ASCII code GS a n
Hexadecimal code 1D 61 n

Printer THERMAL RECEIPT PRINTER 34


Decimal code 29 97 n
[Range] 0 ≤ n ≤ 255
[Description] Turn on/off the automatic status returning function (ASB), use n to display the following status
bar:
Bit Turn off/on Hexadecimal Decimal ASB Status
0 Turn off 00 0 Drawer is opened, and the connector Pin3 status
function is closed.
Turn on 01 1 When the crawler is opened, the status function of
connector Pin3 will be opened.
1 Turn off 00 0 Turn off online or offline state
Turn on 02 2 Turn on online or offline state
2 Turn off 00 0 Turn off the error state
Turn on 04 4 Turn on the error state
3 Turn off 00 0 Turn off the paper sensor state
Turn on 08 8 Paper sensor state printing
4-7 - - - Not defined
First byte (printer information):
Bit Turn off/on Hexadecimal Decimal ASB Status
0, 1 Turn off 00 0 There is no definition. Fixed to 0.
2 Turn on 04 4 There is no definition. Fixed to 1.
3 Turn off 00 0 There is no definition. Fixed to 0.
4 Turn on 10 16 There is no definition. Fixed to 1.
5 Turn off 00 0 There is no definition. Fixed to 0.
6 Turn off 00 0 The paper is not fed through pressing the paper feed
key.
Turn on 40 64 The paper is being fed through pressing the paper feed
key.
7 Turn off 00 0 There is no definition. Fixed to 0.

Second byte (printer information):


Bit Turn off/on Hexadecimal Decimal ASB Status
0-4 Turn off 00 0 There is no definition. Fixed to 0.
5 Turn off 00 0 No unrecoverable errors occurred.
Turn on 20 32 An unrecoverable error occurred.
6 Turn off 00 0 No auto-recoverable errors occurred.
Turn on 40 64 An auto-recoverable error occurred.
7 Turn off 00 0 There is no definition. Fixed to 0.
Third byte (paper sensor information):
Bit Turn off/on Hexadecimal Decimal ASB Status
0, 1 Turn off 00 0 There is no definition. Fixed to 0.
2, 3 Turn off 00 0 The printer has paper
Turn on 0C 12 Printer is running out of paper.
4-7 Turn off 00 0 There is no definition. Fixed to 0.

Printer THERMAL RECEIPT PRINTER 35


Fourth byte (paper sensor information):
Bit Turn off/on Hexadecimal Decimal ASB Status
0, 3 - - - There is no definition.
4-7 Turn off 00 0 There is no definition. Fixed to 0.
58. GS f n Select the HRI to use typeface
[Format] ASCII code GS f n
Hexadecimal code 1D 66 n
Decimal code 29 102 n
[Range] n = 0, 1, 48, 49
[Description] When printing bar-code, select a typeface for the HRI character and use n to select the typeface as
follows:

n Typefaces
0, 48 Standard ASCII characters (12×24)
1, 49 Compressed ASCII characters (9×17)

[Note] • The HRI characters are characters that comment on the contents of the bar-code.
• The printing position of the HRI character is designated by the GS H command.
[Default] n=0
[Reference] GS H, GS k
59. GS h n Select the bar code height
[Format] ASCII code GS h n
Hexadecimal code 1D 68 n
Decimal code 29 104 n
[Range] 1 ≤ n ≤ 255
[Description] Select the bar code height.
Bar code height is n points..

Printer THERMAL RECEIPT PRINTER 36


[Default] n = 162
[Reference] GS k
60. ① GS k m d1.. . dk NUL ② GS k m n d1... dn Print bar-code
[Format] ①ASCII code GS k m d1...dk NUL
Hexadecimal code 1D 6B m d1...dk 00
Decimal code 29 107 m d1...dk 0
②ASCII code GS k m n d1... dn
Hexadecimal code 1D 6B m n d1... dn
Decimal code 29 107 m n d1... dn
[Range] ① 0 ≤ m ≤ 6(the value range of k and d is determined by the bar-code type)
② 65 ≤ m ≤ 73(the value range of k and d is determined by the bar-code type)
[Description] Select a bar-code type and print the bar-code.
m is used to select the bar-code type as follows:

m Bar code types Number of characters Character Notes


0 UPC-A 11 ≤ k ≤ 12 0~9 48 ≤ d ≤ 57
1 UPC-E 11 ≤ k ≤ 12 0~9 48 ≤ d ≤ 57
2 JAN13 12 ≤ k ≤ 13 0~9 48 ≤ d ≤ 57
(EAN13)
3 JAN8 (EAN8) 7≤k≤8 0~9 48 ≤ d ≤ 57
0~9, 45 ≤ d ≤ 57,
① A~Z, 65 ≤ d ≤ 90,
4 CODE39 1 ≤ k ≤ 255 SP, $, %, +, d = 32, 36, 37, 43,
-, ., / 45, 46, 47
*(Start/end character) d = 42 (Start/end character)
5 ITF 1 ≤ k ≤ 255(even number) 0~9 48 ≤ d ≤ 57
0~9, 48 ≤ d ≤ 57,
6 CODABAR 1 ≤ k ≤ 255 A~D 65 ≤ d ≤ 68,
$, +, -, ., d = 36, 43, 45, 46,
/, : 47, 58
65 UPC-A 11 ≤ n ≤ 12 0~9 48 ≤ d ≤ 57
66 UPC-E 11 ≤ n ≤ 12 0~9 48 ≤ d ≤ 57
67 JAN13 12 ≤ n ≤ 13 0~9 48 ≤ d ≤ 57
(EAN13)
68 JAN8 (EAN8) 7≤n≤8 0~9 48 ≤ d ≤ 57
② 0~9, 45 ≤ d ≤ 57,
A~Z, 65 ≤ d ≤ 90,
69 CODE39 1 ≤ n ≤ 255 SP, $, %, +, -, d = 32, 36, 37, 43, 45,
., / 46, 47
*(Start/end character) d = 42 (Start/end character)
70 ITF 1 ≤ n ≤ 255(even number) 0~9 48 ≤ d ≤ 57

Printer THERMAL RECEIPT PRINTER 37


71 CODABAR 1 ≤ n ≤ 255 0~9, 48 ≤ d ≤ 57,
A~D 65 ≤ d ≤ 68,
$, +, -, ., d = 36, 43, 45, 46,
/, : 47, 58
72 CODE93 1 ≤ n ≤ 255 NUL~SP(7FH) 0 ≤ d ≤ 127
73 CODE128 2 ≤ n ≤ 255 NUL~SP(7FH) 0 ≤ d ≤ 127
[Note①]
• The command ends with NUL in this format.
• When UPC-A or UPC-E is selected, the remaining characters are treated as normal characters after the printer
receives 12-byte bar-code data.
• When the JAN13(EAN13) type is selected, the remaining characters are treated as normal characters after the
printer receives 13-byte bar-code data.
• When the JAN8 (EAN8) type is selected, the remaining characters are treated as normal characters after the
printer receives 8-byte bar-code data.
• The number of ITF code data must be the even number. If you enter an odd number of bar-code data, the last
data is ignored.
[Note②]
• n is used to indicate the number of bar code data, and the printer processes the next n bytes of data as bar-code
data.
• If n is outside the specified range, the printer does not process this command, and the subsequent data is
processed as normal data.
[Note (the standard mode)]
• If the bar-code data d is out of the specified range, the command is invalid.
• If the bar-code laterally exceeds the printing area, it is invalid.
• This command, regardless of the line height set by the ESC 2 or ESC 3 commands, is the same as the-bar code
height set.
• This command is valid only if there is no data in the printing buffer. If there is data in the print buffer, the
command is ignored.
• After printing the bar-code, set the printing position at the beginning of the line.
• Print mode settings (such as the bold, double print, underline, character size, reverse, and characters rotated
90°clockwise) do not affect this command, but inverted mode has an effect on bar-code printing.
[Notes (The page mode)]
• This command will only generate bar-code graphics to the print buffer, but does not print. Move the print
position to the right of the bar-code after processing the bar-code data.
• If d is beyond the specified range, the command is ignored.
• If the bar-code width exceeds the print area, the command is ignored.
When CODE128(m=73) is selected:
• Refer to Appendix A, CODE 128 for the relevant information and character set.
• When using CODE 128, code according to the following regulations:
① The character set (one of CODE A, CODE B, and CODE C) must be selected before bar-code data.
② Selecting the character set is done by sending the character "{" which is in combination with another character;
the ASCII character "{" is done by sending the character "{" twice in succession.
Special character Send data
ASCII code Hexadecimal code Decimal code

Printer THERMAL RECEIPT PRINTER 38


SHIFT {S 7B, 53 123, 83
CODE A {A 7B, 41 123, 65

CODE B {B 7B, 42 123, 66


CODE C {C 7B, 43 123, 67
FNC1 {1 7B, 31 123, 49
FNC2 {2 7B, 32 123, 50
FNC3 {3 7B, 33 123, 51
FNC4 {4 7B, 34 123, 52
"{" {{ 7B, 7B 123, 123
[Instance] For example, print "No. 123456"
In this example, the printer will firstly print the "No." with CODE B and then the remaining numbers with CODE
C:

• If the character set is not selected at the top of the bar-code data, the printer stops the processing of this
command and treats the remaining data as normal data.
• If "{" and the character immediately following it are not the combination which is designated above, the printer
stops the processing of this command and processes the remaining data as normal data.
• If the characters which is received by the printer are not bar-code character set data, the printer stops the
processing of this command and processes the remaining data as normal data.
• When the printer prints the HRI characters, the shift characters and the character set selection data are not
printed.
• The HRI characters of function characters are not printed.
• The HRI characters of the control characters (<00>H to <1F>H and <7F>H) are not printed;
<Other> Be sure to ensure the bar code left and right clearance. The gap varies based on the bar-code type.
[Reference] GS H, GS f, GS h, GS w
61. GS r n Return state
[Format] ASCII code GS r n
Hexadecimal code 1D 72 n
Decimal code 29 114 n
[Range] n = 1, 2, 49, 50
[Description] Returns the state which is specified by the value of n:

n Function
1, 49 Return paper sensor state
2, 50 Return to Cash Drawer state

[Note] • This command is only valid for the serial printers.

Printer THERMAL RECEIPT PRINTER 39


• The command is not executed until the data before the command has been processed in the receive
buffer, so there is a time lag between sending the command and also receiving the return state.
• The return state byte bits correspond as follows:
the paper sensor state (n=1, 49):

Bit 0/1 Hexadecimal code Decimal code Status


0, 1 0 00 0 Paper exhaustion sensor, papers are there
1 03 3 Paper exhaustion sensor, papers run out
2, 3 0 00 0 Paper out sensor, papers are there
1 0c 12 Paper out sensor, papers run out
4 0 00 0 No, fixed to 0
5, 6 --- --- Undefined
7 0 00 0 No, fixed to 0
Cash Drawer state (n=2, 50):
Bit 0/1 Hexadecimal code Decimal code Status
0 0 00 0 There is the Cash Drawer to be open
1 01 1 Thre is no Cash Drawer to be open
1-3 --- --- Undefined
4 0 00 0 No, fixed to 0
5, 6 --- --- Undefined
7 0 00 0 No, fixed to 0
[Reference] DLE EOT, GS a
62. GS v 0 m xL xH yL yH d1...dk Print raster bitmap
[Format] ASCII code GS v 0 m xL xH yL yH d1...dk
Hexadecimal code 1D 76 30 m xL xH yL yH d1...dk
Decimal code 29 118 48 m xL xH yL yH d1...dk
[Range] 0 ≤ m ≤ 3, 48 ≤ m ≤ 51
0 ≤ xL ≤ 255
0 ≤ xH ≤ 255
0 ≤ yL ≤ 255
0 ≤ d ≤ 255
k = ( xL + xH × 256) × ( yL + yH × 256) ( k ≠ 0)
[Description] Print raster bitmap with raster bitmap mode selected by m value:

m Mode Longitudinal resolution Lateral resolution


(DPI) (DPI)
0, 48 Normal 200 200
1, 49 Double width 200 100
2, 50 Double height 100 200
3, 51 Double width and double height 100 100

Printer THERMAL RECEIPT PRINTER 40


• xL, xH are the number of bytes of horizontal bitmap (xL+xH×256)
• yL, yH are the number of bitmap points in the vertical direction (yL+yH×256)
[Note] • In the standard mode, this command is valid only if there is no data in the printer buffer.
• Print modes such as character enlargement, bold, double Print, inverted print, underline, black and
white are not valid for this command.
• Portions of the bitmap that are beyond the printing area are not printed.
• ESC a (select alignment mode) is valid for the raster bitmaps.
• During macro definition, the command stops the macro definition and then executes the command.
This command is not part of the macro definition.
• d represents bitmap data. The corresponding bit of each byte is 1 to print the point and 0 to not print
the point.
[Instances] When xL+ xH × 256 = 64

63. GSwn Set the bar-code width


[Format] ASCII code GS w n
Hexadecimal code 1D 77 n
Decimal code 29 119 n
[Range] 2≤n≤6
[Description] Set bar-code lateral module width
The lateral module width of the bar-code is specified by n:

n Single base module width (mm) Dual base module width


Narrow base module (mm) Wide basic module (mm)
2 0.25 0.25 0.625
3 0.375 0.375 1.0
4 0.5 0.5 1.25
5 0.625 0.625 1.625
6 0.75 0.75 1.875
• The bar-code of single basic module is as follows:
UPC-A, UPC-E, JAN13 (EAN13), JAN8 (EAN8), CODE93, CODE128
• Double basic module bar codes are as follows:
CODE39, ITF, CODABAR
[Default] n=3
[Reference] GS k

Printer THERMAL RECEIPT PRINTER 41


Chinese character control command
64. FS! N Set the Chinese character mode
[Format] ASCII code FS ! n
Hexadecimal code 1C 21 n
Decimal code 28 33 n
[Range] 0 ≤n ≤ 255
[Description] The Print mode of Chinese characters is set with the value of n as follows:

Bit 0/1 Hexadecimal code Decimal code Function


0, 1 --- --- Undefined
2 0 00 0 Cancel double width
1 04 4 Select double width
3 0 00 0 Cancel double height
1 08 8 Select double height
4-6 -- -- Undefined
0 00 0 Cancel underline
7
1 80 128 Select underline

[Note] • When the double width and double height modes are set at the same time, the characters are enlarged
twice in both lateral and longitudinal directions (including the left-right spacing).
• The printer can underline all characters, including left-right spacing. However, spaces caused by HT
commands (lateral ticks) cannot be underlined, nor characters rotated 90 degrees clockwise can be
underlined.
• The underline line width is set by the FS-regardless of the character size.
• When characters in a row differ in height, all characters in the row will be underlined.
• FS W or GS! can be used. Bold the characters, the last command is valid.
• You can also use FS-select or cancel the underline mode and the last command is valid.
[Default] n = 0
[Reference] FS - , FS W, GS !

65. FS& Select the Chinese character mode


[Format] ASCII code FS &
Hexadecimal code 1C 26
Decimal code 28 38
[Description] Select the Chinese character mode
[Note] • When the Chinese character mode is selected, the printer judges whether the character is the Chinese
character internal code, if the character is the Chinese character internal code, first processing the first
byte, and then judging whether the second byte is the Chinese character internal code.
• After the printer is electrified, the Chinese character mode is automatically selected;
[Reference] FS.

66. FS-n Select/cancel Chinese underline mode


[Format] ASCII code FS - n
Hexadecimal code 1C 2D n

Printer THERMAL RECEIPT PRINTER 42


Decimal code 28 45 n
[Range] 0 ≤ n ≤ 2, 48 ≤ n ≤ 50
[Description] According to the value of n, select/cancel underline of the Chinese characters
n Function
0, 48 Remove Chinese characters from underlining
1, 49 Select Chinese character underline (1 point width)
2, 50 Select Chinese character underline (2 points width)
[Note] • The printer can underline all characters, including the left-right spacing. However, spaces caused by
HT commands (lateral ticks) cannot be underlined, nor characters rotated 90 degrees clockwise.
• After canceling the underlining mode, underline printing is no longer performed, but the originally
set underline line weight does not change. The default underline line weight is 1 point.
• Even if the character size is changed, the set underline line weight does not change.
• With FS! You can also select or cancel the underlined mode and the last command is active.
[Default] n=0
[Reference] FS !

67. FS. Cancel the Chinese character mode


[Format] ASCII code FS .
Hexadecimal code 1C 2E
Decimal code 28 46
[Description] Cancel the Chinese character mode
[Note] • When the Chinese character mode is canceled, all characters are treated as ASCII characters, one
byte at a time.
• The Chinese character mode is automatically selected on power-up.
[Reference] FS &

68. FS 2 c1 c2 d1... dk Define the user-defined Chinese characters


[Format] ASCII code FS 2 c1 c2 d1...dk
Hexadecimal code 1C 32 c1 c2 d1...dk
Decimal code 28 50 c1 c2 d1...dk
[Range] c1 and c2 represent the character codes which define the characters
c1 = FEH
A1H ≤ c2 ≤FEH
0 ≤ d ≤ 255
k = 72
[Description] Define Chinese characters designated by c1 and c2
[Note] • c1 and c2 represent user-defined Chinese character codes, c1 designates the first byte, and c2
designates the second byte.
[Default] • d stands for data. 1 represents to print a point, 0 means not to print
The relationship between user-defined Chinese font and data is shown in the following figures:

Printer THERMAL RECEIPT PRINTER 43


69. FS S n1 n2 sets the left and right spacing of Chinese characters
[Format] ASCII code FS S n1 n2
Hexadecimal code 1C 53 n1 n2
Decimal code 28 83 n1 n2
[Range] 0 ≤ n1 ≤ 255
0 ≤ n2 ≤ 255
[Description] The left and right spacing of the Chinese characters are set to n1 and n2 respectively.
• When the printer supports the GS P command, the left spacing is [n1×lateral or longitudinal
movement units] inches, and the right spacing is [n2×lateral or longitudinal movement units]
inches.
[Note] • When the double width mode is set, the spacing between the left and right is doubled.
• The movement unit is set by the GS P command. Even if the units of lateral and longitudinal
movement are changed by GS P, the originally set character pitch does not change.
• In the standard mode, move units laterally.
• In the page mode, choose whether to move units laterally or longitudinally, based on the start
position of the print area:
① When the start position is in the upper left corner or lower right corner of the printing area,
move the unit laterally.
② When the start position is in the upper right corner or lower left corner of the printing area,
move the unit laterally.
③ The maximum right spacing of Chinese characters is about 36mm. If it exceeds this value, the

Printer THERMAL RECEIPT PRINTER 44


maximum value will be taken.
[Default] n1 = 0, n2 = 0
[Reference] GS P
70. FS W n Select/cancel double height and multiple width of Chinese characters
[Format] ASCII code FS W n
Hexadecimal code 1C 57 n
Decimal code 28 87 n
[Range] 0 ≤ n ≤ 255
[Description] Select or cancel the double height and double width mode of Chinese characters.
• When the lowest bit of n is 0, the double height and the double width mode of the Chinese
character is canceled.
• When the lowest bit of n is 1, the Chinese character double height and double width mode is
selected.
[Note] • Only the least significant bit of n is valid.
• In the double-height and double-width mode mode, the size of Chinese characters is printed in
the same way as when the double-width and double-height modes are selected.
• After the double height and double width mode of Chinese characters is canceled, the Chinese
characters printed out later are of the normal size.
• When characters in a line are different in height, all characters in the line are underlined.
• You can also use FS! Or GS! Command (select double height and double width mode) to select
or cancel the double height and the double width mode of Chinese characters. The last received
command is valid.
[Default] n = 0 [Reference]
FS!, GS !
71. FS W n Select/cancel double height and multiple width of Chinese characters
[Format] ASCII code FS W n
Hexadecimal code 1C 57 n
Decimal code 28 87 n
[Range] 0 ≤ n ≤ 255
[Description] Select or cancel the double height and double width mode of Chinese characters.
• When the lowest bit of n is 0, the double height and the double width mode of the Chinese
character is canceled.
• When the lowest bit of n is 1, the Chinese character double height and double width mode is
selected.
Printer prompt function commands
72 ESC B n t The prompt of the printer printing single beep (applicable to POS-80XX series)
[Format] ASCII code ESC B n t
Hexadecimal code 1B 42 n t
Decimal code 27 66 n t
[Range] 1<=n<=9, 1<=t<=9
[Description] The printer prints a beep.
• n is the number of buzzer sounds.
• t is the buzzer sounding time (t×50) milliseconds
73. Single printing beep prompt and flashing warning light of ESC C m t n printer (applicable to POS-80XX

Printer THERMAL RECEIPT PRINTER 45


series)
[Format] ASCII code ESC C m t n
Hexadecimal code 1B 43 m t n
Decimal code 27 67 m t n
[Range] 1<=m<=20, 1<=t<=20, 0<=n<=3,
The printer will print the beep and the warning light will flash.
[Description] • m: 1<=m<=20, it refers to the times of flashing of alarm lamp or buzzer.
• t: 1<=t<=20, it refers to the interval time between flashing of alarm lamp and buzzer is t*50 ms
or (t×50) ms.
• When n=0, the buzzer does not sound and the alarm lamp does not flash;
When n=1, the buzzer sounds;
When n=2, the alarm lamp flashes;
When n=3, the buzzer sounds and the alarm lamp flashes at the same time;
74. ESC I Full-cut paper
[Format] ASCII code ESC i
Hexadecimal code 1B 69
Decimal code 27 105
[Description] Full paper cutting of the printer
[Note] • The paper cutting mode is limited by the structure of the cutter, and the specific paper
cutting mode is required in accordance with the structure.
• GS V instruction paper cutting is recommended.
75. ESC m partial cut paper
[Format] ASCII code ESC i
Hexadecimal code 1B 6D
Decimal code 27 105
[Description] Partial cut after the printer is complete
[Note] • The paper cutting mode is limited by the structure of the cutter, and the specific paper cutting
mode is required in accordance with the structure.
• GS V instruction paper cutting is recommended.
76. ESC u Inquire Cash Drawer signal
[Format] ASCII code ESC u n
Hexadecimal code 1B 75 n
Decimal code 27 117 n
[Range] n=0, 48
[Description] Transfer Cash Drawer state in one byte of data
Return value (transfer value in hexadecimal as an example) Cash Drawer state
00 The Cash Drawer is open
01 The Cash Drawer is closed
77. ESC v Inquire the printer state information
[Format] ASCII code ESC v
Hexadecimal code 1B 76
Decimal code 27 118
[Description] Inquire the printer state information
[Note] • The inquiry of printer status information is indicated under the port of the network port 4000,

Printer THERMAL RECEIPT PRINTER 46


and the inquiry of the printer paper shortage state will be indicated under the port of the network
port 9100 and other interfaces.
The printer status information of 4 bytes is returned under the port of the network port 4000, and
the information of 1 byte is returned under the port of the network port 9100 and other interfaces
to indicate the paper shortage state of the printer.
Corresponding table of USB return value of network port 9100 and serial port:
Port 4000 ends:
Return value (transfer value in hexadecimal as an example) Printer out of paper state
00 Printer is not running out of paper
0C Printer is running out of paper
1st byte:
Bit Binary system Status Hexadecimal Decimal
0 0 Fixed 00 0
1 0 Fixed 00 0
2 0 The Cash Drawer signal is low 00 0
1 The Cash Drawer signal is high 04 4
3 0 Printer online 00 0
1 Printer offline 08 8
4 1 Fixed 00 0
5 0 Reversing cover is closed 00 0
1 Reversing cover is open 20 32
6 0 The paper is not fed through the 00 0
paper feed key
1 Feed the paper through the paper 40 64
feed key
7 0 Fixed 00 0
2nd byte:
Bit Binary system Status Hexadecimal Decimal
0 0 Fixed 00 0
1 0 Fixed 00 0
2 0 Fixed 00 0
3 0 Cutter is normal 00 0
1 Cutter occurs error 08 8
4 0 Fixed 00 0
5 0 Non-recoverable error does not 00 0
occurred
1 Non-recoverable error occurred 20 32
6 0 Recoverable error does not occurred 00 0
1 Recoverable error occurred 40 64
7 0 Fixed 00 0
3rd byte:
Bit Binary system Status Hexadecimal Decimal
0, 1 00 Paper exhaustion sensor: there are 00 0

Printer THERMAL RECEIPT PRINTER 47


still papers
11 Paper exhaustion sensor: papers run 03 3
out
2, 3 00 Paper out sensor: there are still papers 00 0
11 Paper out sensor: papers run out 0C 12
4 0 Fixed 00 0
5, 6 - Reserved - -
7 0 Fixed 00 0
4th byte:
Bit Binary system Status Hexadecimal Decimal
0 0 Fixed 00 0
1 0 Fixed 00 0
2 0 Fixed 00 0
3 0 Fixed 00 0
4 0 Fixed 00 0
5, 6 - Reserved - -
7 0 Fixed 00 0
Note: There is no paper exhaustion sensor, so the 3rd byte returns only the paper out sensor information.
Attached 4000 port return value verification table:
Instruction Testing conditions Return value (HEX)
Normal 14 00 00 00
Uncover 3C 00 00 00
Paper feed 5C 00 00 00
1B 76 Out of paper 1C 00 0C 00
Open a Cash Drawer 10 00 00 00
Over temperature 1C 40 00 00
Cutter occurs error 14 28 00 00

78. GS r transmission states


[Format] ASCII code GS r n
Hexadecimal code 1D 72 n
Decimal code 29 114 n
[Range] n = 1, 2, 49, 50
[Description] Returns the state which is specified by the value of n:
n Function
1, 49 Return paper sensor state
2, 50 Return to Cash Drawer state
[Note] • This command is not valid for the parallel port printers only.
• The command is not executed until the data before the command has been processed in the
receive buffer, so there is a time lag between sending the command and also receiving the return
state.
• The correspondence of each bit of the return status byte is as follows:
Paper sensor states (n=1, 49):

Printer THERMAL RECEIPT PRINTER 48


Bit 0/1 Hexadecimal code Decimal code Status
0, 1 0 00 0 Paper exhaustion sensor, papers are
there
1 03 3 Paper exhaustion sensor, papers run
out
2, 3 0 00 0 Paper out sensor, papers are there
1 0C 12 Paper out sensor, papers run out
4 0 00 0 No, fixed to 0
5, 6 --- --- Undefined
7 0 00 0 No, fixed to 0
Note: Bits 2 and 3: When the paper out sensor detects the print paper out, the printer goes offline and the
command does not execute. Bits 2 and 3 do not convey an out-of-paper condition.
Cash Drawer state (n=2, 50):
Bit 0/1 Hexadecimal code Decimal code Status
0 0 00 0 There is the Cash Drawer to be open
1 01 1 Thre is no Cash Drawer to be open
1-3 --- --- Undefined
4 0 00 0 No, fixed to 0
5, 6 --- --- Undefined
7 0 00 0 No, fixed to 0
The return value verification table is attached:
Instruction n value Testing conditions Return value (HEX)
Normal 00
1, 49
Out of paper No returning value
GS r
There is the Cash Drawer to be open 00
2, 50
Thre is no Cash Drawer to be open 01
79. GS (k <Function 065> PDF417: Set the number of columns in the data area
[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 30 41 n
Decimal code 29 40 107 3 0 48 65 n
[Description] Set the number of columns in the PDF417 data area
When n=0, specify the automatic processing
When n!=0, set the data area to n columns
[Range] (pL+pH×256)=3
cn=48
fn=65
n=0-30
[Default] n=0
[Note] The specific value of n should be set according to the paper width.
80. GS (k <Function 066> PDF417: set the number of lines
[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 30 42 n
Decimal code 29 40 107 3 0 48 66 n

Printer THERMAL RECEIPT PRINTER 49


[Description] Set the number of lines in PDF417
When n=0, specify the automatic processing
When n!=0, set the number of rows to n
[Range] (pL+pH×256)=3
cn=48
fn=66
n=0, 3-90
[Default] n=0
[Note] The specific value of n should be set according to the paper width.
81. GS (k <Function 067> PDF417: Set the width of the module
[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 30 43 n
Decimal code 29 40 107 3 0 48 67 n
[Description] Set the module width of PDF417 in point unit
[Range] (pL+pH×256)=3
cn=48
fn=67
n=2-8
[Default] n=3
[Note] The specific value of n should be set according to the paper width.
82. GS (k <Function 068> PDF417: Set the height of the module
[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 30 44 n
Decimal code 29 40 107 3 0 48 68 n
[Description] Set module height of PDF417=module width×n
[Range] (pL+pH×256)=3
cn=48
fn=68
n=2-8
[Default] n=3
[Note] The specific value of n should be set according to the paper width.
83. GS (k <Function 069> PDF417: Set error correction level
[Format] ASCII code GS ( k pL pH cn fn m n
Hexadecimal code 1D 28 6B 04 00 30 45 m n
Decimal code 29 40 107 4 0 48 69 m n
[Description] Setting the error correction level of PDF417
m Function
48 Error correction level is set by level
49 The error correction level is set by the ratio. Ratio=n×10%

[Range] (pL+pH×256)=4
cn=48
fn=69
m=48, n=48-56

Printer THERMAL RECEIPT PRINTER 50


m=49, n=1-40
[Default] m=49, n=1

84. GS (k <Function 070> PDF417: Select options


[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 30 46 n
Decimal code 29 40 107 3 0 48 70 n
[Description] Select options for PDF417

m Function
0 Select standard PDF417
1 Select truncate PDF417

[Range] (pL+pH×256)=3
cn=48
fn=70
m=0, 1
[Default] m=0
85. GS (k <Function 080> PDF417: Storing data in the storage area
[Format] ASCII code GS ( k pL pH cn fn m d1…dk
Hexadecimal code 1D 28 6B pL pH 30 50 30 d1…dk
Decimal code 29 40 107 pL pH 48 80 48 d1…dk
[Description] Store PDF417 data in the storage area (d1.. . dk)
[Range] (pL+pH×256)=4-65535
cn=48
fn=80
m=48
d=0-255
k=(pL+pH×256)-3
87. GS (k <Function 081> PDF417: Print data in the storage area
[Format] ASCII code GS ( k pL pH cn fn m
Hexadecimal code 1D 28 6B 03 00 30 51 30
Decimal code 29 40 107 3 0 48 81 48
[Description] Print data in the storage area
[Range] (pL+pH×256)=3
cn=48
fn=81
m=48
88. GS (k <Function 167> QR Code: set the module size
[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 31 43 n
Decimal code 29 40 107 3 0 49 67 n
[Description] Set the dimensions of QR Code (in point)
[Range] (pL+pH×256)=3

Printer THERMAL RECEIPT PRINTER 51


cn=49
fn=67
n: 1-16
[Default] n=3
89. GS (k <Function 169> QR Code: Set error correction level
[Format] ASCII code GS ( k pL pH cn fn n
Hexadecimal code 1D 28 6B 03 00 31 45 n
Decimal code 29 40 107 3 0 49 69 n
[Description] Setting the error correction level of QR Code

n Function Error correction capability%


48 Select error correction level L 7
49 Select error correction level M 15
50 Select error correction level Q 25
51 Select error correction level H 30

[Range] (pL+pH×256)=3
cn=49
fn=69
n=48-51
[Default] n=48
90. GS (k <Function 180> QR Code: store data in the storage area
[Format] ASCII code GS ( k pL pH cn fn m d1…dk
Hexadecimal code 1D 28 6B pL pH 31 50 30 d1…dk
Decimal code 29 40 107 pL pH 49 80 48 d1…dk
[Description] Storing QR code data in the data storage area
[Range] cn=49
fn=80
m=48
d=0-255
k=(pL+pH×256)-3

Data type Specify characters


Digital mode data “0“-”9“

Alphabetic pattern data “0“-”9 “, ”A“-”Z“, SP, $, %, *, +, -, ., /

KANJI Mode data Japanese

8-bit byte mode data 00h-FFh

91. GS ( k <Function 181> QR Code: Print data in the storage area


[Format] ASCII code GS ( k pL pH cn fn m
Hexadecimal code 1D 28 6B 03 00 31 51 m
Decimal code 29 40 107 3 0 49 81 m
[Description] Encode and print QR code data

Printer THERMAL RECEIPT PRINTER 52


[Range] (pL+pH×256)=3
cn=49
fn=81
m=48
92. GS (k <Function 167> QR Code: set the module size
[Format] ASCII code GS ( k m fn n
Hexadecimal code 1D 28 6B m fn n
Decimal code 29 40 107 m fn n
[Description] Set the dimensions of QR Code (in point)
[Range] m=0x30
fn=0x67
n: 1-16
[Default] n=3
93. GS (k <Function 169> QR Code: Set error correction level
[Format] ASCII code GS ( k m fn n
Hexadecimal code 1D 28 6B m fn n
Decimal code 29 40 107 m fn n
[Description] Setting the error correction level of QR Code
n Function Error correction capability%
48 Select error correction level L 7
49 Select error correction level M 15
50 Select error correction level Q 25
51 Select error correction level H 30
[Range] m=0x30
fn=0x69
n: 48-51
[Default] n=48
94. GS (k <Function 180> QR Code: store data in the storage area
[Format] ASCII code GS ( k m fn dL dH d1…dk
Hexadecimal code 1D 28 6B m fn dL dH d1…dk
Decimal code 29 40 107 m fn dL dH d1…dk
[Description] Storing QR code data in the data storage area
[Range] fn=0x80
m=0x30
d=0-255
k=dL+dH×256

Printer THERMAL RECEIPT PRINTER 53


Data type Specify characters
Digital mode data “0“-”9“
Alphabetic pattern data “0“-”9“, ”A“-”Z“, SP, $, %, *, +, -, ., /
KANJI Mode data Japanese
8-bit byte mode data 00h-FFh

95. GS ( k <Function 181> QR Code: Print data in the storage area


[Format] ASCII code GS ( k m fn
Hexadecimal code 1D 28 6B m fn
Decimal code 29 40 107 m fn
[Description] Encode and print QR code data
[Range] fn=0x81
m=0x30
96. FS C Enable/prohibit Japanese system
[Format] ASCII code FS C n
Hexadecimal code 1C 43 n
Decimal code 28 67 n
[Range] N=0, 48: Prohibit the Japanese system
N=1, 49: Enable Japanese system
[Description] Set Chinese character language as Japanese
[Note] The prerequisite for enabling Japanese is to set the Chinese language as Japanese.
97. GS FF will feed the black label printing paper to the printing start position
[Format] ASCII code GS FF
Hexadecimal code 1D 0C
Decimal code 29 12
[Description] Feed the marked print paper to the printing start position.
[Note] • This command is only activated when the black mark function is turned on.
• This command sets the next printing position at the beginning of a line.
• Even if the command is executed at the print start position of the marked printing paper, the
printer does not feed the print to the next print start position.
• This command is required when using the black mark function
98. GS (F set the black mark adjustment value
[Format] ASCII code GS ( F pL pH a m nL nH
Hexadecimal code 1D 28 46 pL pH a m nL nH
Decimal code 29 40 70 pL pH a m nL nH
[Range] (pL+(pH×256))=4 i. e. pL=4, pH=0
1≤a≤2
M=0, 48 or 1, 49
0 ≤ ( nL + nH × 256) ≤ 1700
0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255)
[Description] This command is valid only when BM sensors are enabled.
• Set the printer operation adjustment value which is designated by parameter a.
• pL and pH specify parameters, for example, the number of a is (p L+(p H×256)) bytes.
• a Used to specify the settings of the start printing position and the cutting position.

Printer THERMAL RECEIPT PRINTER 54


a Function
1 Set the setting of the start printing position.
2 Set the setting for the start cutting position.
• m Specifies the direction of adjustment.
M Function
0, 48 Specify the direction in which the paper is fed
forward.
1, 49 Specify the direction of reverse feed.
• nL and nH are the start printing position or the cutting position that advances [ (nL+nH×256)×0.125 mm] after
the black mark is detected.
[Note] • The printing start position adjustment value (a=1) is affected by the following command:
FF, GS FF
• The trim position adjustment value (a=2) is affected by the following command:
GS V m n
• When the command is received from the host, it is first stored in a receive buffer, and then and
then it is carried out during the execution of other ordinary commands. Therefore, the printer may
delay execution of the command after it is received, based on the status of the receive buffer.
• For the setting of m, the reverse paper feed function is temporarily turned off, i. e. the
instructions for filtering the reverse paper feed.
• The setting value of printing start position should be greater than or equal to the setting value of
paper cutting position. If it is less than the setting value, the setting value of cutter position should
be taken.
[Default] All adjustment values are set to "0"(when the BM sensor detects BM, the corresponding positions
of printing head and cutter are respectively the printing start position and the paper cutting
position)
99. ESC q Sets the pulse to drive the cashbox when printing
[Format] ASCII code ESC q m t1 t2
Hexadecimal code 1B 71 m t1 t2
Decimal code 27 113 m t1 t2
[Range] m=[0, 1, 48, 49] 0 ≤ t1 ≤ 255 0 ≤ t2 ≤ 255 t1≤t2
[Description] Outputs the cash drawer opening pulse set by t1 and t2 to the pin which is designated by m:

m Connecting pin
0, 48 Pin 2 of cash drawer socket
1, 49 Pin 5 of cash drawer socket

[Note] • The high-level time of the cash drawer opening pulse is t1 ms, and the flat time of the low point
is t2 ms.
• If t2 < t1, then t2=t1.
100. The Cash Drawer pulse generated when ESC r drives printing
[Format] ASCII code ESC r
Hexadecimal code 1B 72
Decimal code 27 114
[Description] Sending the command generates a Cash Drawer pulse that has been set.

Printer THERMAL RECEIPT PRINTER 55


[Note] • This command is used in conjunction with the ESC q to set and then generate a Cash Drawer
pulse.
• This command sets one Cash Drawer pulse to only generate one Cash Drawer pulse. If Cash
Drawer pulse needs to be generated, please reset the Cash Drawer pulse.
101. GS)) In the hexadecimal mode, execute hexadecimal printing data
[Format] ASCII code GS ) )
Hexadecimal code 1D 29 29
Decimal code 29 41 41
[Description] In the hexadecimal mode, send this command to print the data after hexadecimal conversion
102. GS I Transfer printer ID
[Format] ASCII code GS I n
Hexadecimal code 1D 49 n
Decimal code 29 73 n
[Range] n: The difference depends on the printer
[Default] No
[Description] Transfer printer ID or printer information
Printer ID:
n Printer ID Specific content
1, 49 Printer model ID Printer model ID
2, 50 Type ID Printer type
3, 51 Version ID Firmware version
*Printer information A:
n Printer information A Specific content
33 Type information Supported functions
35, 36, 96, 110 (See model specific information) (See model specific information)
*Printer information B:
n Printer information B Specific content
65 Firmware version Firmware version
66 Name of producer "EPSON"
67 Model name Model name
68 Serial number Serial number of the printer
69 Language and typeface used by per Japan: “KANJI JAPANESE”
country Simplified Chinese mode:"CHINA GB2312" or
"CHINA GB18030"
Traditional Chinese mode:"TAIWAN BIG-5"
Korea: "KOREA C-5601C"
South Asia:"THAI 1 PASS"
112 See model specific information See model specific information

[Note] When using this command, please observe the following rules:
• When the host sends function data, the next data is sent after receiving the corresponding ID
from the printer.
• Using a serial interface printer, be sure to use this function when the host can receive data.
• The parallel interface printer is used for filtering without carrying out the instruction.

Printer THERMAL RECEIPT PRINTER 56


[Printer ID considerations]
• Each printer ID consists of 1 byte.
• Printer models (n=1, 49) vary by printer model.
• The ID type (n=2, 50) is as follows:

Bit Binary system Function Hexadecimal Decimal


0 0 Multi-byte code characters are not supported 00 0
1 Supports multi-byte code characters 01 1
1 0 Not installed the automatic cutter 00 0
1 Install the automatic cutter 02 2
2 0 DM-D is not connected 00 0
1 DM-D is connected 04 4
3 - Reserved - -
4 0 Fixed 00 0
5 - Reserved - -
6 0 Fixed 00 0
7 0 Fixed 00 0
• There is a one-to-one correspondence between the version number (n=3, 51) and the firmware
version. The details variation depends on the printer model.
• The printer ID differs from other transmitted data in the 4th and 7th bits. When the data sent by
the printer GS I is "0xx0xxxx"(x=0, 1), the printer processes the data as the printer ID.
[Printer information A precautions]
• The printer information A is composed of [Header-NULL] as shown in the following table:
Send data Hexadecimal Decimal Bytes
Header 3Dh 61 1 byte
Identifier (∗1) 21h, 23h, 24h, 0h, or 6Eh 33, 35, 36, 96, or 110 1 byte
Printer nformation A Depending on printer model Depending on printer model 0-80 byte
NUL 00h 1 byte
• (*1) The identifier is equal to the parameter n of the command.
• Type information (n=33) is 1 byte of [the first byte] , 2 bytes of [the first byte] and [the second
byte] , or 3 bytes of [the first byte] to [the third byte] , depending on the model.
<the first byte>
Bit Binary system Function Hexadecimal Decimal
0 0 Multi-byte code characters are not 00 0
supported
1 Supports multi-byte code characters 01 1
1 0 Not installed the automatic cutter 00 0
1 Install the automatic cutter 02 2
2 0 DM-D is not connected 00 0
1 DM-D is connected 04 4
3-5 - Reserved - -
6 1 Fixed 40 64
7 0 Fixed 00 0

Printer THERMAL RECEIPT PRINTER 57


<the second byte>
Bit Binary system Function Hexadecimal Decimal
0-5 - Reserved - -
6 1 Fixed 40 64
7 0 Fixed 00 00
<the third byte>
Bit Binary system Function Hexadecimal Decimal
0 0 No stripping function 00 0
1 By the stripping function 01 1
1-5 - Reserved - -
6 1 Fixed 40 64
7 0 Fixed 00 0
• When communicating with the printer, using the XON/XOFF control, the XOFF code may
interrupt the "Header to NUL" data string.
• The printer information A may be distinguished by a header of block data from other transmission
data. After GS I is output, if the header sent from the printer is [Hex=3Dh/Decimal=61], the data is
processed as NUL [Hex=00h/Decimal=0] as a data block in accordance with the header and the
identifier.
[Printer information B precautions]
• Each printer information consists of [header to NUL] (n=65-69 or n=112).
Send data Hexadecimal Decimal Bytes
Header 5Fh 95 1 byte
Printer information B Depending on model Depending on model 0-80 byte
NUL 00h 0 1 byte
• If the printer information is not ready, send [Header+NUL] (2 bytes).
• The firmware version can be confirmed by self-test printing. The self-test is performed by
performing GS (A or by panel switch operation when the power is turned on.
• Using the serial interface, XON/XOFF control when communicating with the printer, the XOFF
code may interrupt the "Header to NUL" data string.
• Depending on the specific data of the transfer data block, the printer information can be
recognized as other transfer data. When the header sent by the printer is [Hex=5Fh/Decimal=95],
the NUL [Hex=00h/Decimal=0] is treated as a data group and identified in accordance with the
following data.
Return information reference:

Printer
80 Printer
model ID

Instruction Printer information n value Specific information Return value (HEX) ASCII
1, 49 Printer ID 20 /
2, 50 Type ID 03 /
Printer ID
GS I n 3, 51 Version ID 62 /
4 / 00 /
Printer information 35 See model specific No /

Printer THERMAL RECEIPT PRINTER 58


A 96 information No /
65 Firmware version 5F 38 2E 30 30 20 45 8.00 ESC/POS
53 43 2F 50 4F 53 00
66 Name of producer 5F 4D 61 6E 75 66 61 _Manufacturer:
63 74 75 72 65 72 3A J-SPEED
4A 2D 53 50 45 45 44
67 Model name 5F 50 72 69 6E 74 20 _Print
4E 61 6D 65 3A 50 38 Name:P80-Seri
30 2D 53 65 72 69 61 als
6C 73
68 Serial number 5F 50 72 69 6E 74 65 _Printer-80-T
72 2D 38 30 2D 54 4D M-487467
Printer information 2D 34 38 37 34 36 37
B 69 Language and 5F 43 48 49 4E 41 2C _CHINA,
typeface used by per 47 42 31 38 30 33 30 GB18030
country

112 Additional 13 5F 30 00 11 XOFF 0 XON


information 1
113 Additional 13 5F 31 00 11 XOFF 1 XON
information 2
217 Program burn date 181008133327No For example:
time October 8,
2018, 13:33:
27

103. GS (H response specifies the process ID


[Format] ASCII code GS ( H m a1 a2 a3 d1 d2 d3 d4
Hexadecimal code 1D 28 48 m a1 a2 a3 d1 d2 d3 d4
Decimal code 29 40 72 m a1 a2 a3 d1 d2 d3 d4
[Range] m=6, a1 a2 a3 is an arbitrary value (filter), d1, d2, d3, d4 are processing IDs
[Description] Response specified process ID
[Note] The data format returned by the process ID is 0x37 0x22 0xd1 0xd2 0xd3 0xd4 0x00

Printer THERMAL RECEIPT PRINTER 59


Appendix X: Code 128

X. 1 128 Code overview


The 128 code is capable of encoding 128 ASCII characters and 100 digits from, 00 to 99 as well as some special
characters by alternately using the character set A the character set B, and the character set C. The characters
encoded for each character set are as follows:
• Character set A: ASCII characters 00H to 5FH
• Character set B: ASCII characters 20H to 7FH
• Character set C: 100 digits from 00 ~ 99
The following special characters can also be encoded in 128 codes:
• The SHIFT character "SHIFT" enables the first character following the bar code symbol SHIFT character to be
converted from the Character Set A to the Character Set B, or from the Character Set B to the Character Set A,
starting with the second character, back to the character set previously used for SHIFT. The SHIFT character can
only be switched between the character set A and the character set B. It cannot bring the current encoded character
into or out of the state of character set C.
• The character set selects characters (CODE A, CODE B, CODE C) These characters convert the encoded
characters that follow them to the character sets A, B, or C.
• The utility of the function characters (FNC1, FNC2, FNC3, FNC4) depends on the application software. In
character set C, only FNC1 is available.

X.2 character set


Characters in the character set A
Send data Send data Send data
Character Hexadecimal Decimal Character Hexadecimal Decimal Character Hexadecimal Decimal
code code code code code code
NUL 00 0 ( 28 40 P 50 80
L 01 1 ) 29 41 Q 51 81
SOH 02 2 * 2A 42 R 52 82
STX 03 3 + 2B 43 S 53 83
ETX 04 4 , 2C 44 T 54 84
EOT 05 5 - 2D 45 U 55 85
ENQ 06 6 . 2E 46 V 56 86
ACK 07 7 / 2F 47 W 57 87
BEL 08 8 0 30 48 X 58 88
BS 09 9 1 31 49 Y 59 89
HT 0A 10 2 32 50 Z 5A 90
LF 0B 11 3 33 51 [ 5B 91
VT 0C 12 4 34 52 \ 5C 92
FF 0D 13 5 35 53 ] 5D 93
CR 0E 14 6 36 54 ^ 5E 94
SO 0F 15 7 37 55 _ 5F 95
SI 10 16 8 38 56 FNC 7B, 31 123, 49
DLE 11 17 9 39 57 1 7B, 32 123, 50
DC1 12 18 : 3A 58 FNC 7B, 33 123, 51
DC2 13 19 ; 3B 59 2 7B, 34 123, 52
DC3 14 20 < 3C 60 FNC 7B, 53 123, 83
DC4 15 21 = 3D 61 3 7B, 42 123, 66
NAK 16 22 > 3E 62 FNC 7B, 43 123, 67

Printer THERMAL RECEIPT PRINTER 60


SYN 17 23 ? 3F 63 4
ETB 18 24 @ 40 64 SHIF
CAN 19 25 A 41 65 T
EM 1A 26 B 42 66 COD
SUB 1B 27 C 43 67 EB
ESC 1C 28 D 44 68 COD
FS 1D 29 E 45 69 EC
GS 1E 30 F 46 70
RS 1F 31 G 47 71
US 20 32 H 48 72
SP 21 33 IJ 49 73
! 22 34 K 4A 74
" 23 35 L 4B 75
* 24 36 M 4C 76
$ 25 37 N 4D 77
% 26 38 O 4E 78
& 27 39 4F 79

Characters in the character set B


Send data Send data Send data
Character Hexadecimal Decimal Character Hexadecimal Decimal Character Hexadecimal Decimal
code code code code code code
SP 20 32 H 48 72 p 70 112
! 21 33 I 49 73 q 71 113
" 22 34 J 4A 74 r 72 114
* 23 35 K 4B 75 s 73 115
$ 24 36 L 4C 76 t 74 116
% 25 37 M 4D 77 u 75 117
& 26 38 N 4E 78 v 76 118
' 27 39 O 4F 79 w 77 119
( 28 40 P 50 80 x 78 120
) 29 41 Q 51 81 y 79 121
* 2A 42 R 52 82 z 7A 122
+ 2B 43 S 53 83 { 7B, 7B 123, 123
, 2C 44 T 54 84 | 7C 124
- 2D 45 U 55 85 } 7D 125
. 2E 46 V 56 86 — 7E 126
/ 2F 47 W 57 87 DEL 7F 127
0 30 48 X 58 88 FNC 7B, 31 123, 49
1 31 49 Y 59 89 1 7B, 32 123, 50
2 32 50 Z 5A 90 FNC 7B, 33 123, 51
3 33 51 [ 5B 91 2 7B, 34 123, 52
4 34 52 \ 5C 92 FNC 7B, 53 123, 83
5 35 53 ] 5D 93 3 7B, 41 123, 65
6 36 54 ^ 5E 94 FNC 7B, 43 123, 67
7 37 55 _ 5F 95 4

Printer THERMAL RECEIPT PRINTER 61


8 38 56 ` 60 96 SHIF
9 39 57 a 61 97 T
: 3A 58 b 62 98 COD
; 3B 59 c 63 99 EA
< 3C 60 d 64 100 COD
= 3D 61 e 65 101 EC
> 3E 62 f 66 102
? 3F 63 g 67 103
@ 40 64 h 68 104
A 41 65 i 69 105
B 42 66 j 6A 106
C 43 67 k 6B 107
D 44 68 l 6C 108
E 45 69 m 6D 109
F 46 70 n 6E 110
G 47 71 o 6F 111

Characters in the character set C


Send data Send data Send data
Character Hexadecimal Decimal Character Hexadecimal Decimal Character Hexadecimal Decimal
code code code code code code
0 00 0 40 28 40 80 50 80
1 01 1 41 29 41 81 51 81
2 02 2 42 2A 42 82 52 82
3 03 3 43 2B 43 83 53 83
4 04 4 44 2C 44 84 54 84
5 05 5 45 2D 45 85 55 85
6 06 6 46 2E 46 86 56 86
7 07 7 47 2F 47 87 57 87
8 08 8 48 30 48 88 58 88
9 09 9 49 31 49 89 59 89
10 0A 10 50 32 50 90 5A 90
11 0B 11 51 33 51 91 5B 91
12 0C 12 52 34 52 92 5C 92
13 0D 13 53 35 53 93 5D 93
14 0E 14 54 36 54 94 5E 94
15 0F 15 55 37 55 95 5F 95
16 10 16 56 38 56 96 60 96
17 11 17 57 39 57 97 61 97
18 12 18 58 3A 58 98 62 98
19 13 19 59 3B 59 99 63 99
20 14 20 60 3C 60 FNC 7B, 31 123, 49
21 15 21 61 3D 61 1 7B, 41 123, 65

Printer THERMAL RECEIPT PRINTER 62


22 16 22 62 3E 62 COD 7B, 42 123, 66
23 17 23 63 3F 63 EA
24 18 24 64 40 64 COD
25 19 25 65 41 65 EB
26 1A 26 66 42 66
27 1B 27 67 43 67
28 1C 28 68 44 68
29 1D 29 69 45 69
30 1E 30 70 46 70
31 1F 31 71 47 71
32 20 32 72 48 72
33 21 33 73 49 73
34 22 34 74 4A 74
35 23 35 75 4B 75
36 24 36 76 4C 76
37 25 37 77 4D 77
38 26 38 78 4E 78
39 27 39 79 4F 79

Appendix Y: Print mode and its conversion

Y. 1 Overview The printer has two operating modes: standard mode and page mode. in standard mode, whenever
that print line buffer is full or receive
The print or feed command causes the printer to print and feed the paper. In the page mode, all printing data and
paper feed commands are stored in the specified memory space, and the printer does not perform any operations.
Until an ESC FF or FF command is received, the printer will print all the contents of the print area.
For example, when the printer receives "ABCDEF" <LF> in standard mode, it immediately prints "ABCDEF"
and feeds one line of paper. In the page mode, the printer writes "ABCDEF" to the printing area in memory, and
the next print data is placed on the next line of the print area. The ESC L command switches the printer to page
mode, after which all data is processed in page mode. In this way, executing the ESC FF command prints all the
data received, while executing the FF command not only prints all the data received, but also switches the printer
to standard mode. Executing the ESC S command also switches the printer to standard mode, but it does not
printing data received in page mode and clears it.

Figure Y. 1 Switching between the standard mode and the page mode

Printer THERMAL RECEIPT PRINTER 63


Y. 2 Set various values in the standard mode and the page mode
1) Some commands (e. g. ESC SP, ESC 2, ESC 3, and FS S) can be employed in both standard mode and page
mode, and their parameters are the same. But the settings in the two modes are independent and they are stored
separately.
Y. 3 Printing area setting
1) The printing area is set by the ESC W command. If all the printing and feeding operations have been
completed before receiving the ESC W command, the printer takes the left (when you face the printer) as the
coordinate origin (x0, y0) of the printing area.
The width (dx point) of the rectangular printing area extends to the right from the coordinate origin (x0, y0) in the
x direction (perpendicular to the paper feed direction); the height (dy point) is in the y direction (paper feed
direction). If the printing area is not set with ESC W, the printing area assumes the default value.
2) After the printer sets the printing area and the direction of the printing area (set by ESC T command), the
received printing data will be arranged in the printing area in accordance with the position shown in Figure B. 2.
Point A is the start position of the printing area, which is the default value.(when a character is printed, point a
serves as a baseline) the downloaded bitmap or bar code data in the printed data is aligned with the baseline with
the current position as its lower left corner (point B in Figure B. 3).
3) Before receiving a command (e. g. LF or ESC J) containing paper feed, if the print data (including character
spacing) has exceeded the print area, the printer automatically feeds a line of paper (how much paper is fed,
depending on the line height set by ESC 2 and ESC 3), and the printing position moves to the beginning of the
next line.
4) The default row height is 1/6 inch, equivalent to 31 points in the longitudinal direction. If the printing data on
the next line contains characters enlarged by more than 2 times longitudinally, or the bitmap occupies 2 or more
lines, and the bar code is higher than the normal characters, the paper feed of the printer cannot meet the
requirements, resulting in the superposition of the printed characters and the characters printed on the previous
line. To avoid this, you can increase the row height. For example, when printing a download bitmap with a height
of 6 bytes, use the following formula:
{The number of longitudinal points (8×6)-the number of feed points (24) at the starting of the printing area}×the
longitudinal moving units (200/200)=24, that is, to print the complete bitmap, the printing position needs to be
shifted down by 24 points on the basis of the start position of the printing area. Use the following command:
ESC W xL, xH, yL, yH, dxL, dxH, dyL, dyH ESC T n
ESC 3 24 Å Sets the new row height
LF
GS / 1
ESC 2 Å Restores the row height to 1/6 inch

Printer THERMAL RECEIPT PRINTER 64


Figure Y. 2 Storage location of character data

Figure Y. 3 Storage location of printing data

Printer THERMAL RECEIPT PRINTER 65


Figure Y. 3 Storage location of download bitmap

Warning: The content of this manual should not be changed without permission, and the right to change the
product in technology, parts, software and hardware. If you need further information about the product, you can
contact the dealer. No section of this manual may be reproduced or transmitted in any forms or by any means
without permission.

Printer THERMAL RECEIPT PRINTER 66

You might also like