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

N-OR7B Instruction Manual

This user manual provides detailed information on the thermal printer's specifications, assembly, interface definitions, and print commands. It includes sections on printing methods, character sets, and operational notices, along with command formats for various functions. The manual serves as a comprehensive guide for users to understand and operate the thermal printer effectively.

Uploaded by

Myint Zaw
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 views18 pages

N-OR7B Instruction Manual

This user manual provides detailed information on the thermal printer's specifications, assembly, interface definitions, and print commands. It includes sections on printing methods, character sets, and operational notices, along with command formats for various functions. The manual serves as a comprehensive guide for users to understand and operate the thermal printer effectively.

Uploaded by

Myint Zaw
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/ 18

User’s manual for thermal printer

CONTENTS

SECTION I ACCOUNT OF TYPE AND PARAMETER OF CAPABILITY ...... - 1 -


SECTION II ASSEMBLY AND APPLICATION OF INTERFACE ....................... - 2 -
SECTION III PRINT COMMANDS........................................................................... - 4 -
SECTION Ⅳ CHARACTER SETⅠ、Ⅱ .....................................................................17
SECTION Ⅵ COMMAND TABLE FOR QUICK CONSULTANT ..............................18

SECTION I Account of Type and Parameter of


Capability

Printing method: Thermal line dot printing


Paper width: 79.5±0.5mm
Printing density: 8dot/mm, 576dot/line
Printing speed: 70mm/s (when the utilization rate is 25%)
life-span of print head : 15×106 character line or 100km
Printing width: 72mm
Temperature for operating: 5~50℃
Humidity for operating: 10~80%
Temperature for storage: -20~60℃
Humidity for storage: 10~90%
Power: DC 24V, 4.2A MAX
INTERFACE: Parallel interface: IDE26 TTL
Serial interface: TTL, 232
CHARACTER: Character setⅠ、Ⅱ20H-A0H
DBC case character set 20H-7FH
GB Chinese character
16*16 dots matrix Chinese character enlarge 2 times by default
24*24 dots matrix Chinese character enlarge 1 times by default
http://www.whkj.com.cn -1-
User’s manual for thermal printer

SECTION II Assembly and application of


Interface
2-1 The definition of interface
2-1-2 The sequence chart of parallel port printer:
BU SY
/A CK

DA TA
/S TB 0. 5μS
0. 5μS

0. 5μS
0. 5μS
0. 5μS

2-1-2 The definition of parallel interface

The pin definition of parallel interface is shown as follow:


pin signal direction description
1 -STB In Data selecting burst purse . reading occurs at the rising edge.
3 DATA1 in
5 DATA2 in
7 DATA3 in
9 DATA4 in
These signals represent the 1~8 bit of the parallel data. Each signal is high level when
11 DATA5 in logic 1 and low level when logic 0.
13 DATA6 in
15 DATA7 in
17 DATA8 in
Answering pulse ,low signal indicates that data have already been received and is ready
19 -ACK out
for next data.
21 BUSY out High level indicates that the printer is busy now and can not receive more data.
23 PE out Printer state signal (refer to P16)
25 SEL out Pulling up to high level signal by resister inside, it indicates that the printer is online
4 -ERR out Pulling up to high level signal by resister inside, it indicates that the printer is online
2,6,8 NC
10-26(even) GND — grounding signal
Attention: (1)“in” indicates input to the printer, ”out” means output from the printer
(2)signal level is TTL standard

2-1-3 The definition of the serial interface


3 2 1

TTL
RS232

TTL:

http://www.whkj.com.cn -2-
User’s manual for thermal printer
pin signal direction description
1 TXD out transmit status messages out of printer
2 RXD in receiving data from the CPU
3 GND — grounding signal

RS232:
pin signal direction description
5 RXD In receiving data from the CPU
3 TXD out transmit status messages out of printer
2 BUSY out high level indicates the printer is busy and can’t receive data now . Low level is the opposite.
9 GND — grounding signal
Attention: (1)“in” indicates input to the printer,”out” means output from the printer
(2)signal level is EIA standard or TTL standard.

2-2 operation notice


There are two lights, red light and green light. When power on, the red light is always on. The
green light shows the state of printer. When paper is lacking, the light flash slowly. When the
printer head swtich is on,the light flash quickly.
There are two keys, LF key and SET key. The LF key is near the light, and the SET key is far away
from the light. After powered on, when press the LF key , The printer will feed paper .The SET key
Is not used.

●The ways to change the serial printer’s baud rate and communication mode:
Press SET Key and make printer power on at the same time . The printer will print out the state of
print state setting. And press the LF key.The printer will print out serial setting report. After that
we can chang the serial baud rate through the LF key and the communication mode though the
SET key.
Baud rate in serial mode is optional in the range of 1200\2400\4800\9600\19200bps.The original
setting is 9600bps and can be alternated by the LF key.
The printer has to be repowered after setting.
The original communication mode setting is mode 1,and can be alternated by the SET key.
Asynchronous frame format is shown as following:

1 bit 8 bit 1 bit 1 bit


start bit data bit none stop bit
start bit data bit parity stop bit

mode1: one frame is 10 bits, 1 start bit, 8 data bits and 1 stop bit.
Mode3: one frame is 11 bits, 1 start bit, 8 data bits, 1 party bit and 1 stop bit.

●The ways to change the serial printer orientation:


Press SET Key and make printer power on at the same time . The printer will print out the state of
setting. then press the SET key again, and then we can chang the print orientation. And then
http://www.whkj.com.cn -3-
User’s manual for thermal printer

please press SET key to set negative direction,and press LF key to set forward direction.
●The way to self-check:
Press the LF Key and repower at the same time, and then the printer will print out the self-check
scrip.

2-3parallel port or serial port setting


1. When use parallel port, the position of R&S should be placed a short circuit block
2. When use serial port, the position of R&S has no short circuit block.
TTL: use the interface of 3 pin, no resistance in RL1.
RS232: use the interface of 10 pin, and there is a resistance in RL1.

2-4 power supply connection


The power supply is DC 24V, 4.2A MAX, and it is shown as follows:

1 3
Indicates:
Faceplate style: pin 1 is positive pole(+), pin 2 is empty, pin 3 is negative pole (-)
Platform style: the column end is positive pole (+), the board end is negative pole (-)

SECTION III Print Commands


Part 1 Character Set and Paper Feeding Commands

3-1-1 select character font 1


Format: ASCII: ESC 6 n
Dec: 27 54 n
Hex: 1B 36 n
Explanation:
When n=0, it will print out according the character setⅠ, rang from 20H to A0H.
When n=1, it will print out according the character setⅡ, rang from 20H to A0H.
When n=2, it will print out according the DBC case character set, rang from 20H to 7FH.
When n=3, it will print out according the user-defined character set, rang from 20H to 7FH.
Default n=2.

3-1-2 Paper Feed in Line


Format: ASCII: LF
Dec: 10
Hex: 0A
Explanation:
Content in the buffer will be carried out after this command. The paper feeds in for a new line. The
length is the high of one character and the distance rows between.
http://www.whkj.com.cn -4-
User’s manual for thermal printer

3-1-3 n Dot Line Feed


Format: ASCII: ESC J n
Dec: 27 74 n
Hex: 1B 4A n
Explanation:
The printer feeds paper n dot lines. N=0~255. This command sends carriage return and feed line.
It won’t influence the latter feed line command.
Part 2 Format Setting Commands

3-2-1 Set n Dot-line Spacing


Format: ASCII: ESC 1 n
Dec: 27 49 n
Hex: 1B 31 n
Explanation:
The space between lines are n dots after this command (The dot number is unconditional and
can’t be affected by enlarging command.) 1≤n≤255. The original setting: n=3.

3-2-2 set the space between characters


Format: ASCII: ESC P n
Dec: 27 112 n
Hex: 1B 70 n
This command sets the space between characters n dots (The dot number is unconditional and
can’t be affected by enlarging command.) 1≤n≤255. The original setting: n=0.

3-2-3 print and paper backward in n line


Format: ASCII: ESC e n
Dec: 27 101 n
Hex: 1B 65 n
After this command, print buffer data and paper backward in n line.

3-2-4 Set Vertical Tab Value


Format: ASCII: ESC B n1 n2 n3…..NUL
Dec: 27 66 n1 n2 n3…..0
Hex: 1B 42 n1 n2 n3….00
Explanation:
The vertical tab positions are entered as n1, n2 and so on, The total number of position is 8, all of
these should be within the page length set by ESC C command.
For example, when n1 = 3, paper will feed in to the 3rd. unit line after “VT” command. The height of
unit line is the sun of 8 dots and characters between, and is unconditional. Command NUL added
at the end indicates the command is over.
All vertical tab positions that input can be deleted by using this command in ESC B NUL format.
VT command is to carry out vertical tab , the paper fed to the next vertical position.
http://www.whkj.com.cn -5-
User’s manual for thermal printer

3-2-5 Carry out Vertical Tab Value


Format: ASCII: VT
Dec: 11
Hex: 0B
Explanation:
Feed paper to the next vertical tab position which is set by ESC B command.
Notice: if there is no vertical tab value setting, or the current position equals or is beyond the last
vertical tab position, VT command is to feed paper one line only(same to LF command).

3-2-6 Set Horizontal Tab Value


Format: ASCII: ESC D n1 n2 n3….NUL
Dec: 27 68 n1 n2 n3….0
Hex: 1B 44 n1 n2 n3….00
Explanation:
The tab positions are entered as n1,n2 and so on, the total number of position is 8, and all of these
should be within the line width of this model printer.
For example, when n1 = 3, paper will feed in to the 3rd. unit line after “HT” command. The width of
each step is the sum of width of character matrix and dots characters between horizontal.
Command NUL added at the end indicates the command is over.
All horizontal tab positions that set can be deleted by using this command in ESC D NUL format.

3-2-7 Carry out Horizontal Tab Value


Format: ASCII: HT
Dec: 9
Hex: 09
Explanation:
The print position is advanced to the next horizontal tab position which is set by ESC D command.
If there is no horizontal tab value setting, or the current position equals or is beyond the last
horizontal tab position, HT command won’t be carried out.

3-2-8 Print Blank Character or Lines


Format: ASCII: ESC f m n
Dec: 27 102 m n
Hex: 1B 66 m n
Explanation:
When m = 0, ESC f NUL n will command to print n blank characters, the value of n should be
within the line width of this model printer. When m = 1, ESC f SOH n will command to print n blank
lines. n=0~255.

3-2-9 Set Right Margin


Format: ASCII: ESC Q n
Dec: 27 81 n

http://www.whkj.com.cn -6-
User’s manual for thermal printer

Hex: 1B 51 n
Explanation:
N value means n-characters blank space on the right side will be left. Each character space is the
sum of width of the character matrix and the horizontal space between. The value of n should be
in the range from 0 to the line width of this model printer.
Default n = 0, that means no right margin.

3-2-10 Set Left Margin


Format: ASCII: ESC 1 n
Dec: 27 108 n
Hex: 1B 6C n
Explanation:
N value means n-characters blank apace on the left side will be left. Each character space is the
sum of width of the character matrix and the horizontal space between. The command is relative
to the enlarging command.
Default n = 0, that means no left margin.

3-2-11 set the gray degree


Format: ASCII: ESC M n
Dec: 27 109 n
Hex: 1B 6D n
N ranges from 1 to 6 ,the larger of the n value is, the darker the dot it is . The initial n=0. It is used
to modify the final expression of different thermal paper roll.

Part 3 Character Setting Commands

3-3-1 Enlarge Width


Format: ASCⅡ: ESC 7 n
Dec: 27 55 n
Hex: 1B 37 n
Explanation:
After the commend ,The character would be enlarged in width .
When n=0, 1 times .
n=1, 1.5 times
n=2, 2 times
n=3, 3 times
n=4, 4 times
24*24 dots matrix printer default n=0,that means normal width, no width enlarging.
16*16 dots matrix printer default n=2,enlarge 2 times in width.

3-3-2 Enlarge Height


Format: ASCⅡ: ESC 8 n
Dec: 27 56 n
Hex: 1B 38 n
Explanation:
After the commend ,The character would be enlarged n times in height. n= 1~4,
http://www.whkj.com.cn -7-
User’s manual for thermal printer
24*24 dots matrix printer default n=0, that means normal height, no height enlarging.
16*16 dots matrix printer default n=2, enlarge 2 times in height.

3-3-3 Select/cancel Chinese Character DBC case 16*16 dots matrix


Format: ASCⅡ: ESC : n
Dec: 27 58 n
Hex: 1B 3A n
Explanation:
After this commend ,it will make sure the Chinese character set ,rang from A1H to A9H,if it is
printed out in DBC case ,or not.
when n=0, cancel DBC case print ,the character would be printed out as large as Chinese
character in width;
when n=1, select DBC case print, the width of the character printed out is half of the Chinese
character in width.
Default n-=1.

3-3-4 Select/cancel Underline Print


Format: ASCⅡ: ESC - n
Dec: 27 45 n
Hex: 1B 2D n
Explanation:
When n=1, select underline print; when n=0, cancel underline print.
All characters including spaces will be printed out with underline after selecting underline print
command. Default n=0.

3-3-5 Select/cancel Up-line Print


Format: ASCⅡ: ESC + n
Dec: 27 43 n
Hex: 1B 2B n
Explanation:
When n=1, select up-line print ; when n=0, cancel up-line after selecting up-line print command,
unless cancel the up-line print command. Default n=0.

3-3-6 Select/cancel Reverse White Print


Format: ASCⅡ: ESC i n
Dec: 27 105 n
Hex: 1B 69 n
Explanation:
When n=1, select reverse white print; when n=0, cancel reverse white print. Reverse white print is
printing in the black background, just like the film of photography.
It is normal print that printing black characters in white background, it is selected at power on or on
ESC @ command.

3-3-7 Select/cancel Reverse Print


Format: ASCⅡ: ESC c n
Dec: 27 99 n
Hex: 1B 63 n

http://www.whkj.com.cn -8-
User’s manual for thermal printer
Explanation:
When n=0, select reverse print, printing from right to left. When n=1, cancel reverse print, printing
from left to right.
When the printer is assembled vertically, it is convenient to read the word reversely so its initial
value is 1.
3-3-8 Set Character Rotational Print
Format: ASCⅡ: FS I n
Dec: 28 73 n
Hex: 1c 49 n
This command is to rotate characters, which is 6*8 dots matrix. The values of n are as following:
n Characters rotated widdershins
0 0º
1 90º
2 180º
4 270º

3-3-9 Select Superscript and Subscript Print


Format: ASCⅡ: FS r n
Dec: 28 114 n
Hex: 1c 72 n
This command is to select the position for superscript and subscript, n=0 is superscript and n= 1 is
subscript. When the character is less then the highest one in the same line ,the character is align
top or bottom with the highest one.

Part 4 User-defined Character Setting Commands


3-4-1 User-defined Characters
Format: ASCⅡ: ESC & s n m a1 p1[s*a ] a2 p2[s*a]
Dec: 27 38 s n m a1 p1[s*a ] a2 p2[s*a]
Hex: 1B 26 s n m a1 p1[s*a ] a2 p2[s*a]
Explanation:
This command allows a character to be defined.
When 24*24 dots matrix: s=3 33≤n≤m≤127
0≤a≤12 0≤p≤36
When 16*16 dots matrix: s=2 33≤n≤m≤127
0≤a≤8 0≤p≤16
Parameter s express the number of longitudinal bytes.
Parameter m and n is the code of user-defined character. Parameter n express the start structure
codes of user-define. Parameter m express the stop structure codes of user-defined. The number
of code is m-n+1. When define only one , n=m. The max number of user-defined character is 95
Parameter a express the dot number horizontally.
http://www.whkj.com.cn -9-
User’s manual for thermal printer

Parameter p express the dots matrix data of dot number , p=s*a.


24*24 Data format [s*a ]:
d1 d4
d2 d5
d3 d6

16*16 Data format [s*a ]:


d1 d3
d2 d4

Notice: the data is from the top down, and then from left to right.
For example:
16X16 dots matrix, 8X16 character
1 8
D7□□□□□□□□
□□□□□□□□
■■■■■■■■
■■■■■■■■
□□□■■□□□
□□□■■□□□
□□□■■□□□
D0□□□■■□□□
D7□□□■■□□□
□□□■■□□□
□□□■■□□□
□□□■■□□□
□■□■■□□□
□□■■■□□□
□□□□□□□□
D0□□□□□□□□
d1=30h,d2=00h,d3=30h,d4=08h,d5=30h,d6=04h,
d7=3fh,d8=0fch,d9=3fh,d10=0fch,d11=30h,d12=00h,d13=30h,d14=00h,d15=30h,d16=00h
24X24 dots matrix, 12X24 character
1 12
D7□□□□□□□□□□□□
□□□□□□□□□□□□
□□□□□□□□□□□□
■■■■■■■■■■■■
■■■■■■■■■■■■
□□□□□■■□□□□□
□□□□□■■□□□□□
D0□□□□□■■□□□□□
D7□□□□□■■□□□□□
□□□□□■■□□□□□
□□□□□■■□□□□□
□□□□□■■□□□□□
□□□□□■■□□□□□
□□□□□■■□□□□□
□□□□□■■□□□□□
D0□□□□□■■□□□□□
D7□□□□□■■□□□□□
□□□□□■■□□□□□
□□□□□■■□□□□□
□□□■□■■□□□□□
□□□□■■■□□□□□
□□□□□□□□□□□□
□□□□□□□□□□□□
D0□□□□□□□□□□□□
d1=18h,d2=00h,d3=00h,d4=18h,d5=00h,d6=00h
d7=18h,d8=00h,d9=00h,d10=18h,d11=00h,d12=10h
d13=18h,d14=00h,d15=08h,d16=1fh,d17=0ffh
d18=0f8h,d19=1fh,d20=0ffh,d21=0f8h,d22=18h
d23=00h,d24=00h,d25=18h,d26=00h,d27=00h
d28=18h,d29=00h,d30=00h,d31=18h,d32=00h,

http://www.whkj.com.cn - 10 -
User’s manual for thermal printer

d33=00h,d34=18h,d35=00h,d36=00h

Part 5 Print Graphics

3-5-1 Print bit-map graphics


Format: ASCⅡ: ESC K n1 n2…data…
Dec: 27 75 n1 n2…data…
Hex: 1B 4B n1 n2…data…
Explanation:
mi mh stand for a 16 bits binary datum . ml is the low 8 bits and mh is the high 8 bits. The number
of graph data is mh×256+ml. The size of graph depends on the enlarging command.
The command will print a iX8 dots graph unit for the 16X16 dots type printer. Its width is i dots and
height is 8 dots. A 8-bit binary datum express row structure and the high bit is on the top.
The command will print a(i/3)×24 dots graph unit for the 24X24 dots type printer. Its width is i/3
dots and height is 24 dots. A 8-bit binary datum express a 8-dot row structure, so three 8-bit binary
data is need to express the whole row, the 24-dot row. The high bit is on the top. The order of the
data is first from the top to the bottom and then from left to right.
If your graph is large than one graph unit . you can divide the graph to different unit ,set and print
them separately. For example more than 8-dot height for a 16X16 dots type printer, you can divide
the graph to different 8-dot unit and print them respectively.
1 2 3 4 5 6 7 8 9 101112
D7 □□□■□□□□□■□□
□■■■■■□■■■■■
□■□□□□□□□■□□
□■□□□□□□□■□□
□■□□□□□□■□■□
■□□□□□□■□□□■
□□□□□□□□□□□□
D0 □□□□□□□□□□□□

3-5-2 dot line print


Format: ASCII: ESC V n1 n2 data.1~data.n2
Dec: 27 86 n1 n2 data.1~data.n2
Hex: 1b 56 n1 n2 data.1~data.n2
Explanation:
n1: the two lower bit is effect.
when n1.0=1,print graph twice in height
n1.0=0,print graph in original height
n1.1=1,print graph twice in width
n1.1=0,print graph in original width
n2: the large number of the byte of one line. the max is 48(one line is 384 in dot, one byte is 8 dot
8*48),when print in twice width is 24.
Data.1~data.n2:n2 graph data
The command is used to print one line graph data

【curve print】
Explanation: The two groups of commands below is to print curve. Use the group of commands , it
http://www.whkj.com.cn - 11 -
User’s manual for thermal printer

will print out abscissa ,coordinate and scale .The origin printed out by the first group is in the left of
the paper, the other is in the right.

3-5-3、【format 1 print y-axis and curve in the direction of cutting paper】


Format: ASCII: FS L n Y01 Y02…Y0n 0a Y11 Y22…Ynn 0a 00
DEC: 28 76 n Y01 Y02…Y0n 0a Y11 Y22…Ynn 0a 00
HEX: 1C 4C n Y01 Y02…Y0n 0a Y11 Y22…Ynn 0a 00
This command is to print out y-axis and scale in the direction of cutting paper from left to right.
Parameter n is the spacing between each coordinate point, and the unit is every point. Parameter
Y01 is the highest digit of origin, in the form of hex of ASCII. Parameter Y02-Y0n is the highest
digit of the next coordinate. Parameter 0a is to print the scale this line. Parameter Y11 is the next
digit to the highest digit of origin. Parameter Yn1 is the lowest digit of origin. Parameter 00 is the
end of printing y-axis.
For example: To print a y-axis with 50 dots of the space between. The scale is 00 50 100 150, then
the command:
0x1C 0x4C 50 0x20 0x20 0x31 0x31 0x0a 0x30 0x35 0x30 0x35 0x0a 0x30 0x30 0x30 0x30 0x0a
0x00

3-5-4、【format 1 print x-axis and curve in the direction of feed paper】


Format : ASCII : FS M n k X1 0B X2 0B…Xn 0B 00 m1 C1L C1H..Cm1L
Cm1H …mn CmnL CmnH 00
DEC : 28 77 n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
Cm1H …mn CmnL CmnH 00
HEX : 1C 4D n k X1 0b X2 0b…Xn 0b 00 m1 C1L C1H Cm1L
Cm1H …mn CmnL CmnH 00
This command is to print out x-axis, scale and curve in the direction of feed paper in the left of the
paper. Parameter n is the spacing between each coordinate point, and the unit is every point.
Parameter k is the number of the coordinate scale. Parameter x is the value of scale, The max
digitals is three, with the form of ASCII. For example: the sclae150, need to input 31,35,30.
Parameter 0B is the end of a scale. Parameter M is the number of the curve in one line. Cmnl,
Cmnh is the location of coordinates, Cmnl is the lower byte, CmnH is the higher byte. Parameter
00 is the end of the curve printing.
For example: To print a x-axis with 50 dots of the space between and a beeline with the length of
100 dots in the direction of feed paper and print in the left of the paper, with the scale 50,100. The
command:
0x1c 0x4d 50 0x02 0x35 0x30 0x0b 0x31 0x30 0x30 0x0b 0x00 0x01 0x80 0x00(to print a beeline
with the length of 100 dots, the part with underline should be input 100 times.) 0x00 .

3-5-5、【format 2 print y-axis and curve in the direction of cutting paper】


Format: ASCII: FS N k n Y1 0B Y2 0B ….Yn 0B 00
DEC: 28 78 k n Y1 0B Y2 0B… Yn 0B 00

http://www.whkj.com.cn - 12 -
User’s manual for thermal printer

HEX: 1C 4E k n Y1 0B Y2 0B…Yn 0B 00
This command is to print out y-axis and scale in the direction of cutting paper from right to left.
Parameter k is offset to origin. Parameter n is the spacing between each coordinate point, and the
unit is every point. Parameter Y is the value of scale, The maximum digitals is three, with the
form of ASCII. For example: the sclae150, need to input 31, 35, 30. Parameter 0B is the end of a
scale. Parameter 00 express the end of printing y-axis.。
For example: To print a y-axis with 50 dots of the space between. The scale is 00 50 100 150 , and
the offset of origin is 40, then the command:
0x1C 0x4e 40 50 0x20 0x30 0x30 0x0b 0x30 0x35 0x30 0x0b 0x31 0x30 0x30 0x0b 0x00.

3-5-6【format 2 print x-axis and curve in the direction of feed paper】


Format : ASCII : FS N n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
Cm1H …mn CmnL CmnH 00
DEC : 28 79 n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
Cm1H …mn CmnL CmnH 00
HEX : 1C 4F n k X1 0B X2 0b…Xn 0B 00 m1 C1L C1H..Cm1L
Cm1H …mn CmnL CmnH 00
This command is to print out x-axis, scale and curve in the direction of feed paper in the right of
the paper. Parameter n is the spacing between each coordinate point, and the unit is every point.
Parameter k is the number of the coordinate scale. Parameter x is the value of scale, The max
digitals is three, with the form of ASCII. For example: the sclae150, need to input 31,35,30.
Parameter 0B is the end of a scale. Parameter M is the number of the curve in one line. Cmnl,
Cmnh is the location of coordinates, Cmnl is the lower byte, CmnH is the higher byte. Parameter
00 is the end of the curve printing.
For example: To print a x-axis with 50 dots of the space between and a beeline with the length of
100 dots in the direction of feed paper, with the scale 50,100. The command:
0x1c 0x4F 50 0x02 0x35 0x30 0x0b 0x31 0x30 0x30 0x0b 0x00 0x01 0x80 0x00 (to print a beeline
with the length of 100 dots, the part with underline should be input 100 times.) 0x00 .

Part 6 Print bar code

3-6-1 Set the size of both the wide and narrow bar
Format: ASCII: GS W n1 n2
Dec: 29 87 n1 n2
Hex: 1D 57 n1 n2
The size of the narrow bar is n1 dot.
One dot is 1/203 inch or 0.125mm.
initial value is 3.
The size of the wide bar is n2 dot.

3-6-2 Print bar code


Format: ASCII: GS k n [d] NUL
Dec: 29 107 n [d] NUL
Hex: 1D 6B n [d] NUL
http://www.whkj.com.cn - 13 -
User’s manual for thermal printer
n is used to choose the bar code system.
n bar
code
2 EAN-13
3 EAN-8
Please pay attention to the limited number of the bar code system .
Both the EAN-13 and EAN-8 can get the verify number automatically
[d]is the bar code character.
NUL is the end of this command

3-6-3 Permit /forbid printing HRI character


Format: ASCII: GS H n
Dec: 29 72 n
Hex: 1D 48 n
When n=0,HRI character will not be printed out and it is the initial value.
When n=1,HRI character will be printed out under the bar code.

3-6-4 Set the height of the bar code


Format: ASCII: GS h n
Dec: 29 104 n
Hex: 1D 68 n
n=0~255,when n=0,the height is 256 dot.
Default : n=60.

3-6-5 Set the landscape orientation size of the bar code


Format: ASCII: GS w n
Dec: 29 119 n
Hex: 1D 77 n
n=1~4, the size of the bar code be different when the n is different. Default : n=3.

n narrow wide
bar bar
1 1 3
2 2 5
3 3 7
4 4 9

PART 7 Initialization Commands


3-7-1 Initialize Printer
Format: ASCⅡ: ESC @
Dec: 27 64
Hex: 1B 40
Explanation:
This command is used to initialize the printer. There are two ways we can initialize the printer :
(1) use the command ESC @
(2) re-power the printer

http://www.whkj.com.cn - 14 -
User’s manual for thermal printer

Part 8 Data Control Commands


3-8-1 Carriage return
Format: ASCⅡ: CR
Dec: 13
Hex: 0D
Explanation:
If a “CR” command is sent to printer the total data in the print buffer will be printed out and paper
will be fed for one line forwards.

3-8-2 Allow/forbid printer process data


Format: ASCII: ESC d n
Dec: 27 100 n
Hex: 1B 64 n

When n=0, forbid the data received,, and all the commands received are of no effect; When n=1,
Allow the data received.
Default n=1

3.8.3 black mark orientation and offset


Format: ASCII: GS ( N1 N2
Dec: 29 40 N1 N2
Hex: 1D 28 N1 N2
0 <= N1 <= 255 The offset of incept printing place. Search black mark command(SYN). When
detect black mark, feed paper in N1 dot lines.
0<= N2 <= 255 The offset of cutter place. Cut paper command(GS V),detect black mark first,
then feed paper in N2 dot lines, and then cut paper.
Default: N1=N2=96.

3.8.4 make black mark to the incept printing place


Format: ASCII: SYN
Dec: 22
Hex: 16
Based on the offset which GS( N1 N2 command decide, confirm the incept printing place. First
paper backward in N1 line, Detect black mark. If find the black mark, feed paper in N1 line.
Otherwise feed paper and detect black mark. Until find the black mark, and feed paper in N1 line,
from the black mark place.

3-8-5 cut paper

http://www.whkj.com.cn - 15 -
User’s manual for thermal printer

Format: ASCII: ESC k n


Dec: 27 107 n
Hex: 1b 6b n
Explanation:
When n=0, it means cut paper full or half.
When n=1, Detect black mark, and feed paper based on the offset which GS( N1 N2 command
decide, and then cut paper.

3-8-6 Send the printer state to CPU


Format: ASCII: FS v n
Dec: 28 118 n
Hex: 1C 76 n
Explanation: Send the printer state to CPU.
Serial port: After this command the printer will send one byte through TXD.
The definition of the byte:
bit function 0 1
0 unused constant 0 constant 0
1 unused constant 0 constant 0
2 Paper out checking lacking enough
3 unused constant 0 constant 0
4 Printer head roll closed open
5 unused constant 0 constant 0
6 cutter reset unreset
7 unused constant 0 constant 0

Parallel port: Different value of parameter n, different meanings. After this command, the printer
will send a bit signal though the pin 23 of the parallel port.
n=0, 30 output paper out signal. When the bit is low level, show that the paper is enough; when
the byte is high level, show that the paper is lacking.
n=1, 31 output printer head state signal. When the bit is low level, show that the printer head roll is
open; When the byte is high level, show that the printer head roll is closed.
n=2, 32 cutter reset signal. When the bit is high level show that the cutter reset, could cut paper
full or half; when the byte is low level, show that the cutter do not reset, and could not cut
paper.
Note: Cut half or full can be selected by the place of redline and black line between the circuit
board and the cutter.

http://www.whkj.com.cn - 16 -
User’s manual for thermal printer

SECTION Ⅳ Character SetⅠ、Ⅱ

http://www.whkj.com.cn -17-
User’s manual for thermal printer

Section Ⅵ Command table for quick consultant


command
description page
ASCII Dec Hex
ESC 6 n 27 54 1B n 36 n Select character set 4
LF 10 0A Feed line 4
ESC J n 27 74 n 1B 4A n N dot line feed 5
ESC e n 27 101 n 1B 65 n print and paper backward in n line 5
ESC 1 n 27 49 n 1B 31 n Set n dot line spacing 5
ESC p n 27 112 n 1B 70 n set the space between characters 5
ESC B n1 n2…NUL 27 66 n1 n2…0 1B 42 n1 n2…00 Set Vertical Tab Value 5
VT 11 0B Carry out Vertical Tab Value 6
ESC D n1 n2…NUL 27 68 n1 n2…0 1B 44 n1 n2…00 Set Horizontal Tab Value 6
HT 9 09 Carry out Horizontal Tab Value 6
ESC f m n 27 102 m n 1B 66 m n Print Blank Character or Lines 7
ESC Qn 27 81 n 1B 51 n Set right margin 7
ESC 1n 27 108 n 1B 6C n Set left margin 7
ESC m n 27 109 n 1B 6D n set the gray degree 7
ESC 7 n 27 55 n 1B 37 n Enlarge Width 7
ESC 8 n 27 56 n 1B 38 n Enlarge Height 7
ESC : n 27 58 n 1B 3A n Select/cancel Chinese 8
ESC - n 27 45 n 1B 2D n Select/cancel Underline Print 8
ESC + n 27 43 n 1B 2B n Select/cancel Up-line Print 8
ESC I n 27 105 n 1B 69 n Select/cancel Reverse White Print 8
ESC c n 27 99 n 1B 63 n select or cancel reverse print 8
FS I n 28 73 n 1C 49 n Set Chinese Character Rotational 9
ESC & s n m a1 27 38 s n m a1 1B 26 s n m a1 p1[sxa]
p1[sxa] a2 p2[sxa] p1[sxa] a2 p2[sxa] a2 p2[sxa] User-defined Characters 9

FS r n 28 114 n 1c 72 n Select Superscript and Subscript 9


ESC K ml mh n1 n2...ni. 27 75 ml mh n1 n2...ni... 1B 4B ml mh n1 n2..ni. Print bit-map graphics 11
ESC V n1 n2 data.1~ 27 86 n1 n2 data.1~
1B 56 n1 n2 data.1~data.n2 dot line print 11
data.n2 data.n2
FS L n Y01 Y02…Y0n 28 76 n Y01 Y02…Y0n 1C 4C n Y01 Y02…Y0n 0a Y11 format 1 print y-axis and curve in
12
0a Y11 Y22 Ynn 0a 00 0a Y11 Y22…Ynn 0a 00 Y22 Ynn 0a 00 the direction of cutting paper
FS M n kX1 0B X2 0B…Xn 28 77 n k X1 0B X2 0b…Xn 1C 4D nkX10b X2 0b…Xn 0b 00
format 1 print x-axis and curve in
0B 00 m1 C1L C1H..Cm1L 0B 00 m1 C1L C1H..Cm1L m1 C1L C1H Cm1L Cm1H…mnCmnL 12
the direction of feed paper
Cm1H mn CmnL CmnH 00 Cm1H …mn CmnL CmnH 00 CmnH 00
FS N k n Y1 0B 28 78 k n Y1 0B 1C 4E k n Y1 0B Y2 format 2 print y-axis and curve in
13
Y2 0B …Yn 0B 00 Y2 0B…Yn 0B 00 0B…Yn 0B 00 the direction of cutting paper
FSN n k X1 0b X2 0b…Xn 28 79 n k X1 0B X2 0b…Xn 1C4Fnk X1 0B X2 0b…Xn 0B 00
format 2 print x-axis and curve in
0B 00 m1 C1L C1H..Cm1L 0B 00 m1 C1L C1H..Cm1L m1 C1L C1H.Cm1 Cm1H…mn CmnL 13
the direction of feed paper
Cm1H…mn CmnL CmnH 00 Cm1H …mn CmnL CmnH 00 CmnH 00
Set the size of both the wide and
GS W n1 n2 29 87 n1 n2 1D 57 n1 n2 13
narrow bar
GS k n [d] NUL 29 107 n [d] 00 1D 6B n [d] 00 Print bar code 14
GS H n 29 72 n 1b 48 n Permit/forbid print HRI character 14
GS h n 29 104 n 1D 68 n Set the height of the bar code 14
GS w n 29 119 n 1D 77 n Set landscape orientation size of bar 14
ESC @ 27 64 1B 40 Initialize Printer 14
CR 13 0D Carriage return 15
ESC d n 27 100 n 1B 64 n Allow/forbid printer process data 15
GS ( N1 N2 29 40 N1 N2 1D 28 N1 N2 black mark orientation and offset 15
make black mark to the incept
SYN 22 16 printing place 15
ESC k n 27 107 n 1b 6b n Cut paper 16
FS v n 28 118 n 1c 76 n Send the printer state to CPU 16

-http://www.whkj.com.cn - 18 -

You might also like