58mm Programming Manual v1.0.0
58mm Programming Manual v1.0.0
Programming Manual
Command Notation:
1) [Name] Command function outline.
Unless otherwise mentioned, the range of values are Decimal, for example 1 ≤ n ≤ 4 as
7) [Default] Gives the default values, if any, for the command parameters.
RECEIPT PRINTER
1
24 ESC V Turn 90° clockwise rotation mode on/off
25 ESC \ Set relative print position
26 ESC a Select justification
27 ESC c 3 Select paper sensor(s) to output paper end signals
28 ESC c 4 Select paper sensor(s) to stop printing
29 ESC c 5 Enable/disable panel buttons
30 ESC d Print and feed n lines
31 ESC p Generate pulse
32 ESC t Select character code table
33 ESC { Turn upside-down print mode on/off
34 FS P Print NV bit image
35 FS q Define NV bit image
36 GS ! Select character size
37 GS * Define downloaded bit image
38 GS / Print downloaded bit image
39 GS B Turn white/black reverse printing mode on/off
40 GS H Select print position of HRI characters
41 GS L Set left margin
42 GS P Set horizontal and vertical motion units
43 GS W Set printing area width
44 GS a Enable/disable Automatic Status Back (ASB)
45 GS f Select font for HRI characters
46 GS h Set bar code height
47 GS k Print bar code
48 GS r Transmit status
49 GS I Transmit printer ID
50 GS v 0 Print raster bit image
51 GS w Set bar code width
RECEIPT PRINTER
2
61 GS V Select cut mode and execute a partial cut
QR code commands
65 (K< Function 167> QR Code: Set the size of module
66 (K< Function 169> QR Code: Select the error correction level
67 (K< Function 180> QR Code: Store the data in the symbol storage area
68 (K< Function 181> QR Code: Print the symbol data in the symbol storage
area
[Format] ASCII HT
Hex 09
Decimal 9
[Description] Moves the print position to the next horizontal tab position.
[Details]
This command is ignored unless the next horizontal tab position has been set.
If the next horizontal tab position exceeds the printing area, the printer sets the printing position
to [Printing area width +1].
The horizontal tab position is set by ESC D.
If this command is received when the printing position is at [printing area width + 1], the
printer executes print buffer-full printing of the current line and horizontal tab processing from
the beginning of the next line.
The default setting of the horizontal tab position for the paper roll is font A(12*24) every 8th
character(9th,17th,25th,…column).
The below command is executed when the printer receive buffer is full:
In standard mode, prints the current line and sets the print position to the beginning of the
next line.
[Reference] ESC D
[Format] ASCII LF
Hex 0A
Decimal 10
[Description] Prints the data in the print buffer and feeds one line based on the current line spacing.
RECEIPT PRINTER
3
[Details] This command sets the print position to the beginning of the line.
[Reference] ESC 2, ESC 3
n = 2: Off-line status
RECEIPT PRINTER
4
Bit Binary Hex Decimal Status
0 0 00 0 Fixed to 0
1 1 02 2 Fixed to 1
0 00 0 Cover is closed.
2
1 04 4 Cover is open.
0 00 0 Paper is not being fed by using the paper FEED button.
3
1 08 8 Paper is being fed by the paper FEED button.
4 1 10 16 Fixed to 1
0 00 0 Paper adequate
5
1 20 32 Paper shortage
0 00 0 No error.
6
1 40 64 Error has occurred
7 0 00 00 Fixed to 0
n = 3: Error status
Bit Binary Hex Decimal Status
0 0 00 0 Fixed to 0
1 1 02 2 Fixed to 1
2 --- --- undefined
0 00 0 No auto-cutter error.
3
1 08 8 Auto-cutter error occurred.
4 1 10 16 Fixed to 1
0 00 0 No unrecoverable error.
5
1 20 32 Unrecoverable error occurs.
0 00 0 Print head temperature and voltage normal
6
1 40 64 Print head temperature and voltage out of range
7 0 00 00 Fixed to 0
RECEIPT PRINTER
5
4、DLE ENQ n Real-time request to printer
RECEIPT PRINTER
6
effective.
[Reference] ESC p
RECEIPT PRINTER
7
1 20 32 Double-width mode selected
6 --- --- undefined
0 00 0 c
7
1 80 128 Underline mode selected
[Details]
When both double-height and double-width modes are selected, the characters will be
quadrupled.
The printer can underline all characters, but can not underline the space set by HT or 90°
clockwise rotated characters.
The thickness of the underline is that selected by ESC – , regardless of the character size.
When some characters in a line are double or more height, all the characters on the line are
aligned at the baseline.
ESC E can also turn on or off emphasized mode. However, the setting of the last received
command is effective.
ESC – can also turn on or off underline mode. However, the setting of the last received
command is effective.
GS ! can also select character size. However, the setting of the last received command is
effective.
Emphasized mode is effective for alphanumeric and Kanji. All print modes except emphasized
mode is effective only for alphanumeric
[Default] n=0
[Reference] ESC -, ESC E, GS !
RECEIPT PRINTER
8
Hex 1B 25 n
Decimal 27 37 n
[Range] 0 ≤ n ≤255
[Description]
This command selects/deselects user-defined character set that is downloaded by user. To make it
valid, the least significant bit should be defined like following.
When the LSB of n is 0, the user-defined character set is canceled.
When the LSB of n is 1, the user-defined character set is selected.
[Details]
When the user-defined character set is canceled, the internal character set is automatically
selected.
n is available only for the least significant bit.
[Default] n=0
[Reference] ESC &, ESC ?
10、ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)] Define user-defined character set
RECEIPT PRINTER
10
11、ESC * m nL nH d1... dk Specify bit-image mode
RECEIPT PRINTER
11
d specifies the bit image data with 1 for printed data and 0 for not printed.
After printing a bit image, the printer returns to normal data processing mode.
This command is not affected by print modes (emphasized, double-strike, underline, character
size or white/black reverse printing), except upside-down printing mode.
If the width of the printing area set by GS L and GS W less than the width required by the data
sent with the ESC * command, the following will be performed on the line in question (but the
printing cannot exceed the maximum printable area):
1、The width of the printing area is extended to the right to accommodate the amount of data.
2、If step1 does not provide sufficient width for the data, the left margin is reduced to accommodate
the data.
The relationship between the image data and the dots to be printed is as follows:
When 8-dot bit image is selected:
RECEIPT PRINTER
12
12、ESC – n Turn underline mode on/off
n Function
0, 48 Turns off underline mode
1, 49 Turns on underline mode (set at 1-dot thick)
2, 50 Turns on underline mode (set at 2-dot thick)
[Details]
The printer can underline all characters (including right-side character spacing), but cannot
underline the space set by HT.
The printer cannot underline 90° clockwise rotated characters and white/black inverted
characters.
When underline mode is turned off by setting the value of n to 0 or 48, the following data is not
underlined, and the underline thickness set before the mode is turned off does not change. The
default underline thickness is 1 dot.
Changing the character size does not affect the current underline thickness.
Using ESC !, the underline mode can be activated/deactivated as well. However, that the last
received command is effective.
This command does not affect the setting of Kanji characters.
[Default] n=0
[Reference] ESC !
RECEIPT PRINTER
13
The line spacing is settable independently for each of standard and page modes.
The horizontal and vertical motion unit is specified by GS P. Changing the horizontal or vertical
motion unit does not affect the current line spacing.
In standard mode, the vertical motion unit is used。
In page mode, this command functions as follows, depending on the direction and starting
position of the printable area:
1、When the starting position is set to the upper left or lower right of the printable area using ESC T,
the vertical motion unit (y) is used.
2、When the starting position is set to the upper right or lower left of the print able area using ESC T,
the horizontal motion unit (x) is used.
The maximum line spacing is 956mm. When the setting value exceeds the maximum, it is
converted to the maximum automatically.
[Default] Line spacing equivalent to approximately 3.75mm.
[Reference] ESC 2, GS P
RECEIPT PRINTER
14
ignores this command.
[Reference] ESC &, ESC %
RECEIPT PRINTER
15
The default tab positions are at intervals of 8 characters (columns 9, 17, 25,...) for font A (12 ×24)。
[Reference] HT
RECEIPT PRINTER
16
The horizontal and vertical motion unit is specified by GS P.
In standard mode, the printer uses the vertical motion unit (y).
The maximum line spacing is 956mm. When the setting value exceeds the maximum, it is
converted to the maximum automatically.
[Reference] GS P
RECEIPT PRINTER
17
24、ESC V n Turn 90° clockwise rotation mode on/off
RECEIPT PRINTER
18
[Range] 0 ≤ n ≤ 2, 48 ≤ n ≤ 50
[Description]
Aligns all the data in one line to the specified position, n selects the justification as follows:
n justification
0,48 Left justification
1, 49 Center justification
2, 50 Right justification
[Details]
The command is enabled only when processed at the beginning of the line in standard mode.
If this command is input in page mode, the printer performs only internal flag operations.
This command executes justification in the printing area.
This command justifies the space area according to HT, ESC $ or ESC \.
[Default] n=0
[Example]
RECEIPT PRINTER
20
When the panel buttons are disabled, none of them are usable.
The panel buttons always are usable when executing the macro command.
[Default] n=0
RECEIPT PRINTER
21
1 Katakana
2 PC850 [Multilingual]
3 PC860 [Portuguese]
4 PC863 [Canadian-French]
5 PC865 [Nordic]
6 West Europe
7 Greek
8 Hebrew
9 PC755: East Europe
10 Iran
16 WPC1252
17 PC866:Cyrillic #2
18 PC852: Latin2
19 PC858
20 Iran ll
21 Latvian
22 Arabic
23 PT151,1251
24 PC747
25 WPC1257
27 Vietnam
28 PC864
29 PC1001
30 Uygur
255 Thai
[Details] Code page supported by reference to printer self-test page.
[Default] n=0
RECEIPT PRINTER
22
[Default] n=0
[Example]
[Format] ASCII FS p n m
Hex 1C 70 n m
Decimal 28 112 n m
[Range] 1 ≤ n ≤ 255 0 ≤ m ≤ 3, 48 ≤ m ≤51
[Description] Prints NV bit image n using the mode specified by m as follows:
m Mode Vertical Dot Density (DPI) Horizontal Dot Density(DPI)
0, 48 Normal 200 200
1, 49 Double-width 200 100
2, 50 Double-height 100 200
3, 51 Quadruple 100 100
n is the number of the NV bit image (defined using the FS q command).
m specifies the bit image mode.
[Details]
NV bit image means a bit image which is defined in a non-volatile memory by FS q and printed
by FS p.
This command is not effective when the specified NV bit image has not been defined.
In standard mode, this command is effective only when there is no data in the print buffer.
This command is not affected by print modes (emphasized, double-strike, double-height,
double-width, underline, character size, white/black reverse printing, or 90° rotated characters,
etc.), except upside-down printing mode.
The printer does not print the NV bit image that is beyond one line of print area.
This command feeds dots (for the height n of the NV bit-image) in normal and double-width
modes, and feeds n×2dots (for the height n of the NV bit-image) in double-height and
quadruple modes, regardless of the line spacing specified by ESC 2 or ESC 3.
After printing the bit image, this command sets the print position to the beginning of the line and
processes the data that follows as normal data.
[Reference] ESC *, FS q, GS /, GS v 0
RECEIPT PRINTER
23
35、FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n Define NV bit image
RECEIPT PRINTER
24
NV bit image is defined n=1, the printer processes a data group [xL xH yL yH d1...dk] once.
The printer uses ([data: (xL+xH×256)×(yL+yH ×256)×8]+[header: 4]) bytes of NV memory.
The definition area in this printer is a maximum of 64K bits (8K bytes). This command can
define several NV bit images, but cannot define a bit image data whose total capacity [bit
image data header] exceeds 64K bits (8K bytes).(different capacity by different printer, please
refer to the print specification).
The printer is busy immediately before writing into NV memory.
During processing this command, the printer neither transmits the status, nor executes
status queries.
When this command is received during macro definition, the printer ends macro definition, and
begins performing this command.
Once a NV bit image is defined, it is not erased by performing ESC @, reset, and power off.
This command performs only definition of a NV bit image and does not perform printing.
Printing of the NV bit image is performed by the FS p command.
[Reference] FS p
[Example] when xL = 64, xH = 0, yL = 96, yH = 0
RECEIPT PRINTER
25
36、GS ! n Select character size
[Format] ASCII GS ! n
Hex 1D 21 n
Decimal 29 33 n
[Range] 0 ≤ n ≤ 255
(1 ≤ vertical number of times ≤ 8,1 ≤ horizontal number of times ≤ 8)
[Description]
One byte has 8 bits, selects the character height using bits 0 to 2 and selects the character width
using bits 4 to 6, as follows:
Character width selection
Enlarged in Horizontal
Bit6 Bit5 Bit4 Hex Decimal
direction
0 0 0 00 0 1 (Normal)
0 0 1 10 16 2 (Double-width)
0 1 0 20 32 3
0 1 1 30 48 4
1 0 0 40 64 5
1 0 1 50 80 6
1 1 0 60 96 7
1 1 1 70 112 8
[Details]
This command is all characters (alphanumeric and Kanji) effective except for HRI characters.
If n is outside of the defined range, this command is ignored.
In standard mode, the vertical direction is the paper feed direction, and the horizontal direction
is perpendicular to the paper feed direction. However, when character orientation changes in
90° clockwise-rotation mode, the relationship between vertical and horizontal directions is
reversed.
In page mode, vertical and horizontal directions are based on the character orientation.
When characters are enlarged with different sizes on one line, all the characters on the line are
aligned at the baseline.
RECEIPT PRINTER
26
ESC ! command can also turn double-width and double-height modes on or off. However, the
setting of the last received command is effective.
[Default] n=0
[Reference] ESC !
[Reference] GS /
RECEIPT PRINTER
27
38、GS / m Print downloaded bit image
[Format] ASCII GS / m
Hex 1D 2F m
Decimal 29 47 m
[Range] 0 ≤ m ≤ 3, 48 ≤ m ≤ 51
[Description] Print a downloaded bit image using the mode specified by m.
m selects a mode from the table below:
m Mode Vertical Dot Density (DPI) Horizontal Dot Density (DPI)
0, 48 Normal 200 200
1, 49 Double-Width 200 100
2, 50 Double-Height 100 200
3, 51 Quadruple 100 100
[Details]
This command is ignored when if a downloaded bit image is not defined.
In standard mode, this command works only when the print buffer is empty.
Except for upside-down printing mode, none of print mode such as emphasized, double-strike,
underline, character size, or white/black reverse printing, affects the printing of the downloaded
bit image.
If the downloaded bit-image to be printed exceeds the printable area, the excess data is not
printed.
The bit image to be printed using this commands is downloaded to RMA not FLASH,
corresponding image number is set by the GS *
[Reference] GS *
[Format] ASCII GS B n
Hex 1D 42 n
Decimal 29 66 n
[Range] 0 ≤ n ≤ 255
[Description] Turn on or off white/black reverse printing mode by setting the least significant bit of n.
When the LSB of n is 0, white/black reverse mode is turned off.
When the LSB of n is 1, white/black reverse mode is turned on.
[Details]
Only the lowest bit of n is valid.
This command affects all characters except for HRI characters.
When white/black reverse printing mode is on, it also applied to character spacing set by ESC
SP.
This command does not affect bit image, user-defined bit image, bar code, HRI characters, and
spacing skipped by HT, ESC $, and ESC \.
This command does not affect the space between lines.
White/black reverse mode has a higher priority than underline mode. Even if underline mode is
on, it is disabled (but not canceled) when white/black reverse mode is selected. Underline
RECEIPT PRINTER
28
mode works when white/black reverse mode is not selected.
[Default] n=0
[Format] ASCII GS H n
Hex 1D 48 n
Decimal 29 72 n
[Range] 0 ≤ n ≤ 3, 48 ≤ n ≤ 51
[Description] Select the printing position of HRI characters when printing a bar code.
The printing position is set according to the value of as follows:
n Printing position
0, 48 Not printed
1, 49 Above the bar code
2, 50 Below the bar code
3, 51 Both above and below the bar code
HRI indicates Human Readable Interpretation.
[Details] HRI characters are printed using the font specified by GS f.
[Default] n=0
[Reference] GS f, GS k
[Format] ASCII GS L nL nH
Hex 1D 4C nL nH
Decimal 29 76 nL nH
[Range] 0 ≤ nL ≤ 255
0 ≤ nH ≤ 255
[Description] Set the left margin specified to [(nL + nH × 256) × (horizontal motion units)] inches.
[Details]
This command is effective only processed at the beginning of the line in standard mode.
If the setting exceeds the printable area, the maximum value of the printable area is used.
The horizontal and vertical motion units are specified by GS P. Changing the horizontal and
vertical motion unit does not affect the current left margin.
[Default] nL = 0, nH = 0
[Reference] GS P, GS W
RECEIPT PRINTER
29
42、GS P x y Set horizontal and vertical motion units
[Format] ASCII GS P x y
Hex 1D 50 x y
Decimal 29 80 x y
[Range] 0 ≤ x ≤ 255
0 ≤ y ≤255
[Description]
Sets the horizontal and vertical motion units to approximately 25.4/ x mm {1/ x inches} and
approximately 25.4/ y mm {1/ y inches}, respectively.
When x and y are set to 0, the default setting of each value is used.
[Details]
The horizontal direction is perpendicular to the paper feed direction and the vertical direction is
the paper feed direction.
In standard mode, the following commands use x or y, regardless of character rotation
(upside-down or 90° clockwise rotation):
① Commands using x: ESC SP, ESC $, ESC \, FS S, GS L, GS W
② Commands using y: ESC 3, ESC J, GS V
The command does not affect the previously specified values.
The calculated result from combining this command with others is truncated to the minimum
value of the mechanical pitch.
1 inch=25.4mm.
[Default] x = 200, y = 200, one motion unit is one print point. Horizontal distance is
approximately 1/8mm; vertical distance is approximately 1/7mm.
[Reference] ESC SP, ESC $, ESC 3, ESC J, ESC W, ESC \, GS $, GS L, GS V, GS W, GS \
[Format] ASCII GS W nL nH
Hex 1D 57 nL nH
Decimal 29 87 nL nH
[Range] 0 ≤ nL ≤ 255
0 ≤ nH ≤ 255
[Description] Sets the printing area width to [(nL + nH × 256) × (horizontal motion units)] inches.
[Details]
This command is effective only processed at the beginning of the line.
The printing area width is not effective in page mode; the printer treats the data as normal data.
This command does not affect printing in page mode.
RECEIPT PRINTER
30
When (left margin + printing area width) exceeds the printable area, the printing area width is
automatically set to (printing area width - left margin).
The horizontal and vertical motion units are specified by GS P. Changing the horizontal and
vertical motion units does not affect the current left margin.
The horizontal motion unit (x) is used for calculating the printing area width.
[Default] nL = 76, nH = 2
[Reference] GS L, GS P
[Format] ASCII GS a n
Hex 1D 61 n
Decimal 29 97 n
[Range] 0 ≤ n ≤ 255
[Description] Enables or disables ASB and specifies the status items to include, using n as follows:
Bit Off/On Hex Decimal Status for ASB
0 Off 00 0 Drawer kick-out, connector pin 3 status
disabled.
On 01 1 Drawer kick-out, connector pin 3 status
enabled.
1 - - - Undefined.
2 Off 00 0 Error status disabled.
On 04 4 Error status enabled.
3 Off 00 0 Paper roll sensor status disabled.
On 08 8 Paper roll sensor status enabled.
4-7 - - - Undefined.
[Default] n=0
[Format] ASCII GS f n
Hex 1D 66 n
Decimal 29 102 n
[Range] n = 0, 1, 48, 49
[Description] Select a font for the HRI characters used when printing a bar code.
n selects a font from the following table:
n Font
0,48 Font A (12 × 24)
1,49 Font B (9 × 17)
[Details]
HRI indicates Human Readable Interpretation.
HRI characters are printed at the position specified by GS H.
[Default] n=0
RECEIPT PRINTER
31
[Reference] GS H, GS k
[Format] ASCII GS h n
Hex 1D 68 n
Decimal 29 104 n
[Range] 1 ≤ n ≤ 255
[Description] Set the height of the bar code to n dots.
n specifies the number of dots in the vertical direction.
[Default] n = 162
[Reference] GS k
RECEIPT PRINTER
32
6 UPC-A 11 ≤ n ≤ 12 0~9 48 ≤ d ≤ 57
5
6 UPC-E 11 ≤ n ≤ 12 0~9 48 ≤ d ≤ 57
6
6 JAN13 (EAN13) 12 ≤ n ≤ 13 0~9 48 ≤ d ≤ 57
7
6 JAN8 (EAN8) 7≤n≤8 0~9 48 ≤ d ≤ 57
8
0~9, 45 ≤ d ≤ 57,
A~Z, 65 ≤ d ≤ 90,
6
CODE39 1 ≤ n ≤ 255 SP,$,%,+,-, d = 32, 36, 37, 43, 45,
9
② ., / 46, 47
* d = 42
7 ITF 1 ≤ n ≤ 255 0~9 48 ≤ d ≤ 57
0 (Even number)
7 CODABAR 1 ≤ n ≤ 255 0~9, 48 ≤ d ≤ 57,
1 A~D 65 ≤ d ≤ 68,
$, +, -, ., d = 36, 43, 45, 46,
/,: 47, 58
7 CODE93 1 ≤ n ≤ 255 NUL~SP(7FH) 0 ≤ d ≤ 127
2
7 CODE128 2 ≤ n ≤ 255 NUL~SP(7FH) 0 ≤ d ≤ 127
3
[Details for ①]
This command ends with a NUL code.
When the bar code system used is UPC-A or UPC-E, the printer prints the bar code data after
receiving 12 bytes bar code data and processes the following data as normal data.
When the bar code system used is JAN13 (EAN13), the printer prints the bar code after
receiving 13 bytes bar code data and processes the following data as normal data.
When the bar code system used is JAN8 (EAN8), the printer prints the bar code after receiving
8 bytes bar code data and processes the following data as normal data.
The number of data for ITF bar code must be even numbers. When an odd number of data is
input, the printer ignores the last received data.
[details for ②]
n indicates the number of bar code data, and the printer processes n bytes from the next
character data as bar code data.
If n is outside of the specified range, the printer stops command processing and processes the
following data as normal data.
[Details in standard mode]
This command is not effective when if d is outside of the specified range.
This command is not effective when if the horizontal size exceeds printing area.
This command feeds paper length to be same as bar code height, regardless of the line height
specified by ESC 2 or ESC 3.
This command is enabled only when no data exists in the print buffer. When data exists in the
print buffer, this command is ignored.
RECEIPT PRINTER
33
After printing bar code, this command sets the print position to the beginning of the line.
Except for upside-down printing mode, none of print mode such as emphasized, double-strike,
underline, character size, white/black reverse printing, or 90° clockwise-rotation character,
affects the printing of the bar code.
If the front of bar code data is not character set selection, the printer will stop executing this
command, the rest of data will be treated as normal data.
If “{”and the subsequent character is not the appointed combination as shown above, the
printer will stop executing this command, the rest of data will be treated as normal data.
If receiving character is not bar code character set data, the printer will stop executing this
command, the rest of data will be treated as normal data.
When printing HRI characters, shift character and character set selection data is not printed.
HRI characters of the function characters are not printed.
HRI characters of the control characters (in Hexadecimal: <00>H to <1F>H and <7F>H) are
not printed.
<Other> Make sure to keep the left-side and right-side spacing, as different spacing per different
bar code type.
RECEIPT PRINTER
34
[Reference] GS H, GS f, GS h, GS w
[Format] ASCII GS r n
Hex 1D 72 n
Decimal 29 114 n
[Range] n = 1, 2, 49, 50
[Description] Transmits the status specified by n as follows:
n Function
1,49 Transmits paper sensor status
2,50 Transmits drawer kick-out connector status
[Details]
This command is executed when the data in the receive buffer is developed. Therefore, there
may be a time lag between receiving this command and transmitting the status, depending on
the receive buffer status.
The status types to be transmitted are shown below:
Paper sensor status ( n = 1,49 ):
Bit 0/1 Hex Decimal Status for ASB
0,1 0 00 0 Paper roll near-end sensor: paper adequate.
1 03 3 Paper roll near-end sensor: paper near end.
2,3 0 00 0 Paper roll end sensor: paper adequate.
1 0c 12 Paper end sensor: Paper not present
4 0 00 0 Not used. Fixed to Off.
5,6 --- --- Undefined
7 0 00 0 Not used. Fixed to Off.
drawer kick-out connector status ( n = 2, 50):
Bit 0/1 Hex Decimal Status for ASB
0 0 00 0 Have cash drawer open
1 01 1 No cash drawer open
1-3 --- --- Undefined.
4 0 00 0 Not used. Fixed to Off.
5,6 --- --- Undefined.
7 0 00 0 Not used. Fixed to Off.
[Reference] DLE EOT,GS a
[Format] ASCII GS I n
Hex 1D 49 n
Decimal 29 73 n
[Range] n=66, 67
[Description] Transmit the printer ID specified by n as follows:
RECEIPT PRINTER
35
n Hex Status
66 42 Brand
67 43 Model
RECEIPT PRINTER
36
51、GS w n Set bar code height
[Format] ASCII GS w n
Hex 1D 77 n
Decimal 29 119 n
[Range] 2≤n≤6
[Description] Sets the horizontal size of the bar code, using n as follows:
Multi-level bar code Binary-level bar code
n
module width (mm) Thin element width (mm) Thick element width (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
Multi-level bar codes are as follows:
UPC-A, UPC-E, JAN13 (EAN13), JAN8 (EAN8), CODE93, CODE128
Multi-level bar codes are as follows:
CODE39, ITF, CODABAR
[Default] n=3
[Reference] GS k
[Format] ASCII FS ! n
Hex 1C 21 n
Decimal 28 33 n
[Range] 0 ≤n ≤ 255
[Description] Sets the print mode for Kanji characters, using n as follows:
Bit 0/1 Hex Decimal Function
0, 1 --- --- Undefined.
0 00 0 Double-width mode is OFF.
2
1 04 4 Double-width mode is ON.
3 0 00 0 Double-height mode is OFF.
1 08 8 Double-height mode is ON.
4-6 -- -- Undefined.
0 00 0 Underline mode is OFF.
7
1 80 128 Underline mode is ON.
[Details]
When both double-width and double-height modes are set simultaneously, quadruple-size
characters are printed (including right-side and left-side character spacing).
The printer can underline all characters (including right- and left-side character spacing), but
RECEIPT PRINTER
37
cannot underline the space set by HT and 90°clockwise-rotated characters.
The thickness of the underline is that specified by FS -, regardless of the character size.
When some of the characters in a line are different in height, all the characters on the line are
aligned at the baseline.
It is possible to emphasize the Kanji character using FS W or GS !, the setting of the last
received command is effective.
It is possible to turn underline mode on or off using FS -, and the setting of the last received
command is effective.
[Default] n=0
[Reference] FS - , FS W,GS !
[Format] ASCII FS - n
Hex 1C 2D n
Decimal 28 45 n
[Range] 0 ≤ n ≤ 2, 48 ≤ n ≤ 50
[Description] Turns underline mode for Kanji characters on or off, based on the following values
of n.
n Function
0, 48 Turns off underline mode for Kanji characters
1, 49 Turns on underline mode for Kanji characters (1-dot thick)
2, 50 Turns on underline mode for Kanji characters (2-dot thick)
[Details]
The printer can underline all characters (including right-side and left-side character spacing),
but cannot underline the space set by HT and 90°clockwise-rotated characters.
After the underline mode for Kanji characters is turned off by setting n to 0, underline printing is
no longer performed, but the previously specified underline thickness is not changed. The
default underline thickness is 1 dot.
The specified line thickness does not change even when the character size changes.
It is possible to turn underline mode on or off using FS !, and the last received command is
RECEIPT PRINTER
38
effective.
[Default] n=0
[Reference] FS !
[Format] ASCII FS .
Hex 1C 2E
Decimal 28 46
[Description] Cancel Kanji character mode.
[Details]
When Kanji mode is canceled, the printer processes all characters as ASCII character, and
processes a 1-byte code of character per each time.
Kanji mode is selected at default once printer is power on.
[Reference] FS &
RECEIPT PRINTER
39
57、FS S n1 n2 Set Kanji left and right spacing
[Format] ASCII FS S n1 n2
Hex 1C 53 n1 n2
Decimal 28 83 n1 n2
[Range] 0 ≤ n1 ≤ 255
0 ≤ n2 ≤ 255
[Description] Set left- and right-side Kanji character spacing n1 and n2, respectively.
When the printer model used supports GS P, the left-side character spacing is [n1 × horizontal
RECEIPT PRINTER
40
or vertical motion units] inches, and the right-side character spacing is [n2 × horizontal or
vertical motion units] inches.
[Details]
When double-width mode is set, the left- and right-side character spacing is twice the normal
value.
The horizontal and vertical motion units are set by GS P. The previously specified character
spacing does not change, even if the horizontal or vertical motion unit is changed using GS P.
In standard mode, the horizontal motion unit is used.
In page mode, the horizontal or vertical motion unit differs in page mode, depending on starting
position of the printable area as follows:
① When the starting position is set to the upper left or lower right of the printable area, the
horizontal motion unit is used.
② When the starting position is set to the upper right or lower left of the printable area, the vertical
motion unit is used.
③ The maximum right-side spacing is 36mm, any setting exceeding the maximum is converted to
the maximum automatically.
[Default] n1 = 0, n2 = 0
[Reference] GS P
[Format] ASCII FS W n
Hex 1C 57 n
Decimal 28 87 n
[Range] 0 ≤ n ≤ 255
[Description] Turns quadruple-size mode on or off for Kanji characters.
When the LSB of n is 0, quadruple-size mode for Kanji characters is turned off.
When the LSB of n is 1, quadruple-size mode for Kanji characters is turned on.
[Details]
Only the lowest bit of n is valid.
In quadruple-size mode, the printer prints the same size characters as when double-width and
double-height modes are both turned on.
When quadruple-size mode is turned off using this command, the following characters are
printed in normal size.
When some of the characters on a line are different in height, all the characters on the line are
aligned at the baseline.
FS ! or GS ! can also select and cancel quadruple-size mode by selecting double-height and
double-width modes, and the setting of the last received command is effective.
[Default] n=0
[Reference] FS !, GS !
[Format] ASCII GS ( F pL pH a m nL nH
RECEIPT PRINTER
41
Hex 1D 28 46 pL pH a m nL nH
Decimal 29 40 70 pL pH a m nL nH
[Description] All function data specified by this commands will not be lost when the printer is power
down.
Using this command to select black mark position control allowable, and set cutting/tearing position
or print starting position relative to black mark detection offset.
pL+(pH×256) ≡4 means pL=4,pH=0
a=1 ,2;m=0,48
0≤(nL+ nH×256)<1700
Select to set cutting/tearing position or print starting position offset using a as follows:
a Function
1 Set print starting position relative to black mark detection offset.
2 Set cutting/tearing position relative to black mark detection offset.
m=0 or 48, offset direction is same as feed paper direction.
The offset specified by nL, nH corresponds to the actual distance for (nL+ nH×256)×
0.125mm.
Black mark position set using GS FF and GS V is effective only when executing this command.
To set print starting position offset (a=1) is effective when executing GS FF.
To set cutting/tearing position offset (a=2) is effective when executing GS V m.
Default nL=nH=0, it means, when the black mark detected, print-head position corresponds to
the current paper is set to the print starting position, cutting/tearing position corresponds to the
current paper is set to cutting/tearing position.
[Details]
If both of cutting/tearing position offset and print starting position offset are 0, in this case, using
GS V m to execute position print for each receipt.
If cutting/tearing position offset is not 0, in this case, using GS( F to set cutting/tearing position
offset for (a=2), and print starting position for (a=1).
Feed paper to print start position using GS FF only when set the starting print position,
otherwise inaccurate positioning occurs or feed blank paper occurs.
If updated the last offset data using GS( F, the first printed paper might occur inaccurate
positioning or feed blank paper, but it will be in normal for the subsequent printed paper.
RECEIPT PRINTER
42
Auto cutter related commands
[Format] ①ASCII GS V m
Hex 1D 56 m
Decimal 29 86 m
②ASCII GS V m n
Hex 1D 56 m n
Decimal 29 86 m n
[Range] 0 ≤ n ≤ 255
[Description] Selects a mode for cutting paper and executes paper cutting. The value of m selects
the mode as follows:
M Cutting mode
1, 49 Partial cut
65,66 Feeds paper ([n×(vertical motion unit) inches] ) and cuts the paper partially.
This command is effective only processed at the beginning of a line.
When m = 0,48,1,49, the printer cuts the paper directly.
When m = 65,66, the printer feeds the paper (the distance from printing position to cutter+ [ n
×vertical motion unit]) and then cuts it.
The paper feed amount is calculated using the vertical motion unit (y).
63、ESC C Beeps the buzzer and flashes Error indicator when orders coming
RECEIPT PRINTER
43
When n=0, no beeps, and no flashes.
When n=1, beeps
When n=2, flashes.
When n=3, beeps and flashes.
RECEIPT PRINTER
44
0,1 OFF 00 0 Paper near end no detection
ON 03 3 Paper near end.
OFF 00 0 Paper adequate.
2,3
ON 0C 12 Paper end.
4 OFF 00 0 Not used. Fixed to Off.
5,6 - - - Undefined.
7 OFF 00 0 Not used. Fixed to Off.
The fourth byte(Paper sensor status)
Bit OFF/ON Hex Decimal ASB Status
0-3 - - - Undefined.
4 OFF 00 0 Not used. Fixed to Off.
5,6 - - - Undefined.
7 OFF 00 0 Not used. Fixed to Off.
QR code commands
RECEIPT PRINTER
45
48≤n≤51
[Default] n=48
[Description] Select the error correction level for QR Code.
n Function Recovery Capacity %(approx.)
48 Selects Error correction level L 7
49 Selects Error correction level M 15
50 Selects Error correction level Q 25
51 Selects Error correction level H 30
[Details] Settings of this function are effective until ESC @ is executed, or the power is turned off,
the printer will be reset.
[Name] QR Code: Print the symbol data in the symbol storage area
[Format] ASCII GS ( K pL pH cn fn m
Hex 1D 28 6B 03 00 31 51 30
Decimal 29 40 107 3 0 49 81 48
[Range] (pL+pH×256)=3 (pL=3,pH=0)
cn=49
fn=81
m=48
[Description] Encodes and prints the QR Code symbol data in the symbol storage area using the
process of (K< Function 180).
[Example]
Prints QRcode for “Gprinter”.
1. Set the size of module to 5 (default 3) according to(K< Function 167).
RECEIPT PRINTER
46
Transmit: 0x1d 0x28 0x6b 0x03 0x00 0x31 0x43 0x05,
2. Stores “Gprinter” QR Code symbol data in the symbol storage area according to(K< Function
180)
Transmit: 0x1d 0x28 0x6b 0x0b 0x00 0x31 0x50 0x30 0x47 0x70 0x72 0x69
0x6e 0x74 0x65 0x72 (ASCII Hex data corresponds to “Gprinter”)
3. Print QRCode
Transmit: 0x1d 0x28 0x6b 0x03 0x00 0x31 0x51 0x30
RECEIPT PRINTER
47
X.2 Code Tables
Printable characters in code set A
Chara Transmit Data Char Transmit Data Char Transmit Data
cter Hex Decimal acter Hex Decimal acter Hex Decimal
NULL 00 0 ( 28 40 P 50 80
SOH 01 1 ) 29 41 Q 51 81
STX 02 2 * 2A 42 R 52 82
ETX 03 3 + 2B 43 S 53 83
EOT 04 4 , 2C 44 T 54 84
ENQ 05 5 - 2D 45 U 55 85
ACK 06 6 . 2E 46 V 56 86
BEL 07 7 / 2F 47 W 57 87
BS 08 8 0 30 48 X 58 88
HT 09 9 1 31 49 Y 59 89
LF 0A 10 2 32 50 Z 5A 90
VT 0B 11 3 33 51 [ 5B 91
FF 0C 12 4 34 52 \ 5C 92
CR 0D 13 5 35 53 ] 5D 93
SO 0E 14 6 36 54 ^ 5E 94
SI 0F 15 7 37 55 _ 5F 95
DLE 10 16 8 38 56 FNC 7B,31 123,49
DC1 11 17 9 39 57 1 7B,32 123,50
DC2 12 18 : 3A 58 FNC 7B,33 123,51
DC3 13 19 ; 3B 59 2 7B,34 123,52
DC4 14 20 < 3C 60 FNC 7B,53 123,83
NAK 15 21 = 3D 61 3 7B,42 123,66
SYN 16 22 > 3E 62 FNC 7B,43 123,67
ETB 17 23 ? 3F 63 4
CAN 18 24 @ 40 64 SHIF
EM 19 25 A 41 65 T
SUB 1A 26 B 42 66 COD
ESC 1B 27 C 43 67 EB
FS 1C 28 D 44 68 COD
GS 1D 29 E 45 69 EC
RS 1E 30 F 46 70
US 1F 31 G 47 71
SP 20 32 H 48 72
! 21 33 I 49 73
" 22 34 J 4A 74
* 23 35 K 4B 75
$ 24 36 L 4C 76
% 25 37 M 4D 77
& 26 38 N 4E 78
27 39 O 4F 79
RECEIPT PRINTER
48
Printable characters in code set B
Char Transmit Data Char Transmit Data Char Transmit Data
acter Hex Decimal acter Hex Decimal acter Hex Decimal
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
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
RECEIPT PRINTER
49
Printable characters in code set C
Char Transmit Data Chara Transmit Data Char Transmit Data
acter Hex Decimal cter Hex Decimal acter Hex Decimal
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
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
RECEIPT PRINTER
50