HPRT MPT8 Owner's manual

MPT8
Programming Manual

CONTENTS
1. Overview.....................................................................................................................................................................1
1.1 Key Terms.........................................................................................................................................................1
1.2Command Notation.......................................................................................................................................... 1
2. Commands.................................................................................................................................................................. 2
HT........................................................................................................................................................................... 2
LF............................................................................................................................................................................ 2
FF............................................................................................................................................................................ 2
ESC SP n.................................................................................................................................................................2
ESC ! n....................................................................................................................................................................3
ESC $ nL nH...........................................................................................................................................................3
ESC * m nL nH d1... Dk...................................................................................................................................4
ESC - n....................................................................................................................................................................5
ESC 2...................................................................................................................................................................... 6
ESC 3 n................................................................................................................................................................... 6
ESC @.....................................................................................................................................................................6
ESC D n1...nk NUL................................................................................................................................................6
ESC E n...................................................................................................................................................................7
ESC G n.................................................................................................................................................................. 7
ESC J n....................................................................................................................................................................8
ESC M n..................................................................................................................................................................8
ESC R n...................................................................................................................................................................8
ESC S...................................................................................................................................................................... 9
ESC V n.................................................................................................................................................................. 9
ESC \ nL nH............................................................................................................................................................9
ESC a n................................................................................................................................................................... 9
ESC d n................................................................................................................................................................. 10
ESC t n.................................................................................................................................................................. 10
ESC v.................................................................................................................................................................... 11
ESC { n................................................................................................................................................................. 11
FS p n m................................................................................................................................................................ 12
FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n...................................................................................13
GS ! n.................................................................................................................................................................... 14
GS ( A pL pH n m.................................................................................................................................................15
GS * x y d1...d(x × y × 8).....................................................................................................................................16
GS / m................................................................................................................................................................... 16
GS B n...................................................................................................................................................................17
GS H n...................................................................................................................................................................17
GS L nL nH...........................................................................................................................................................18
GS W nL nH......................................................................................................................................................... 18
GS f n.................................................................................................................................................................... 18
GS h n................................................................................................................................................................... 19
①GS k m d1...dk NUL②GS k m n d1...dn......................................................................................................... 19
GS r n.................................................................................................................................................................... 21
GS v 0 m xL xH yL yH d1....dk........................................................................................................................... 22
GS w n.................................................................................................................................................................. 23
3.Command User Guide............................................................................................................................................ 24
3.1 Command User Guide Instructions................................................................................................................ 24
3.2 Command Application Introduction...............................................................................................................24
3.2.1 Initialize set..........................................................................................................................................24
3.2.2 Print set and print contents(Character/Barcode/Bitmap).................................................................... 24
3.2.3 Character property set..........................................................................................................................25

3.2.4 Print......................................................................................................................................................26
3.2.5 State query........................................................................................................................................... 26
3.2.6 Bitmap download.................................................................................................................................26
3.2.7 Recommended program application process............................................................................29
APPENDIX A:CODE128 BAR CODE....................................................................................................................... 30
A.1 Description of the CODE128 Bar Code........................................................................................................ 30
A.2 Code Tables................................................................................................................................................... 30
APPENDIX B:Print mode and its transformation........................................................................................................33
B.1 General Description....................................................................................................................................... 33
B.2 Setting Values in Standard and Page Modes................................................................................................. 33
B.3Formatting of Print Data in the Printable Area...............................................................................................33

1
1. Overview
1.1 Key Terms
1.2Command Notation
Real-time commands:
These commands are acted on immediately upon being received by the printer.
Page mode:
Under this mode, the printer stores all data in storage and thinks it as a virtual
page.The printer doesn’t print the page until it receives commands FF or ESC FF.
Standard mode:
Standard mode is the default mode of printer,namely line mode.Under this mode,the
printer prints data and feeds paper when printer line buffer is full,namely data is
enough for one print line or it receives command like LF.
HRI character:
Bar code comment character.HRI:Human Readable Interface.
NV storage0:
Non-volatile storage which feature is stored data does not loss when the power is
turned off..
RAM:
Random Access Memory.
ASB:Auto Send Back.
DPI:
Print dots per inch (one inch equals to 25.4mm).It is used to identify the resolution of
the printer.For example,203DPI means it can print 203 dots per inch.
DPI:Dot Per Inch
[Name]
The name of the command.
[Format]
The format of the command,such as ASCII,Hexadacimal,Decimalism,etc.
[Range]
It gives the range of parameter which is used in commands.
[Default]
It gives the default values.
[Description]
It describes the function of the command.
[Notes]
It provides important information on setting and using the printer command.
[Reference]
It gives the explanation of other related commands.

2
2. Commands
HT
LF
[Name]
Print and move to next line.
[Format]
ASCII
LF
Hex
0A
Decimal
10
[Description]
Prints the data in the print buffer and feeds one line.
[Notes]
This command sets the print position to the beginning of the line.
When this command is processed in page mode, only the print position moves,and
the printer does not perform actual printing.
[Reference]
ESC 2, ESC 3
FF
[Name]
Printer feed paper
[Format]
ASCII
FF
Hex OC
Decimal
12
[Description]
If the type of paper is continuous paper,feed paper in 20mm.
If the type of paper is A4,paper is out of printer.
[Notes]
This command is mainly used in the end of printing to separate the papers.
ESC SP n
[Name]
Set the right spacing of character.
[Format]
ASCII
ESC SP n
Hex
1B 20 n
Decimal
1B 20 n
[Range] 0≤n≤255
[Default]
n = 0
[Description]
Set the right spacing of character as [n×0.125mm(n×0.0049 inch)].
[Name]
Horizontal tab
[Format]
ASCII
HT
Hex
09
Decimal
9
[Description]
Moves the print position to the next horizontal tab position.
[Notes] 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].
Horizontal tab positions are set with 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.
Set Horizontal tab default to 8 character width of character ASCII (12×24).
When the print buffer is full,the printer performs the following actions:
In standard mode,the printer prints the current line and sets the print position to
the beginning of the line.
In page mode, the printer sets the print position to the beginning of the line.
[Reference]
ESC D

3
[Notes]
When characters are enlarged, the character spacing is n times normal value.
This command sets values independently in each mode (standard and page
modes).
ESC ! n
[Name] Select print mode(s).
[Format]
ASCII
ESC ! n
Hex
1B 21 n
Decimal
27 33 n
[Range] 0 ≤ n ≤ 255
[Description] Select print mode(s) using n as follows:
[Notes]
When both double-height and double-width modes are selected,characters will
magnify two times in horizontal and vertical.
The printer can underline all characters,except the space set by HT,90clockwise
rotated characters and HRI characters..
All characters align at bottom.
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.
[Default] n = 0
[Reference]
ESC -, ESC E, GS !
ESC $ nL nH
[Name]
Set horizontal absolute print position.
[Format]
ASCII
ESC $ nL nH
Hex
1B 24 nL nH
Decimal
27 36 nL nH
[Range]
0≤ nL ≤ 255
0≤ nH ≤255
[Description]
The distance from the beginning of the line to the printting position is
[(nL + nH ×256) ×0.125 mm].
[Notes]
This command is ignored when the setting position is outside of prnting area.
ESC W can set horizontal starting position in page modes. However, the setting of
the last received command is effective.
Bit
1/0
HEX
Decimal
Function
0
0
00
0
Character font 0 selected.
1
01
1
Character font 1 selected.
1,2
Undefined.
3
0
00
0
Emphasized mode not selected.
1
08
8
Emphasized mode selected.
4
0
00
0
Double-height mode not selected.
1
10
16
Double-height mode selected.
5
0
00
0
Double-width mode not selected.
1
20
32
Double-width mode selected.
6
Undefined.
7
0
00
0
Underline mode not selected.
1
80
128
Underline mode selected.

4
[Reference]
ESC \, GS $, GS \
ESC * m nL nH d1... Dk
[Name]
Select bit-image mode
[Format] ASCII ESC * m nL nH d1...dk
Hex
1B 2A m nL nH d1...dk
Decimal
27 42 m nL nH d1...dk
[Range]
m = 0, 1, 32, 33
0 ≤ nL ≤ 255
0 ≤ nH ≤ 3
0 ≤ d ≤255
[Description] Select a bit-image mode using m, bit-image dot is decided by nL and nH.
mMode Vertical Direction Horizontal Direction
Number of
Bits for
vertical data
Dot
Density
(DPI)
Amount of
Data(k)
Number of
Bits for
vertical data
0
8-dot single-density
8 67 101
nL + nH ×256
1
8-dot double-density
8 67 203
nL + nH ×256
32
24-dot single-density
24 203 101
( nL + nH ×256) ×3
33
24-dot double-density
24 203 203
( nL + nH ×256) ×3
[Note]
If the value of m out of the specified range, nL and the subsequent data will be
processed as normal one.
The number of horizontal direction is up to nL and nH, the total number is nL + nH ×
256.
The part which bit-image is beyond the current area will be amputated.
d indicates the bit image data. Set a bit to 1 to print a dot, or set a bit to 0 to not
print a dot.
After the bit-image is sent successfully, the printer will be back to the normal data
processing mode.
If the width printing area set by GSL and GSW lee than the printing width of GS /
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):
①The width of the printing area is extended to the right to accommodate the
amount of data.
②If step ¬ does not provide sufficient width for the data, the left margin is reduced
to accommodate the data. For each bit of data in single-density mode (m = 0, 32),
the printer prints two dots: for each bit of data in double-density mode (m = 1, 33),
the printer prints one dot. This must be considered in calculating the amount of
data that can be printed in one line.
It back to the normal data processing mode after printing a bit-image.
This command won't be influenced by other print modes (emphasized /double-strike
/underline /characters amplification /white / black reverse), except upside-down
printing mode.
the relationship between data and the point to be print as follows:

5
Choosing 8-dot density:
Choosing 24-dot density:
:
ESC - n
[Name]
Turn underline mode on /off
[Format]
ASCII
Hex
Decimal
[Range]
0≤ n ≤ 2
48 ≤ n ≤ 50
[Description]
turn underline mode on/off, nvalue as follows:
n Function
0, 48 underline mode is turn off
1, 49 underline mode ( one dot width) is turn on
2, 50 underline mode ( two dot width) is turn on
[Note]
This command is effective for all characters (including the blank space), but not the

6
blank space set by HT.
When underline mode is on, 90°clock wise rotated characters and characters and
white / black reverse characters cannot be underline.
When underline mode is off, there is no underline for following characters.
Underline width stays the same, default width: one dot width.
Character size change has no effects on underline width.
Turn underline mode on / off can be set by ESC !, the command executed at last is
effective.
[Default]
n = 0
[Reference]
ESC !
ESC 2
[Name]
Set the default line spacing
[Format]
ASCII
ESC 2
Hex
1B 32
Decimal
27 50
[Description] Selects 3.875 mm (31 ×0.125 mm) line spacing.
[Notes]
The line spacing can be set independently in standard mode and in page mode.
[Reference]
ESC 3
ESC 3 n
[Name]
Set line spacing.
[Format]
ASCII
ESC 3 n
Hex
18 33 n
Decimal
27 51 n
[Description]
Sets the line spacing to [n ×0.125 mm].
[Notes]
The line spacing can be set independently in standard mode and in page mode.
[Reference]
n =30
[Default]
ESC 2
ESC @
ESC D n1...nk NUL
[Name]
Set horizontal tab positions.
[Format] ASCII
ESC D n1...nk NUL
Hex
1B 44 n1…nk 00
Decimal
27 68 n1…nk 0
[Range]
1 ≤ n ≤ 255
0 ≤ k ≤ 32
[Description]
Set horizontal tab positions.
[Name]
Initialize printer.
[Format]
ASCII
ASCII ESC @
Hex
Hex 1B 40
Decimal
Decimal 27 64
[Description]
Clears the data in the print buffer and resets the printer mode to the mode that was
in effect when the power was turned on.
[Notes] The bit image has been downloaded and custom characters in RAM is not cleared.
When the printer default is label paper, the print mode is page mode after power-
on.
When the printer default is continuous paper, the print mode is standard mode after
power-on.
The macro definition is not cleared

7
n specifies the column number for setting a horizontal tab position from the
beginning of the line.
k indicates the total number of horizontal tab positions to be set.
[Notes]
The horizontal tab position is stored as a value of [character width ×n]
measured from the beginning of the line. The character width includes the
right-side character spacing, and double-width characters are set with twice the
width of normal characters.
This command cancels the previous horizontal tab settings.
When setting n = 8, the print position is moved to column 9 by sending HT.
Up to 32 tab positions (k = 32) can be set. Data exceeding 32 tab positions is
processed as normal data.
Transmit [n]k in ascending order and place a NUL code 0 at the end.
When [n]k is less than or equal to the preceding value [n]k-1, tab setting is
finished and the following data is processed as normal data.
ESC D NUL cancels all horizontal tab positions.
The previously specified horizontal tab positions do not change, even if the
character width changes.
The character width is memorized for each standard and page mode.
[Default]
The default tab positions are at intervals of 8 characters (columns 9, 17, 25,...) for
Font A (12 ×24).
[Reference]
HT
ESC E n
[Name]
Turn emphasized mode on/off.
[Format]
ASCII
ESC E n
Hex
1B 45 n
Decimal
27 69 n
[Range]
0 ≤ n ≤ 255
[Description]
Turns emphasized mode on or off
When the LSB of n is 0, emphasized mode is turned off.
When the LSB of n is 1, emphasized mode is turned on.
[Notes]
Only the least significant bit of n is enabled.
This command and ESC ! turn on and off emphasized mode in the same way.
Be careful when this command is used with ESC !.
[Default]
n = 0
[Reference]
ESC !
ESC G n
[Name]
Turn on/off double-strike mode.
[Format]
ASCII
ESC G n
Hex
1B 47 n
Decimal
27 71 n
[Range]
0 ≤ n ≤ 255
[Description]
Turns double-strike mode on or off.
When the LSB of n is 0, double-strike mode is turned off.
When the LSB of n is 1, double-strike mode is turned on.
[Notes]
Only the lowest bit of n is enabled.
Printer output is the same in double-strike mode and in emphasized mode.
[Default]
n = 0
[Reference]
ESC E

8
ESC J n
ESC M n
[Name] Select character font..
[Format]
ASCII
ESC M n
Hex
1B 4D n
Decimal
27 77 n
[Range]
0 ≤ n ≤ 9, 48≤ n ≤ 57
[Description]
Select character font.
n Function
0 Character Font ASCII 0 (12 × 24) selected
1 Character Font ASCII 1 (8 × 16) selected
16,18 Chinese Character Font (12 × 24) selected
17,19 Chinese Character Font (16 × 16) selected
[Notes] ESC ! can also select character font types. However the setting of the last
received command is effective.
This command is invalid if the font is not in the font library.
[Reference]
ESC !
ESC R n
[Name] Select an international character set
[Format] ASCII ESC R n
Hex 1B 52 n
Decimal 27 82 n
[Range] 0≤n≤13
[Description] Selects international character set n from the following table:
n
Character set
0 U
.
S
.A.
1 France
2 Germany
3 U
.K.
4 Denmark I
5 Sweden
6
It
aly
7 Spain I
8 Japan
9 Norway
10 Denmark II
11 Spain II
12 Latin America
13 Korea
[Notes] Only Font 0 and Font a have international character set.This command is invalid in
other font.
[Default] n = 0
[Name]
Print and feed paper.
[Format]
ASCII
ESC J n
Hex
1B 4A n
Decimal
27 74 n
[Range]
0 ≤ n ≤ 255
[Description]
Prints the data in the print buffer and feeds the paper [n × 0.125 mm (0.0049”)].
[Notes] After printing is completed, this command sets the print starting position to the
beginning of the line.
The paper feed amount set by this command does not affect the values set by
ESC 2 or ESC 3.

9
ESC S
[Name]
Select standard mode.
[Format]
ASCII
ESC S
Hex
1B 53
Decimal
27 83
[Description]
Switches from page mode to standard mode.
[Notes]
This command is effective only in page mode.
Data buffered in page mode is cleared.
This command sets the print position to the beginning of the line.
The area of page mode is intialized as default value.
This command switches the settings for the following commands (in which the
values can be set independently in standard mode and page mode) to those for
standard mode:
①Set right-side character spacing: ESC SP
②Select default line spacing: ESC 2, ESC 3
[Reference]
FF, ESC FF, ESC L
ESC V n
[Name] Turn 90°clockwise rotation mode on/off.
[Format]
ASCII
ESC V n
Hex
1B 56 n
Decimal
27 86 n
[Range]
0 ≤ n ≤3
[Description]
n=0
Doesn’t rotate
n=1
Rotate 90 degrees
n=2
Rotate 180 degrees
n=3
Rotate 270 degrees
[Notes]
It only support n=0,1
This command is valid only in standard mode.
In underline mode,underline can’t rotate 90 degrees clockwise.
In clockwise rotation 90 degrees mode,the direction of double-height and double-width is
opposite of the normal mode.
[Default]
n = 0
[Reference] ESC !,ESC
ESC \ nL nH
[Name]
Set relative horizontal print position.
[Format]
ASCII
ESC \ nL nH
Hex
1B 5C nL nH
Decimal
27 92 nL nH
[Range]
0 ≤ nl ≤ 255
0 ≤ nH ≤ 255
[Description]
Sets the relative horizontal print starting position from the current position.
This command sets the distance from the current position to [(nL + nH ×256)×
0.125 mm].
[Notes]
The printer ignores any setting that exceeds the print area.
When pitch N is specified for the movement to the right:nL+ nH × 256 = N。
Use the complement of N for setting N pitch movement to the left: (nL + nH × 256)
=
65536 – N.
Print starting position from the current position to [N × 0.125mm].
[Reference] ESC $
ESC a n
[Name]
Select justification
[Format]
ASCII
ESC a n

10
Hex
1B 61 n
Decimal
27 97 n
[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 Centering
2,50 Right justification
[Notes]
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 justifies the space area according to HT, ESC $ or ESC \.
[Default]
n = 0
[Example]
ESC d n
[Name]
Print and feed n lines
[Format]
ASCII
ESC d n
Hex
1B 64 n
Decimal
27 100 n
[Range]
0 ≤n ≤ 255
[Description]
Prints the data in the print buffer and feeds n lines.
[Notes]
This command sets the print starting position to the beginning of the line.
This command does not affect the line spacing set by ESC 2 or ESC 3.
The maximum paper feed amount is 900 mm. If the paper feed amount (n line
spacing) of more than 900 mm is specified, the printer feeds the paper only 900
mm .
[Reference]
ESC 2,ESC 3
ESC t n
[Name]
Select character code table
[Format] ASCII
ESC t n
Hex
B 74 n
Decimal
27 116 n
[Range]
0≤n≤5; 13≤n≤21;n=26; 32≤n≤34;n=36,37; 39≤n≤40; 45≤n≤52 ;54≤n≤66
[Description]
Selects page n from the character code table.
n Character Code table n Character Code table
0 [PC437 (USA: Standard Europe)] 40 [ISO8859-15 (Latin9)]
1 [Katakana] 45 [WPC1250]
2 [PC850 (Multilingual)] 46 [WPC1251(Cyrillic)]
3 [PC860 (Portuguese)] 47 [WPC1253]

11
4 [PC863 (Canadian-French)] 48 [WPC1254]
5 [PC865 (Nordic)] 49 [WPC1255]
13 [PC857 (Turkish)] 50 [WPC1256]
14 [PC737 (Greek)] 51 [WPC1257]
15 [ISO8859-7 (Greek)] 52 [WPC1258]
16 [WPC1252] 54 [MIK(Cyrillic /Bulgarian)]
17 [PC866 (Cyrillic #2)] 55 [CP755 (East Europe,Latvian 2)]
18 [PC852 (Latin 2)] 56 [Iran]
19 [PC858 (Euro)] 57 [Iran II]
20 [KU42] 58 [Latvian]
21 [TIS11 (Thai)] 59 [ISO-8859-1 (West Europe)]
26 [TIS18 (Thai)] 60 [ISO-8859-3(Latin 3)]
32 [PC720] 61 [ISO-8859-4(Baltic)]
33 [WPC775] 62 [ISO-8859-5(Cyrillic)]
34 [PC855 (Cyrillic)] 63 [ISO-8859-6(Arabic)]
36 [PC862 (Hebrew)] 64 [ISO-8859-8(Hebrew)]
37 [PC864 (Arabic)] 65 [ISO-8859-9(Turkish)]
39 [ISO8859-2 (Latin2)] 66 [PC856]
ESC v
[Name]
Transmit printer status.
[Format]
ASCII
ESC v
Hex
1B 76
Decimal
27 118
[Description]
This command is only effective with a serial interface printer to transmit printer
status to host machine.
When the printer receive command, transfer a byte to the hardware.
Defined as follows:
Bit 0/1 HEX Decimal Function
00 00 0
Normal
1 01 1
Paper near end
1,6 0 00 0
Print head pressure
1 42 66
Print head uplift
20 00 0
Paper exit
1 04 4
Paper end
30 00 0
Normal
1 08 8
Cutter error
4 0 00 0
Fixed to off
50 00 0
Normal
1 20 32
Thermal head over
7 --- --- ---
Undefined
[Notes]
This command is only effective with a serial interface mode.
ESC { n
[Name]
Turn upside-down printing mode on/off.
[Format]
ASCII
ESC { n
Hex
1B 7B n
Decimal
27 123 n
[Range]
0 ≤ n ≤ 255
[Description]
Turns upside-down printing mode on or off.
When the LSB of n is 0, upside-down printing mode is turned off.
When the LSB of n is 1, upside-down printing mode is turned on.
[Notes]
Only the lowest bit of n is valid.
This command is enabled only when processed at the beginning of a line in
standard mode.

12
When this command is input in page mode, the printer performs only internal
flag operations.
This command does not affect printing in page mode.
In upside-down printing mode, the printer rotates the line to be printed by 180°
and then prints it.
[Default]
n = 0
[Example]
FS p n m
[Name]
Print NV bit image.
[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.
m Mode Vertical Dot Density HorizontalDot Density
0,48 Normal 203.2 dpi 203.2 dpi
1,49 Double-width 203.2 dpi 101.6 dpi
2,50 Double-height 101.6 dpi 203.2 dpi
3,51 Quadruple 101.6 dpi 101.6 dpi
n is the number of the NV bit image (defined using the FS q command).
m specifies the bit image mode.
[Detail]
NV bit image is a bit image defined in 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,
underline, character size, white/black reverse printing, or 90°rotated characters,
etc.), except upside-down printing mode.
If the downloaded bit-image to be printed exceeds one line, the excess data is
not printed.
If the printing area width set by GS L and GS W for the NV bit image is less than
one vertical line, the following processing is performed only on the line in
question. However, in NV bit image mode, one vertical line means 1 dot in
normal mode (m=0, 48) and in double-height mode (m=2, 50), and it means 2
dots in double-width mode (m=1, 49) and in quadruple mode (m=3, 51).
①The printing area width is extended to the right in NV bit image mode up to
one line vertically. In this case, printing does not exceed the printable area.
②If the printing area width cannot be extended by one line vertically, the left
margin is reduced to accommodate one line vertically.
This command feeds dots (for the height n of the NV bit image) in normal and
double-width modes, and (for the height n ×2 of the NV bit image) in double-
height and quadruple modes, regardless of the line spacing specified by ESC 2
or ESC 3.

13
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
FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n
[Name] Define NV bit image.
[Format]
ASCII
FS q n [xL xH yL yH d1...dk]1...[ xL xH yL yH d1...dk]n
Hex
1C 71 n [xL xH yL yH d1...dk]1...[ xL xH yL yH d1...dk]n
Decimal
28 113 n [xL xH yL yH d1...dk]1...[ xL xH yL yH d1...dk]n
[Range]
1 ≤ ( xL + xH × 256) ≤ 1023
1 ≤ ( yL + yH × 256) ≤ 800
0 ≤ d ≤ 255
k = ( xL + xH × 256) × ( yL + yH × 256) × 8
Total defined data area = 64K bytes.
[Description] Define the NV bit image specified by n
[Notes]
Frequent write command executions may damage the NV memory.Therefore, it is
recommended to write the NV memory 10 times or less a day.
This command cancels all NV bit images that have already been defined by this
command. The printer cannot redefine only one of several data definitions
previously defined. In this case, all data needs to be sent again.
During processing of this command, the printer is BUSY when writing data to the
user NV memory and stops receiving data. Therefore it is prohibited to transmit
the data, including real-time commands, during the execution of this command.
NV bit image is a bit image defined in non-volatile memory by FS q and printed by
FS p.
In standard mode, this command is effective only when processed at the
beginning of the line.
This command is effective when 7 bytes <FS yH> of the command are processed
normally.
When the amount of data exceeds the capacity left in the range defined by xL,
xH,yL, yH, the printer processes xL, xH, yL, yH out of the defined range.
In the first group of NV bit images, when any of the parameters xL, xH, yL, yH is
out of the definition range, this command is disabled.
In groups of NV bit images other than the first one, when the printer encounters
xL,xH, yL, yH out of the defined range, it stops processing this command and
starts writing into the NV images. At this time, NV bit images that haven’t been
defined are disabled (undefined), but any NV bit images before that are enabled.
The d indicates the definition data. In data (d) a 1 bit specifies a dot to be printed
and a 0 bit specifies a dot not to be printed.
This command defines n as the number of a NV bit image. Numbers rise in order
from NV bit image 01H. Therefore, the first data group [xL xH yL yH d1...dk] is NV
bit image 01H, and the last data group [xL xH yL yH d1...dk] is NV bit image
n.The total agrees with the number of NV bit images specified by the command
FS p.
The definition data for an NV bit image consists of [xL xH yL yH d1...dk].
Therefore, when only one 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 bytes. This command can
define several NV bit images, but cannot define bit image data whose total
The printer is busy immediately before writing into NV memory.
The printer does not transmit ASB status or perform status detection during
processing of this command even when ASB is specified.
When this command is received during macro definition, the printer ends macro
definition, and begins performing this command.
Once an NV bit image is defined, it is not erased by performing ESC @, reset,
and power off.
This command performs only definition of an NV bit image and does not perform

14
printing. Printing of the NV bit image is performed by the FS p command.
NV bit image of each piece of space in NV memory is equal to the size of the NV
bit image data plus 4 bytes.
[Reference] FS p
[Example] When xL = 64, xH = 0, yL = 96, yH = 0
GS ! n
[Name]
Select character size.
[Format]
ASCII GS ! n
Hex 1D 21 n
Decimal 29 33 n
[Range]
0≤n≤255
(1 ≤vertical number of times ≤2, 1 ≤horizontal number of times ≤2 )
[Description]
Selects the character height using bits 0 to 2 and selects the character width using
bits 4 to 7, as follows:
Bit Off/On Hex Decimal Function
0~3 Character height selection. See Table 2.
4~7 Character width selection. See Table 1.
[Width magnification] [Height magnification]
Hex Decimal Enlargement Hex Decimal Enlargement
00 0 1(standard) 00 0 1(standard)

15
10 16 2 01 1 2
[Notes]
This command is effective for all characters (alphanumeric and Chinses),except
for HRI characters .
If n is 0 to 3 beyond the specified range, the horizontal magnification is set to 6
times.
If n is 4 to 7 beyond the specified range, the horizontal magnification is set to 6
times.
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.
The 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 !
GS ( A pL pH n m
[Name]
Execute test print
[Format]
ASCII
GS
(
A
pL pH n m
Hex 1D 28 41 pL pH n m
Decimal
29
40
65
pL pH n m
[Range]
( pL+( pH × 256))=2 (pL=2, pH=0)
0≤n≤2,48 ≤n≤50
1≤m≤5,49 ≤m≤53
[Description]
Execute test printing,the way of printing depends on n,m.
n specifies the paper used for the test print.
n Paper source
0,48 Basic sheet(roll paper)
1,49
2,50
Roll paper
m specifies a test pattern.
m Test pattern
1,49 Hexadecimal dump print
2,50 Printer status print
3,51 Rolling pattern print
[Notes]
This command is effective at the beginning of the line in standard mode.
Receiving this command when defining macro, stop defining macro and
execute this command.
After the test print is finished, the printer resets itself automatically.Therefore, the
already-defined data before this command is executed, such as an user-defined
characters, downloaded bit image, and macro, becomes undefined,and the
receive buffer and print buffer are cleared, and each setting returns to the default
value.

16
GS * x y d1...d(x × y × 8)
[Name]
Define download bit image.
[Format]
ASCII
GS *x y d1...d(x ×y×8)
Hex
1D 2A x y d1...d(x ×y×8)
Decimal
29 42 x y d1...d(x ×y×8)
[Range]
1≤x≤255,1≤y≤48,0≤d≤255 ,x×y≤ 1023
[Description]
It defines a downloaded bit image using xand y.
xdots in the horizontal direction of bytes
ydots in the vertical direction of bytes
[Notes]
x× 8 dots in the horizontal direction and y× 8 dots in the vertical direction.
Once the value of x×ybeside the defined range, the command is ineffective.
d indicates the bit image data. Set a bit to 1 to print a dot, or set a bit to 0 to not
print a dot.
The downloaded bit image will be cleared if the power is turned off.
If the area of storing downloaded bit image in RAM has no room to store the
current downloaded bit image, the printer will clear the previously one to store the
latest downloaded bit image.
The relationship between printing data and downloading bit image as follows:
[Reference] GS /
GS / m
[Name]
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 downloaded bit image and using the mode specified by m.
M Mode Vertival direction Horizontal direction
0,48 Normal 203dpi 203dpi
1,49 Double-width 203dpi 101dpi
2,50 Double-height 101dpi 203dpi
3,51 Quadruple 101dpi 101dpi
[Notes]
This command is ignored if a downloaded 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 has no effect in the print modes (emphasized, double-strike,

17
underline, character size, or white/black reverse printing), except for upside-
down printing mode.
If the downloaded bit-image to be printed exceeds the printable area, the
excess data is not printed.
Refer to Figure 3.11.3 for the downloaded bit image development position in
page mode.
If the width of the printing area set by GS L and GS W is less than the width
required by the data sent with the GS / command; the following will be
performed on the line in question (but the printing cannot exceed the maximum
printable area)
①The width of the printing area is extended to the right to accommodate the
amount of data.
②If step À does not provide sufficient width for the data, the left margin is
reduced to accommodate the data.
For each bit of data in normal mode (m = 0,48) and double-height mode (m = 2,
50), the printer prints one dot: for each bit of data in double-width mode (m = 1,
49) and quadruple mode (m = 3, 15), the printer prints two dots.
[Reference]
GS *
GS B n
[Name]
Turn white/black reverse printing mode
[Format]
ASCII GS B n
Hex 1D 42 n
Decimal 29 66 n
[Range]
0≤n≤255
[Description]
Turns on or off white/black reverse printing mode.
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.
[Notes]
Only the lowest bit of n is valid.
This command is available for built-in characters and user-defined characters.
When white/black reverse printing mode is on, it also applies to character
spacing set by ESC SP.
This command does not affect bit images, user-defined bit images, bar codes,
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.
[Default]
n = 0
GS H n
[Name]
Select printing position for HRI characters.
[Format]
ASCII GS H n
Hex 1D 48 n
Decimal 29 72 n
[Range]
0≤n≤3, 48 ≤n≤51
[Description]
Selects the printing position of HRI characters when printing a bar code.
n selects the printing position as follows
n Printing position
0,48 Not printed
1,49 Above the bar code
2,50 Below the bar code
Other manuals for MPT8
1
Table of contents
Other HPRT Printer manuals