Control Commands - Synes

88
SP-POS88Control Commands VER 1.1Beijing Spirit Technology Development Co.,Ltd

Transcript of Control Commands - Synes

SP-POS88ⅤⅤⅤⅤ

Control Commands

((((VER 1.1))))

Beijing Spirit Technology Development Co.,Ltd

Content

HT........................................................................................................................................... 7

LF ........................................................................................................................................... 7

FF ........................................................................................................................................... 7

CR........................................................................................................................................... 8

CAN ....................................................................................................................................... 8

DLE EOT n ............................................................................................................................ 8

DLE ENQ n.......................................................................................................................... 10

DLE DC4 fn m t (fn=1)........................................................................................................ 11

DLE DC4 fn a b (fn=2) ........................................................................................................ 11

DLE DC4 fn d1…d7 (fn=8) ................................................................................................. 12

ESC FF ................................................................................................................................. 12

ESC SP n .............................................................................................................................. 12

ESC ! n ................................................................................................................................. 13

ESC $ nL nH ........................................................................................................................ 14

ESC % n ............................................................................................................................... 15

ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]....................................................... 15

ESC * m nL nH d1... dk .................................................................................................... 17

ESC - n ................................................................................................................................. 20

ESC 2.................................................................................................................................... 20

ESC 3 n................................................................................................................................. 20

ESC = n ................................................................................................................................ 21

ESC ? n................................................................................................................................. 21

ESC @.................................................................................................................................. 22

ESC D n1...nk NUL ............................................................................................................. 22

ESC E n ................................................................................................................................ 23

ESC G n................................................................................................................................ 23

ESC J n ................................................................................................................................. 23

ESC L ................................................................................................................................... 24

ESC M n............................................................................................................................... 25

ESC R n................................................................................................................................ 25

ESC S ................................................................................................................................... 26

ESC T n ................................................................................................................................ 27

ESC V n................................................................................................................................ 27

ESC W xL xH yL yH dxL dxH dyL dyH ............................................................................. 28

ESC \ nL nH ......................................................................................................................... 29

ESC a n................................................................................................................................. 30

ESC c 3 n.............................................................................................................................. 31

ESC c 4 n.............................................................................................................................. 31

ESC c 5 n.............................................................................................................................. 32

ESC d n................................................................................................................................. 32

ESC p m t1 t2 ....................................................................................................................... 33

ESC t n ................................................................................................................................. 33

ESC { n................................................................................................................................. 34

FS g 1 m a1 a2 a3 a4 nL nH d1 … dk .................................................................................. 35

FS g 2 m a1 a2 a3 a4 nL nH................................................................................................. 36

GS ! n ................................................................................................................................... 36

GS $ nL nH........................................................................................................................... 37

GS ( A pL pH n m ................................................................................................................ 37

GS ( D pL pH m [a1 b1] … [ak bk] ..................................................................................... 38

GS ( E pL pH fn [parameters] .............................................................................................. 39

<Function 1 > GS ( E pL pH fn d1 d2...................................................................... ( fn=1)

.............................................................................................................................................. 40

<Function 2 > GS ( E pL pH fn d1 d2 d3................................................................. ( fn=2)

.............................................................................................................................................. 40

<Function 5 > GS ( E pL pH fn [a1 n1L n1H]…[ak nkL nkH] ............................... ( fn=5)

.............................................................................................................................................. 40

<Function 6 > GS ( E pL pH fn a............................................................................. ( fn=6)

.............................................................................................................................................. 42

<Function 11 > GS ( E pL pH fn a d1 … dk.......................................................... ( fn=11)

.............................................................................................................................................. 42

<Function 12 > GS ( E pL pH fn a ....................................................................... ( fn=12)

.............................................................................................................................................. 43

GS ( H pL pH fn [parameters].............................................................................................. 43

<Function 48 > GS ( H pL pH fn m d1 d2 d3 d4 ( fn=48)............................................. 43

GS ( K pL pH fn [parameters].............................................................................................. 44

<Function 50 > GS ( K pL pH fn m ( fn=50)................................................................. 44

<Function 97 > GS ( K pL pH fn m ( fn=97)................................................................. 45

GS ( L pL pH m fn [parameters] .......................................................................................... 45

GS 8 L p1 p2 p3 p4 m fn [parameters]................................................................................. 45

<Function 48 > GS ( L pL pH m fn ( fn=0,48) .............................................................. 46

<Function 50 > GS ( L pL pH m fn ( fn=2,50) .............................................................. 47

<Function 51 > GS ( L pL pH m fn ( fn=3,51) .............................................................. 47

<Function 64 > GS ( L pL pH m fn d1 d2 ( fn=64) .......................................................... 47

<Function 65 > GS ( L pL pH m fn d1 d2 d3 ( fn=65) ..................................................... 47

<Function 66 > GS ( L pL pH m fn kc1 kc2 ( fn=66)....................................................... 48

GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c d1…dk]b ( fn=67) ........ 48

<Function 69 > GS ( L pL pH m fn kc1 kc2 x y ( fn=69).................................................... 49

<Function 112> GS ( L pL pH m fn a bx by c xL xH yL yH d1…dk ( fn=112) ................. 49

GS ( N pL pH fn [parameters].............................................................................................. 50

<Function 48 > GS ( N pL pH fn m ( fn=48)................................................................. 51

GS ( k pL pH cn fn [parameters].......................................................................................... 51

<Function 065 > GS ( k pL pH cn fn n ( cn=48,fn=65) .................................................... 52

<Function 066 > GS ( k pL pH cn fn n ( cn=48,fn=66) .................................................... 53

<Function 067 > GS ( k pL pH cn fn n ( cn=48,fn=67) .................................................... 53

<Function 068 > GS ( k pL pH cn fn n ( cn=48,fn=68) .................................................... 53

<Function 069 > GS ( k pL pH cn fn m n ( cn=48,fn=69)................................................ 53

<Function 070 > GS ( k pL pH cn fn m ( cn=48,fn=70)................................................... 54

<Function 080 > GS ( k pL pH cn fn m d1…dk ( cn=48,fn=80)...................................... 55

<Function 081 > GS ( k pL pH cn fn m ( cn=48,fn=81)................................................... 55

<Function 082 > GS ( k pL pH cn fn m ( cn=48,fn=82)................................................... 55

<Function 165 > GS ( k pL pH cn fn n1 n2 ( cn=49,fn=65) ............................................. 56

<Function 167 > GS ( k pL pH cn fn n ( cn=49,fn=67) .................................................... 56

<Function 169 > GS ( k pL pH cn fn n ( cn=49,fn=69) .................................................... 57

<Function 180 > GS ( k pL pH cn fn m d1…dk ( cn=49,fn=80)...................................... 57

<Function 181 > GS ( k pL pH cn fn m ( cn=49,fn=81)................................................... 57

<Function 182 > GS ( k pL pH cn fn m ( cn=49,fn=82)................................................... 58

GS * x y d1...d(x × y × 8)..................................................................................................... 58

GS / m................................................................................................................................... 59

GS :....................................................................................................................................... 59

GS B n .................................................................................................................................. 60

GS H n.................................................................................................................................. 60

GS I n ................................................................................................................................... 61

GS L nL nH .......................................................................................................................... 62

GS P x y................................................................................................................................ 62

①GS V m ②GS V m n....................................................................................................... 63

GS W nL nH......................................................................................................................... 63

GS \ nL nH ........................................................................................................................... 64

GS ^ r t m ............................................................................................................................. 65

GS a n ................................................................................................................................... 65

GS b n................................................................................................................................... 67

GS f n ................................................................................................................................... 67

GS g 0 m nL nH ................................................................................................................... 68

GS g 2 m nL nH ................................................................................................................... 68

GS h n................................................................................................................................... 69

①GS k m d1...dk NUL②GS k m n d1...dn ......................................................................... 69

GS r n ................................................................................................................................... 71

GS w n.................................................................................................................................. 72

FS ! n .................................................................................................................................... 73

FS & ..................................................................................................................................... 73

FS - n .................................................................................................................................... 74

FS . ....................................................................................................................................... 74

FS 2 c1 c2 d1...dk................................................................................................................. 74

FS C n................................................................................................................................... 75

FS S n1 n2 ............................................................................................................................ 76

FS W n.................................................................................................................................. 76

FS p n m ............................................................................................................................... 77

FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n ................................................... 77

GS v 0 m xL xH yL yH d1....dk ........................................................................................... 79

ESC c 0 n.............................................................................................................................. 80

GS FF ................................................................................................................................... 80

GS # n................................................................................................................................... 81

Appendix A: CODE128 ....................................................................................................... 82

Appendix B:Printer Mode And Transfer ........................................................................... 86

Format Specification

In this part,it indicates how to use this technical manual,please read this manual before

programming.

This manual including parts below:

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

proposes the command of ASCII barcode and its function.

2) Format. This part uses ASCII barcode format,HEX format,Decimal format to describe this

command.

If there is no special note,the part of value range is decimal digit.For example, 1 ≤ n ≤ 4,the no.1

is decimal digit but not it in ASCII.

3) Range.Give the range of the variable.

4) Description.Give the detailed explanation of the command.

5) Notes.Give the notice of the command.Under different mode and coordinate with different

command,this may cause interaction,so in this part gives these details.

6) Reference.Give other commands which are interrelated or similar with this.

---> DLE EOT n Real-time status transmission

---> [Format] ASCII DLE EOT n

Hex 10 04 n

Decimal 16 4 n

---> [Range] 1 ≤ n ≤ 4

---> [Description] Sending the printer state that designated by parameter n:

…..

---> [Notice] ·When printer receives the command,it will return the interrelated

status immediately.

….

---> [Reference]

HT

[Name] Horizontal tab

[Format] ASCII HT

Hex 09

Decimal 9

[Description] Move the print position to the next horizontal tab position.

[Notice] • This command will be ignored if the next horizontal tab has not been setted.

• If the next horizontal tab position exceeds the printing area,the printer sets the

printing position to the [Pringting width + 1].

• Horizontal tab position is setted by ESC D.

• If this command is received when the printing position is at [printing width+1],the

printer executes print buffer-full printing of the current line and horizontal tab

processing from the beginning of next line.

• The default horizontal tab position for the paper roll is font ASCII(12*24)every 8

characters(9th,17th,25th……).

• When the current buffer is full,the printer will carry out the proceeding below:

Under standard mode,the printer prints content of current line,and sets the

printing position at the beginning of next line.

Under page mode,the printer carry out word wrap,and sets the printing position at

the beginning of next line.

[Reference] ESC D

LF

[Name] Printing and feeding line

[Format] ASCII LF

Hex 0A

Decimal 10

[Description] Printing the datas in the print buffer and feeding one line,the line space is the

same as currently .

[Notice] This command sets the print position at the beginning of the line.

[Reference] ESC 2, ESC 3

FF

[Name] Printing under page mode and return to standard mode.

[Format] ASCII FF

Hex 0C

Decimal 12

[Description] Printing content in buffer and return to standard mode.

[Notice] · This command is effective only under page mode.

· Clear the contents after printing.

· The printing area setted by ESC W reverts to default value.

· The printer does not cut paper.

· This command sets the current position at the beginning of the line.

[Reference] ESC FF, ESC L, ESC S

CR

[Name] Print and carriage return

[Format] ASCII CR

Hex 0D

Decimal 13

[Description] When current command is allowed,it is equal to LF command;When it is

forbidden,it is ignored.

[Notice] · Setting the printing position as the beginning of the line

· The command will be ignored under serial interface mode.

· Under parallel mode,whether the command is effective is up to the configuration

fothe printer.

[Reference] LF

CAN

[Name] Delete the contents in buffer under page mode

[Format] ASCII CAN

Hex 18

Decimal 24

[Description] Delete contents in current area under page mode.

[Notice] · This command is only effective under page mode.

· If there is overlap section between previous setted area and current area,the

overlap section will be delete.

[Reference] ESC L, ESC W

DLE EOT n

[Name] Real-time status transmission

[Format] ASCII DLE EOT n

Hex 10 04 n

Decimal 16 4 n

[Range] 1 ≤ n ≤ 4

[Description] Sending the printer state that designated by parameter n:

n = 1:Sending state of the printer

n = 2:Sending off-line state

n = 3:Sending error state

n = 4:Sending state of paper sensor

[Notice] ·When printer receives the command,it will return the interrelated status

immediately.

·Avoideing to insert this command into 2 or more command sequences.

·This command will be also valid even the printer is set to forbid by the command

ESC =(selecting perpheral).

·When sending printer current state,each state is indicated by 1 byte.

·Transmission state value of the printer can not confirm whether the master

computer received.

·Printer will carry out the command immediately once received.

·This command is just available to the serial printer.The printer will carry out the

command immediately under any state.

n = 1: Printer State

Bit 0/1 HEX Decimal Function

0 0 00 0 Fix as 0

1 1 02 2 Fix as 1

0 00 0 Drawer open/close signal is LOW(connector pin 3) 2

1 04 4 Drawer open/close signal is HIGH(connector pin 3)

0 00 0 Online 3

1 08 8 Offline

4 1 10 16 Fix as 1

5,6 Undefined

7 0 00 00 Fix as 0

n = 2: Offline State

Bit 0/1 HEX Decimal Function

0 0 00 0 Fix as 0

1 1 02 2 Fix as1

0 00 0 Close the cover 2

1 04 4 Open the cover

0 00 0 Not pressing the feed button 3

1 08 8 Pressing the feed button

4 1 10 16 Fix as 1

0 00 0 The printer is not out of paper 5

1 20 32 The printer is out of paper

0 00 0 No error state 6

1 40 64 Error state

7 0 00 0 Fix as 0

n = 3: Error State

Bit 0/1 HEX Decimal Function

0 0 00 0 Fix as 0

1 1 02 2 Fix as 1

2 - - - Undefined

0 00 0 No error on the cutter 3

1 08 8 Error on the cutter

4 1 10 16 Fix as 1

0 00 0 No unrecoverable error 5

1 20 32 Have unrecoverable error

0 00 0 No automatic recovery error 6

1 40 64 Have automatic recovery error

7 0 00 0 Fix as 0

n = 4: Paper sensor state

Bit 1/0 HEX Decimal Function

0 0 00 0 Fix as 0

1 1 02 2 Fix as 1

0 00 0 Paper is enough 2,3

1 0C 12 Paper is out

4 1 10 16 Fix as 1

0 00 0 Paper ending sensor:have paper 5,6

1 60 96 Paper ending sensor:paper is out

7 0 00 0 Fix as 0

[Reference] DLE ENQ, GS a, GS r

DLE ENQ n

[Name] Real time request

[Format] ASCII DLE ENQ n

Hex 10 05 n

Decimal 16 5 n

[Range] 1 ≤n ≤ 2

[Description] Responding to the request of master computer.Meaning of “n” is as below:

n Request content

1 Recover from the error and restart printing the line that the error occurred.

·This command will be ignored if the error is recoverable.

2 Recover from the error and clear the command to receive and print the content in buffer.

·This command will be ignored if the error is recoverable.

[Notice] ·This command is only available when the cutter has error.

·Under serial mode,the printer will carry out the command immediately.

·Under parallel mode,the command will not be carried out when the printer is busy.

·Try not to insert this command into the command sequence of 2 or more bytes.

·This command will be also available even the printer is set to forbid by the

command ESC =(selecting perpheral)

[Reference] DLE EOT

DLE DC4 fn m t (fn=1)

[Name] Real-time generating cash drawer firing pulse

[Format] ASCII DLE DC4 fn m t

Hex 10 14 fn m t

Decimal 16 20 fn m t

[Range] fn = 1

m = 0, 1

1 ≤ t≤ 8

[Description] Generating the desired firing pulse at assigned pin of the cash drawer socket,the

pin is appointed by “m”

m Connecting Pin

0 Pin of cash drawer socket 2

1 Pin of cash drawer socket 5

Time of high level pluse is[ t × 100 ms],time of low level is [ t × 100 ms]

[Notice] · The command will be ignored when the printer is under error condition.

·When the printer is carrying out the command of opening the cash drawer(ESC p

or DEL DC4),this command will be neglected.

·Under serial mode,the printer will carry out the command immediately once

received.

·Under parallel mode,the printer will not carry out the command when it is busy.

·If the printing datas includes the same datas with this command,these datas will be

carried out as this command.Users must be in view of this situation.

·Try not to insert this command into the command sequence of 2 or more bytes.

·This command will be also available even the printer is set to forbid by the

command ESC =(selecting perpheral).

[Reference] ESC p

DLE DC4 fn a b (fn=2)

[Name] Carry out close-down sequence

[Format] ASCII DLE DC4 fn a b

Hex 10 14 fn a b

Decimal 16 20 fn a b

[Range] fn = 2

a = 1

b = 8

[Description] · Carry out close-down sequence,send close-down notice.

· Save the value of counter.

· Set the interface as “busy”.

· Set the printer in standby mode.

[Notice] ·If the printing datas includes the same datas with this command,these datas will be

carried out as this command.Users must be in view of this situation.

·Try not to insert this command into the command sequence of 2 or more bytes.

· This command does not turn the power off,user needs to turn off the power after

reveiving the close-down notice returned.

· After carrying out this command,the printer will not do any other things,in order to

make the printer print again,user must turn it on again,or reset the hardware.

[Reference]

DLE DC4 fn d1…d7 (fn=8)

[Name] Clear the buffer

[Format] ASCII DLE DC4 fn d1…d7

Hex 10 14 fn d1…d7

Decimal 16 20 fn d1…d7

[Range] fn =8

d1=1,d2=3,d3=20,d4=1,d5=6,d6=2,d7=8

[Description] · Clear datas in receiving and printing buffer,and transfer clear response.

· Recover from error if there is any recoverable error.

[Notice] · Don’t use this command in the system of using OPOS or JavaPOS driver.

·If the printing datas includes the same datas with this command,these datas will be

carried out as this command.Users must be in view of this situation.

·Try not to insert this command into the command sequence of 2 or more bytes.

· After sending this command,do not send other datas before receiving the return

state.

ESC FF

[Name] Print under page mode

[Format] ASCII ESC FF

Hex 1B 0C

Decimal 27 12

[Description] Print contents in printer buffer under page mode.

[Notice] · This command is only effective under page mode.

· After printing ,the printer will not clear contents in printing buffer,characters setted

and position of ESC T and ESC W.

[Reference] FF, ESC L, ESC S

ESC SP n

[Name] Setting the right space of characters

[Format] ASCII ESC SP n

Hex 1B 20 n

Decimal 27 32 n

[Range] 0 ≤ n≤255

[Description] Setting the right space of character fro[n*units of lateral or longitudinal

shifting]inches.

[Notice] · When characters are enlarged,the space will be enlarged in the same multiple.

· This command does not affect the setting of Chinese characters.

· This command sets values independently in each mode.

· The GSP command can change the horizontal motion unit.But it will not change the right

space.

· Under standard mode,the horizontal motion unit is used.

· Under page mode,selecting the horizontal or vertical motion unit according to direction

and starting position,the methods are as below:

①When the starting position is set to the upper left or lower right of the

printable area using ESC T, the horizontal motion unit ( x) is used.

②When the starting position is set to the upper right or lower left of the

printable area using ESC T, the vertical motion unit ( y) is used.

· The maximum right-side spacing is 255/203 inches. Any setting exceeding the

maximum is converted to the maximum automatically.

[Default] n = 0

[Reference] GS P

ESC ! n

[Name] Select print mode

[Format] ASCII ESC ! n

Hex 1B 21 n

Decimal 27 33 n

[Range] 0 ≤ n ≤ 255

[Description] Setting character print mode according to value of “n”

Bit 1/0 HEX Decimal Function

0 00 0 Standard ASCII style (12 × 24) 0

1 01 1 Compressing ASCII style (9 × 17)

1,2 Undefined

0 00 0 Cancel bold mode 3

1 08 8 Select bold mode

0 00 0 Cancel double height mode 4

1 10 16 Select double height mode

0 00 0 Cancel double width mode 5

1 20 32 Select double width mode

6 Undefined

0 00 0 Cancel underline mode 7

1 80 128 Select underline mode

[Notice] ·When both double-height and double-width modes are selected,

quadruple size characters are printed.

• 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 Chinese. All print modes

except emphasized mode is effective only for alphanumeric.

[Default] n = 0

[Reference] ESC -, ESC E, GS !

ESC $ nL nH

[Name] Set 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]

Sets the distance from the beginning of the line to the position at which

subsequent characters are to be printed.

• The distance from the beginning of the line to the print position is [( nL + nH × 256) ×

(vertical or horizontal motion unit)] inches.

[Notice]

• Settings outside the specified printable area are ignored.

• The horizontal and vertical motion unit are specified by GS P.

• The GS P command can change the horizontal (and vertical) motion unit.

However, the value cannot be less than the minimum horizontal movement amount,

and it must be in even units of the minimum horizontal movement amount.

• In standard mode, the horizontal motion unit ( x) is used.

• In page mode, horizontal or vertical motion unit differs depending on the 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

using ESC T, the horizontal motion unit ( x) is used.

② When the starting position is set to the upper right or lower left of the printable area

using ESC T, the vertical motion unit ( y) is used.

[Reference] ESC \, GS $, GS \, GS P

ESC % n

[Name] Select/cancel user-defined character set

[Format] ASCII ESC % n

Hex 1B 25 n

Decimal 27 37 n

[Range] 0 ≤ n ≤255

[Description] Selects or cancels the user-defined character set.

• 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.

[Notice] • 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 ?

ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]

[Name] Define user-defined characters

[Format] ASCII ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]

Hex 1B 26 y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]

Decimal 27 38 y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]

[Range] y = 3

32 ≤ c1 ≤ c2 ≤ 126

0 ≤ x ≤ 12 ASCII font A (12× 24)

0 ≤ x ≤ 9 SCII font B (9 × 17)

0 ≤ d1 ... d(y × xk) ≤ 255

K=c2-c2+1

[Description] Defines user-defined characters.

• y specifies the number of bytes in the vertical direction.

• c1 specifies the beginning character code for the definition, and c2 specifies the

final code.

• x specifies the number of dots in the horizontal direction.

[Notice] • The allowable character code range is from ASCII code <20>H to

<7E>H (95

characters).

• It is possible to define multiple characters for consecutive character codes.

If only one character is desired, use c1 = c2.

• d is the dot data for the characters. The dot pattern is in the horizontal direction

from the left side. Any remaining dots on the right side are blank.

• The data to define a user-defined character is (y × x) bytes.

• Set a corresponding bit to 1 to print a dot or 0 to not print a dot.

• This command can define different user-defined character patterns by each fonts.

To

select a font, use ESC !

• A user-defined character and a downloaded bit image cannot be defined

simultaneously. When this command is executed, the downloaded bit image is

cleared.

• The user-defined character definition is cleared when:

_ ESC @ is executed.

_ ESC ? is executed.

_ FS q is executed.

_ GS ∗ is executed.

_ The printer is reset or the power is turned off.

• When the user-defined characters are defined in font B (9 × 17), only the most

significant bit of the 3rd byte of data in vertical direction is effective.

[Default] The internal character set

[Reference] ESC %, ESC ?

[Example]

·• When font A (12 × 24) is selected.

·• When font B (9 × 17) is selected.

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] Selects a bit-image mode using m for the number of dots specified by nL and nH,

as follows:

Vertical Direction Horizontal Direction m Mode

Number

of Dots

Dot

Density

Dot

Density

Number of Data((((k))))

0 8-dot single

density

8 68 DPI 101 DPI nL + nH × 256

1 8-dot double

density

8 68 DPI 203 DPI nL + nH × 256

32 24-dot single

density

24 203 DPI 101 DPI ( nL + nH × 256) × 3

33 24dot double

density

24 203 DP 203 DPI ( nL + nH × 256) × 3

[Notice] • If the values of m is out of the specified range, nL and data following are

processed as

normal data.

• The nL and nH indicate the number of dots of the bit image in the horizontal direction.

The number of dots is calculated by nL + nH × 256.

• If the bit-image data input exceeds the number of dots to be printed on a line, the

excess data is ignored.

• d indicates the bit-image data. Set a corresponding bit to 1 to print a dot or to 0 to not

print a dot.

• 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):

_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.

• 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.

• The relationship between the image data and the dots to be printed is as follows:

• When 8-dot bit image is selected:

• When 24-dot bit image is selected:

ESC - n

[Name] Turn underline mode on/off

[Format] ASCII ESC - n

Hex 1B 2D n

Decimal 27 45 n

[Range] 0 ≤ n ≤2, 48 ≤n ≤ 50

[Description] Turns underline mode on or off, based on the following values of n:

n Function

0, 48 Turns off underline mode

1, 49 Turns on underline mode ( 1-dot thick )

2, 50 Turns on underline mode (2-dot thick )

[Notice] • 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 id 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.

• Underline mode can also be turned on or off by using ESC !. Note, however, that

the last received command is effective.

• This command does not affect the setting of Chinese characters.

[Default] n = 0

[Reference] ESC !

ESC 2

[Name] Select default line spacing

[Format] ASCII ESC 2

Hex 1B 32

Decimal 27 50

[Description] Selects 1/6-inch line (approximately 4.23mm) spacing.

[Notice] 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 1B 33 n

Decimal 27 51 n

[Range] 0 ≤ n ≤ 255

[Description] Sets the line spacing to [ n ⋅ vertical or horizontal motion unit] inches. [Notice]

• The line spacing can be set independently in standard mode and in page mode.

• The horizontal and vertical motion unit are specified by GS P. Changing the

horizontal or vertical motion unit does not affect the current line spacing.

• The GS P command can change the horizontal (and vertical) motion unit.

However, the value cannot be less than the minimum vertical movement amount, and

it must be in even units of the minimum vertical movement amount.

• In standard mode, the vertical motion unit (y) is used.

• In page mode, this command functions as follows, depending on the starting position

of the printable area:

① 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.

_ When the starting position is set to the upper right or lower left of the printable

area using ESC T, the horizontal motion unit ( x) is used.

• The maximum paper feed amount is 1016 mm (40 inches). Even if a paper feed

amount of more than 1016 mm (40 inches) is set, the printer feeds the paper only

1016 mm (40 inches).

[Default] Line spacing equivalent to approximately 4.23mm (1/6 inches).

[Reference] ESC 2, GS P

ESC = n

[Name] Set peripheral device

[Format] ASCII ESC = n

Hex 1B 3D n

Decimal 27 61 n

[Range] 0≤ n ≤ 1

[Description] Selects device to which host computer sends data, using n as follows:

Bit 1/0 Hex Decimal Function

0 00 0 Printer disabled 0

1 01 1 Printer enabled

1-7 Undefined

[Notice] • When the printer is disabled, it ignores all data except for error-recovery commands (DLE

EOT, DLE ENQ, DLE DC4) until it is enabled by this command.

[Default] n = 1

ESC ? n

[Name] Cancel user-defined characters

[Format] ASCII ESC ? n

Hex 1B 3F n

Decimal 27 63 n

[Range] 32 ≤n ≤126

[Description] Cancels user-defined characters.

[Notice] • This command cancels the pattern defined for the character code specified by n. After

19

the user-defined characters is canceled, the corresponding pattern for the internal

character is printed.

• This command deletes the pattern defined for the specified code in the font selected

by ESC !.

• If a user-defined character has not been defined for the specified character code, the

printer ignores this command.

[Reference] ESC &, ESC %

ESC @

[Name] Initialize printer

[Format] ASCII ESC @

Hex 1B 40

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.

[Notice] • The DIP switch settings are not checked again.

• The data in the receive buffer is not cleared.

• The macro definition is not cleared.

• The flash bit image data is not cleared.

• The data of the user flash memory is not cleared.

• The setting of GS ( E indicated is not cleared.

ESC D n1...nk NUL

[Name] Set horizontal tab position

[Format] ASCII ESC D n1... nk NUL

Hex 1B 44 n1...nk 00

Decimal 27 68 n1...nk 0

[Range] 1 ≤ n1 ≤n2 ≤…≤nk≤ 255

0 ≤ k ≤ 32

[Description] Sets horizontal tab position

·• 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.

[Notice] • 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

ESC J n

[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 × vertical or horizontal

motion unit] inches.

[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.

• The horizontal and vertical motion unit are specified by GS P.

• The GS P command can change the vertical (and horizontal) motion unit. However,

the value cannot be less than the minimum vertical movement amount, and it must be

in even units of the minimum vertical movement amount.

• In standard mode, the printer uses the vertical motion unit ( y).

• In page mode, this command functions as follows, depending on the starting position

of the printable area:

_ 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.

_ When the starting position is set to the upper right or lower left of the printable

area using ESC T, the horizontal motion unit ( x) is used.

• The maximum line spacing is 1016mm (40 inches). When the setting value exceeds

the maximum, it is converted to the maximum automatically.

[Reference] GS P

ESC L

[Name] Select page mode

[Format] ASCII ESC L

Hex 1B 4C

Decimal 27 76

[Description] Switches from standard mode to page mode.

[Notice] • This command is enabled only when processed at the beginning of a line in standard

mode.

• This command has no effect in page mode.

• After printing by FF is completed or by using ESC S, the printer returns to standard

mode.

• This command sets the position where data is buffered to the position specified by

ESC T within the printing area defined by ESC W.

• 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 page mode:

_ Set right-side character spacing: ESC SP, FS S

_ Select default line spacing: ESC 2, ESC 3

• Only valve settings is possible for the following commands in page mode; these

commands are not executed.

_ Turn 90° clockwise rotation mode on/off: ESC V

_ Select justification: ESC a

_ Turn upside-down printing mode on/off: ESC {

_ Set left margin: GS L

_ Set printable area width: GS W

•The following command is ignored in page mode:

_ Execute test print: GS ( A

• The following command is not available in page mode:

_ Print NV bit image: FS p

_ Define NV bit image: FS q

_ Write to user NV memory: FS g 1

_ Print raster bit image: GS v 0

• The printer returns to standard mode when power is turned on, the printer is reset, or

ESC @ is used.

[Reference] FF, CAN, ESC FF, ESC S, ESC T, ESC W, GS $, GS \

ESC M n

[Name] Select character font

[Format] ASCII ESC M n

Hex 1B 4D n

Decimal 27 77 n

[Range] n = 0, 1,48, 49

[Description] Selects character font

n Function

0,48 Character font A (12 × 24) selected.

1,49 Character font B (9 × 17) selected.

[Default] n = 0

ESC R n

[Name] Select international character set

[Format] ASCII ESC R n

Hex 1B 52 n

Decimal 27 82 n

[Range] 0 ≤n ≤ 15

[Description] Select the international character set n from the list below

n Character Set

0 U.S.A.

1 France

2 Germany

3 U.K.

4 DenmarkⅠ

5 Sweden

6 Italy

7 Spain Ⅰ

8 Japan

9 Norway

10 Denmark Ⅱ

11 Spain Ⅱ

12 Latin

13 Korea

14 Slovenia/Croatia

15 China

[Default] n = 15 [Simplified Chinese]

n = 0 [Other characters except simplified Chinese]

[Reference]

ESC S

[Name] Select standard mode

[Format] ASCII ESC S

Hex 1B 53

Decimal 27 83

[Description] Select standard mode

[Notice] Switches from page mode to standard mode.

• This command is effective only in page mode.

• Data buffered in page mode are cleared.

• This command sets the print position to the beginning of the line.

• The printing area set by ESC W are initialized.

• 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, FS S

_ Select default line spacing: ESC 2, ESC 3

• The following commands are enabled only to set in standard mode.

_ Set printing area in page mode: ESC W

_ Select print direction in page mode: ESC T

• The following commands are ignored in standard mode.

_ Set absolute vertical print position in page mode: GS $

_ Set relative vertical print position in page mode: GS \

• Standard mode is selected automatically when power is turned on, the printer is reset, or

command ESC @ is used.

[Reference] FF, ESC FF, ESC L

ESC T n

[Name] Select print direction in page mode

[Format] ASCII ESC T n

Hex 1B 54 n

Decimal 27 84 n

[Range] 0 ≤ n ≤ 3 48 ≤ n ≤ 51

[Description] Selects the print direction and starting position in page mode.

n specifies the print direction and starting position as follows:

[Notice] • When the command is input in standard mode, the printer executes only internal flag

operation. This command does not affect printing in standard mode.

• This command sets the position where data is buffered within the printing area set by

ESC W.

• Parameters for horizontal or vertical motion units ( x or y) differ as follows, depending

on the starting position of the printing area:

① If the starting position is the upper left or lower right of the printing area, data

is

buffered in the direction perpendicular to the paper feed direction:

Commands using horizontal motion units: ESC SP, ESC $, ESC \

Commands using vertical motion units: ESC 3, ESC J, GS $, GS \

② If the starting position is the upper right or lower left of the printing area, data

is

buffered in the paper feed direction:

Commands using horizontal motion units: ESC 3, ESC J, GS $, GS \

Commands using vertical motion units: ESC SP, ESC $, ESC \

[Default] n = 0

[Reference] ESC $, ESC L, ESC W, ESC \, GS $, GS P, GS \

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 ≤ 2, 48 ≤ n ≤ 50

[Description] Turns 90° clockwise rotation mode on/off

n is used as follows:

n Function

0,48 Turn off 90°clockwise rotation mode

1,49

2,50

Turn off 90°clockwise rotation mode

[Notice] • This command affects printing in standard mode. However, the setting is always

effective.

• When underline mode is turned on, the printer does not underline

90° clockwise-rotated.

• Double-width and double-height commands in 90° rotation mode enlarge characters

in the opposite directions from double-height and double- width commands in normal

mode.

[Default] n = 0

[Reference] ESC !,,,, ESC -

ESC W xL xH yL yH dxL dxH dyL dyH

[Name] Set printing area in page mode

[Format] ASCII ESC W xL xH yL yH dxL dxH dyL dyH

Hex 1B 57 xL xH yL yH dxL dxH dyL dyH

Decimal 27 87 xL xH yL yH dxL dxH dyL dyH

[Range] 0 ≤ xL, xH, yL, yH, dxL, dxH, dyL, dyH ≤ 255 (except dxL= dxH=0 or dyL=

dyH=0)

[Description] • The horizontal starting position, vertical starting position, printing area width, and

printing area height are defined as x0, y0, dx (inch), dy (inch), respectively. Each

setting for the printing area is calculated as follows:

x0 = [( xL + xH × 256) × (horizontal motion unit)]

y0 = [( yL + yH × 256) × (vertical motion unit)]

dx = [ dxL + dxH × 256) × (horizontal motion unit)]

dy = [ dyL + dyH × 256) × (vertical motion unit)]

The printing area is set as shown in the figure below.

[Notice] • If this command is input in standard mode, the printer executes only

internal flag

operation. This command does not affect printing in standard mode.

• If the horizontal or vertical starting position is set outside the printable area, the

printer stops command processing and processes the following data as normal

data.

• If the printing area width or height is set to 0, the printer stops command

processing

and processes the following data as normal data.

• This command sets the position where data is buffered to the position specified by

ESC T within the printing area.

• If (horizontal starting position + printing area width) exceeds the printable area, the

printing area width is automatically set to (horizontal printable area- horizontal

starting

position).

• If (vertical starting position + printing area height) exceeds the printable area, the

printing area height is automatically set to (vertical printable area – vertical starting

position).

• The horizontal and vertical motion unit are specified by GS P. Changing the horizontal or

vertical motion unit does not affect the current printing area.

• The GS P command can change the horizontal (and vertical) motion unit. However, the

value cannot be less than the minimum horizontal movement amount, and it must be in

even units of minimum horizontal movement amount.

• Use the horizontal motion unit ( x) for setting the horizontal starting position and

printing area width, and use the vertical motion unit ( y) for setting the vertical starting

position and printing area height.

• When the horizontal starting position , vertical starting position, printing area width, and

printing area height are defined as X, Y, Dx, and Dy respectively, the printing area is set

as shown in the figure below.

[Default] xL = xH = yL = yH = 0

dxL = 0, dxH = 2, dyL = 126, dyH = 6

For 58 mm paper width model;

dxL = 104, dxH = 1

[Reference] CAN, ESC L, ESC T, GS P

ESC \ nL nH

[Name] Set relative 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 print starting position based on the current position by using the horizontal

or vertical motion unit.

• This command sets the distance from the current position to [( nL + nH × 256)

× horizontal or vertical motion unit]

[Notice] • Any setting that exceeds the printable area is ignored.

• When pitch N is specified to the right:

nL+ nH × 256 = N

When pitch N is specified to the left (the negative direction), use the complement of

65536.

When pitch N is specified to the left:

nL+ nH × 256 = 65536 - N

• The print starting position moves from the current position to [ N × horizontal or

vertical motion unit]

• The horizontal and vertical motion unit are specified by GS P.

• The GS P command can change the horizontal (and vertical) motion unit. However,

the value cannot be less than the minimum horizontal movement amount, and it must

be in even units of the minimum horizontal movement amount.

• In standard mode, the horizontal motion unit is used.

• In page mode, the horizontal or vertical motion unit differs as follows, depending on

the starting point of the printing area:

_ When the starting position is set to the upper left or lower right of the printable area

using ESC T, the horizontal motion unit ( x) is used.

_ When the starting position is set to the upper right or lower left of the printable area

using ESC T, the vertical motion unit ( y) is used.

[Reference] ESC $, GS P

ESC a n

[Name] Select justification

[Format] ASCII ESC a n

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

[Notice] • 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 has no effect in page mode.

• This command executes justification in the printing area.

• This command justifies the space area according to HT, ESC $ or ESC \.

[Default] n = 0

[Example]

ESC c 3 n

[Name] Selecting paper sensor will be output paper end signal

[Format] ASCII ESC c 3 n

Hex 1B 63 33 n

Decimal 27 99 51 n

[Range] 0 ≤ n ≤ 255

[Description] Selecting paper sensor will be output paper end signal

·n is used as follows:

位位位位 0/1 Hex Decimal Function

0 00 0 Paper near end sensor invalidation 0

1 01 1 Paper near end sensor invalidation

0 00 0 Paper near end sensor invalidation 1

1 02 2 Paper near end sensor invalidation

0 00 00 Paper end sensor invalidation 2

1 04 4 Paper end sensor availability

0 00 00 Paper end sensor invalidation 3

1 08 8 Paper end sensor availability

4-7 Undefined

[Notice] This command may select two sensors to be output paper end signal, if any one

sensor will be selected, the printer will check the paper end, then it will be output

paper end signal.

This command will be availability for parallel interface, serial interface is invalidly

If make the “0” bit or the “1” bit as number “1” for “n”, then the paper near end

sensor will be output paper near end snsor.

If make the “2” bit or the “3” bit as number “1” for “n”, then the paper end sensor will

be output paper near end snsor .

When two sensors are forbidden, the paper end signal of parallel interface will be

output the signal of paper well.

[Default] n = 15

ESC c 4 n

[Name] Select paper sensor(s) to stop printing

[Format] ASCII ESC c 4 n

Hex 1B 63 34 n

Decimal 27 99 52 n

[Range] 0 ≤ n ≤ 255

[Description] Select paper sensor(s) to stop printing

· n is used as follows:

Bit 0/1 Hex Decimal Function

0 00 0 Paper near end sensor invalidation 0

1 01 1 Paper near end senso availability

0 00 0 Paper near end sensor invalidation 1

1 02 2 Paper near end senso availability

2-7 Undefined

[Notice] When make the “0” bit or the “1” bit as number “1” for “n”, then the paper near

end sensor availability, paper near end senso availability, when the printer check

paper near end, After finished printing task, printer stops to print, then the printer

will be offline.

[Default] n = 0

ESC c 5 n

[Name] Enable/disable panel button

[Format] ASCII ESC c 5 n

Hex 1B 63 35 n

Decimal 27 99 53 n

[Range] 0 ≤ n ≤ 255

[Description] Enable/disable panel button

• When the LSB of n is 0, the panel buttons are enabled.

• When the LSB of n is 1, the panel buttons are disabled.

[Notice] • Only the lowest bit of n is valid.

• When the panel buttons are disabled, none of them are usable when the printer cover is

closed.

• In this printer, the panel buttons are the FEED button.

• In the macro ready mode, the FEED button are enabled regardless of the settings of this

command; however, the paper cannot be fed by using these buttons.

[Default] n = 0

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.

[Notice] • 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 1016 mm (40 inches). If the paper feed amount ( nx

line spacing) of more than 1016 mm (40 inches) is specified, the printer feeds the paper

only 1016 mm (40 inches).

[Reference] ESC 2, ESC 3

ESC p m t1 t2

[Name] Generate Drawer kick-out connector pulse

[Format] ASCII ESC p m t1 t2

Hex 1B 70 m t1 t2

Decimal 27 112 m t1 t2

[Range] m = 0, 1, 48, 49

0 ≤ t1 ≤ 255, 0 ≤ t2 ≤ 255

[Description] Outputs the pulse specified by t1 and t2 to connector pin m as follows:

m Connector Pin

0, 48 Cash drawer kick-out connector pin 2

1, 49 Cash drawer kick-out connector pin 5

[Notice] • The pulse ON time is [ t1 × 2 ms] and the OFF time is [ t2 × 2 ms].

• If t2 < t1, the OFF time is [ t1 × 2 ms]

[Reference] DLE DC4

ESC t n

[Name] Selecting character code page

[Format] ASCII ESC t n

Hex 1B 74 n

Decimal 27 116 n

[Range] 0 ≤n ≤ 255

[Description] Select character code page n from the list below:

N Code page Code Page

0 CP437 [美国,欧洲标准] CP437 [U.S.A., Standard Europe]

1 KataKana [片假名] Katakana

2 PC850 [多语言] PC850 [Multilingual]

3 PC860 [葡萄牙] PC860 [Portuguese]

4 PC863 [加拿大-法语] PC863 [Canadian-French]

5 PC865 [北欧] PC865 [Nordic]

6 WCP1251 [斯拉夫语] WCP1251 [Cyrillic]

7 CP866 斯拉夫2 CP866 Cyrilliec #2

8 MIK[斯拉夫/保加利亚] MIK[Cyrillic /Bulgarian]

9 CP755 [东欧,拉脱维亚 2] CP755 [East Europe,Latvian 2]

10 [伊朗,波斯] Iran

11 保留 reserve

12 保留 reserve

13 保留 reserve

14 保留 reserve

15 CP862 [希伯来] CP862 [Hebrew]

16 WCP1252 [拉丁语 1] WCP1252 Latin I

17 WCP1253 [希腊] WCP1253 [Greek]

18 CP852 [拉丁语 2] CP852 [Latina 2]

19 CP858 [多种语言拉丁语 1+

欧元符]

CP858 Multilingual Latin Ⅰ+Euro)

20 伊朗Ⅱ[波斯语] Iran II

21 拉脱维亚 Latvian

22 CP864 [阿拉伯语] CP864 [Arabic]

23 ISO-8859-1 [西欧] ISO-8859-1 [West Europe]

24 CP737 [希腊] CP737 [Greek]

25 WCP1257 [波罗的海] WCP1257 [Baltic]

26 [泰文1] Thai 1

27 CP720[阿拉伯语] CP720[Arabic]

28 CP855 CP855

29 CP857[土耳其语] CP857[Turkish]

30 WCP1250[中欧] WCP1250[Central Eurpoe]

31 CP775 CP775

32 WCP1254[土耳其语] WCP1254[Turkish]

33 WCP1255[希伯来语] WCP1255[Hebrew]

34 WCP1256[阿拉伯语] WCP1256[Arabic]

35 WCP1258[越南语] WCP1258[Vietnam]

36 ISO-8859-2[拉丁语2] ISO-8859-2[Latin 2]

37 ISO-8859-3[拉丁语3] ISO-8859-3[Latin 3]

38 ISO-8859-4[波罗的语] ISO-8859-4[Baltic]

39 ISO-8859-5[斯拉夫语] ISO-8859-5[Cyrillic]

40 ISO-8859-6[阿拉伯语] ISO-8859-6[Arabic]

41 ISO-8859-7[希腊语] ISO-8859-7[Greek]

42 ISO-8859-8[希伯来语] ISO-8859-8[Hebrew]

43 ISO-8859-9[土耳其语] ISO-8859-9[Turkish]

44 ISO-8859-15[拉丁语9] ISO-8859-15 [Latin 3]

45 [泰文2] Thai2

46 CP856 CP856

[Default] n = 0

[Reference]

ESC { n

[Name] Turns on/off upside-down printing mode

[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.

[Notice] • Only the lowest bit of n is valid.

• This command is enabled only when processed at the beginning of a line in standard

mode.

• 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 g 1 m a1 a2 a3 a4 nL nH d1 … dk

[Name] Define the NV user’s memory

[Format] ASCII FS g 1 m a1 a2 a3 a4 nL nH d1 … dk

Hex 1C 67 31 m a1 a2 a3 a4 nL nH d1 … dk

Decimal 28 103 49 m a1 a2 a3 a4 nL nH d1 … dk

[Range] m = 0

0 ≤ (a1 + a2 × 256 + a3 × 65536 + a4 × 16777216) ≤ 1023

(0 ≤ a1 ≤ 255, 0 ≤ a2 ≤ 3, a3 = 0, a4 = 0)

1 ≤ (nL + nH × 256) ≤ 1024 (0 ≤ nL ≤ 255, 0 ≤ nH ≤ 4)

32 ≤ d ≤ 255

k = (nL + nH × 256)

Total memory capacity = 1KB.

[Description] · Store (nL + nH × 256)byte data (d1...dk) to the NV user’s memory whichi

begins with (a1 + a2 × 256 + a3 × 65536 + a4 ×16777216)

[Notice] ·Carrying out the command of NV memory frequently will damage it,writing 10 times

of NV memory a day is recommended.

· When the printer is carrying out this command,power off or reset the printer

through interface will make the printer enter abnormal state.So please do not do those

when the printer is carrying out this command.

· When the printer is carrying out this command and writing data into NV

memory,the state of the printer will change into busy and stop receiving data.So when

the printer is busy,please do not send data to the printer,including real-time command.

FS g 2 m a1 a2 a3 a4 nL nH

[Name] Read the NV user’s memory

[Format] ASCII FS g 2 m a1 a2 a3 a4 nL nH

Hex 1C 67 32 m a1 a2 a3 a4 nL nH

Decimal 28 103 50 m a1 a2 a3 a4 nL nH

[Range] m = 0

0 ≤ (a1 + a2 × 256 + a3 × 65536 + a4 × 16777216) ≤ 1023

(0 ≤ a1 ≤ 255, 0 ≤ a2 ≤ 3, a3 = 0, a4 = 0)

1 ≤ (nL + nH × 256) ≤ 80 (0 ≤ nL ≤ 80, nH = 0)

[Description] · Send the byte data (nL + nH× 256) begins with (a1 + a2 × 256 + a3 × 65536 + a4

×16777216)

[Notice] · Don’t make PC to send any other data before this command finishing sending data.

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 ≤ 8, 1 ≤ horizontal number of times ≤ 8)

[Description] Selects the character height using bits 0 to 2 and selects the character width

using bits 4 to 7, as follows:

BIt 0/1 Hex Decimal Function

0-3 Character height selection, see table 1

4-7 Character width selection, see table 2

表表表表 1 表表表表 2

Character height selection Character height selection

Hex Decimal Height Hex Decimal Width

00 0 1 (normal) 00 0 1 (normal)

01 1 2 (double-height) 10 16 2 (double-width)

02 2 3 20 32 3

03 3 4 30 48 4

04 4 5 40 64 5

05 5 6 50 80 6

06 6 7 60 96 7

07 7 8 70 112 8

[Notice] • This command is all characters (alphanumeric and Chinese) 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.

• 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 $ nL nH

[Name] Set absolute vertical print position in page mode

[Format] ASCII GS $ nL nH

Hex 1D 24 nL nH

Decimal 29 36 nL nH

[Range] 0 ≤ nL ≤ 255, 0 ≤ nH ≤ 255

[Description] • Sets the absolute vertical print starting position for buffer character data in page mode.

• This command sets the absolute print position to [( nL + nH × 256) × (vertical or

horizontal motion unit)] inches.

[Notice] • This command is effective only in page mode.

• If the [( nL + nH × 256) × (vertical or horizontal motion unit)] exceeds the specified

printing area, this command is ignored.

• The horizontal starting buffer position does not move.

• The reference starting position is that specified by ESC T.

• This command operates as follows, depending on the starting position of the printing

area specified by ESC T:

_ When the starting position is set to the upper left or lower right, this command sets the

absolute position in the vertical direction.

_ When the starting position is set to the upper right or lower left, this command sets the

absolute position in the horizontal direction.

• The horizontal and vertical motion unit are specified by GS P.

• The GS P command can change the horizontal and vertical motion unit.

However, the value cannot be less than the minimum horizontal movement amount, and it

must be in even units of the minimum horizontal movement amount.

[Reference] ESC $, ESC T, ESC W, ESC \, GS P, GS \

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≤ 3, 49 ≤ m ≤ 51

[Description] • Executes a test print with a specified test pattern on a specified paper.

• pL and pH specifies the number of the parameter such as n, m to ( pL + ( pH ×

256)) bytes.

n specifies the paper to be tested.

n Paper Type

0, 48 Basic type (roll paper)

1, 49

2, 50

Roll paper

m specifies printing content

[Notice] • This command is enabled only when processed at the beginning of a line in

standard mode.

• This command is no effect in page mode.

• When this command is received during macro definition, the printer ends macro

definition and begins performing 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 userdefined

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. The

printer also re-reads the DIP switch settings .

• The printer cuts the paper at the end of the test print.

• The printer goes BUSY while this command is executed.

GS ( D pL pH m [a1 b1] … [ak bk]

[Name] Permitting/Forbidding real-time command

[Format] ASCII GS ( D pL pH m [a1 b1] … [ak bk]

Hex 1D 28 44 pL pH m [a1 b1] … [ak bk]

Decimal 29 40 68 pL pH m [a1 b1] … [ak bk]

[Range] 3 ≤ (pL + pH × 256) ≤ 65535 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)

m = 20

a = 1, 2

b = 0, 1, 48, 49

[Description] · To confirm permitting/forbidding real-time command through a

· pL,pH(pL+pH×256)specify the number of byte after(m,[a1 b1]…[ak bk])。

a b Function

0, 48 DLE DC4 fn m t (fn = 1):No treatment(Forbid) 1

1, 49 DLE DC4 fn m t (fn = 1):Treatment(Permit)

0, 48 DLE DC4 fn a b (fn = 2): No treatment(Forbid) 2

1, 49 DLE DC4 fn a b (fn = 2): Treatment(Permit)

[Notice] · If the bitmap data including the same data string with DLE DC4 (fn = 1 or 2),we

suggest to use this command to prihibit real-time command in advance.

GS ( E pL pH fn [parameters]

[Name] Setting users’ installed command

[Format] ASCII GS ( E pL pH fn [parameters]

Hex 1D 28 45 pL pH fn [parameters]

Decimal 29 40 69 pL pH fn [parameters]

[Description] ·Controling users’ setting mode.

· pL,pH(pL+pH×256)specify the number of byte afer pH(fn,[parameter])。

· fn specifies the function

· [parameter] specifies the treatment of every function.

fn Format Function

no.

Name

1 GS ( E pL pH fn d1 d2 1 Entry user setting mode

2 GS ( E pL pH fn d1 d2 d3 2 Ending user setting mode

5 GS ( E pL pH fn [a1 n1L n1H] ...

[ak nkL nkH]

5 Setting the user’s setting

value

6 GS ( E pL pH fn a 6 Sending the user’s setting

value

11 GS ( E pL pH fn a d1…dk 11 Setting the configuration

item of serial

12 GS ( E pL pH fn a 12 Sending the configuration

item of serial

[Notice] ·Carrying out the command of writing in NV memory frequently will damage it,writing

10 times of NV memory a day is recommended.

·When the printer is carrying out this command,power off or reset the printer through

interface will make the printer enter abnormal state.So please do not do those when

the printer is carrying out this command.

· When the printer is carrying out this command and writing data into NV

memory,the state of the printer will change into busy and stop receiving data.So

when the printer is busy,please do not send data to the printer,including real-time

command.

· When using <Function 1、6 or12> to send data,before it is over,don’t make PC to

send other data

<Function 1 > GS ( E pL pH fn d1 d2 ( fn=1)

[Name] Entry users setting mode

[Format] ASCII GS ( E pL pH fn d1 d2

Hex 1D 28 45 pL pH fn d1 d2

Decimal 29 40 69 pL pH fn d1 d2

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

fn = 1

d1 = 73

d2 = 78

[Description] · Enter user setting mode and send back the notice of mode changing.

<Function 2 > GS ( E pL pH fn d1 d2 d3 ( fn=2)

[Name] Ending user setting mode

[Format] ASCII GS ( E pL pH fn d1 d2 d3

Hex 1D 28 45 pL pH fn d1 d2 d3

Decimal 29 40 69 pL pH fn d1 d2 d3

[Range] (pL + pH × 256) = 4 (pL = 4, pH = 0)

fn = 2

d1 = 79

d2 = 85

d3 = 84

[Description] ·Ending user setting mode and resetting the software.

· Clearing the receiving and printing buffer.

· Resetting all the setting value influenced by powering on in RAM(Printing Range、

font and other setting),(It does not influence the data in NV memroy)

GS ( E pL pH fn [a1 n1L n1H]…[ak nkL nkH] ( fn=5)

[Name] Setting the user’s setting value

[Format] ASCII GS ( E pL pH fn [a1 n1L n1H] ... [ak nkL nkH]

Hex 1D 28 45 pL pH fn [a1 n1L n1H] ... [ak nkL nkH]

Decimal 29 40 69 pL pH fn [a1 n1L n1H] ... [ak nkL nkH]

[Range] 4 ≤ (pL + pH × 256) ≤ 65533 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)

fn = 5

a = 5, 6, 97, 116, 118

0 ≤ (nL + nH × 256) ≤ 6, (nL + nH × 256) = 100, 65530 ≤ (nL + nH × 256) ≤ 65535

(0 ≤ nL ≤ 6, nH = 0, nL = 100, nH = 0, 250 ≤ nL ≤ 255, nH = 255) [when a = 5]

1 ≤ (nL + nH × 256) ≤ 9 (1 ≤ nL ≤ 9, nH = 0) [when a = 6]

(nL + nH × 256) = 1, 2, 4, 128 (nL = 1,2,4,128, nH = 0) [when a = 97]

(nL + nH × 256) = 1, 257 (nL = 1, nH = 0,1) [when a = 116]

(nL + nH × 256) = 70, 85 (nL = 70,85, nH = 0) when a = 118]

[Description] · Setting the user’s setting value as the value of (nL + nH × 256).

a Type of user’s value

5 Printing Density

6 Printing Speed

97 Number of zone heating of thermal head

116 Printing control(single or double color)

118 Density of black in double color printing

· Setting printing density(a=5)

(nL + nH × 256) Printing Density

100 Setting printing density according to DIP switch setting

65530 Select Density Level1 Light

65531 Select Density Level 2 |

65532 Select Density Level 3 |

65533 Select Density Level 4 |

65534 Select Density Level 5 |

65535 Select Density Level 6 |

0 Select Density Level 7 Standard

1 Select Density Level 8 |

2 Select Density Level 9 |

3 Select Density Level 10 |

4 Select Density Level 11 |

5 Select Density Level 12 |

6 Select Density Level 13 Dark

· Setting Printing Speed(a=6)

(nL + nH × 256) Printing Speed

1 Select Speed Level 1 Slow

2 Select Speed Level 2 |

3 Select Speed Level 3 |

4 Select Speed Level 4 |

5 Select Speed Level 5 |

6 Select Speed Level 6 |

7 Select Speed Level 7 |

8 Select Speed Level 8 |

9 Select Speed Level 9 Fast

· Setting frequency of zone heating of thermal head(a=97)

(nL + nH × 256) frequency of zone heating of thermal head

1 One time heating

2 Two times heating

4 Four times heating

128 Automatic control frequency of zone heating

· Printing control(Single or double color)(a=116)

(nL + nH × 256) Printing Control

1 Single color printing control

257 Double color printing control

· When select double color printing,prohibiting use the single color thermal paper.

· Density of black in double color printing(a=118

(nL + nH × 256) Black Density

70 Light

85 Standard

· Black density is only valid under double color printing mode

[Default] (nL + nH × 256) = 100 (nL = 100, nH = 0) [When a = 5]

(nL + nH × 256) = 9 (nL = 9, nH = 0) [When a = 6]

(nL + nH × 256) = 128 (nL = 128, nH = 0) [When a = 97]

(nL + nH × 256) = 1 (nL = 1, nH = 0) [When a = 116]

(nL + nH × 256) = 85 (nL = 85, nH = 0) [When a = 118]

GS ( E pL pH fn a ( fn=6)

[Name] Sending user’s setting value

[Format] ASCII GS ( E pL pH fn a

Hex 1D 28 45 pL pH fn a

Decimal 29 40 69 pL pH fn a

[Range] (pL + pH × 256) = 2 ( pL = 2, pH =0)

fn = 6

a = 5, 6, 97, 116, 118

[Description] · Sending user’s setting value confirmed by a.

a Type of user’s setting value

5 Printing thickness

6 Printing speed

97 The number of pyrogenation in every

part for thermal head

116 Printing control ( homochromy or double

color )

118 The thickness of black in double color

printing

GS ( E pL pH fn a d1 … dk ( fn=11)

[Name] 设置串口的配置项

[Format] ASCII GS ( E pL pH fn a d1 …dk

Hex 1D 28 45 pL pH fn a d1 …dk

Decimal 29 40 69 pL pH fn a d1 …dk

[Range] 3 ≤ (pL + pH × 256) ≤ 65533 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)

fn = 11

a = 1

48 ≤ d ≤ 57

[Description] Setting COM a ·scheme option as d numerical value

a Scheme option

1 Transfer speed

·Transfer speed setting(a=1)

d1 … dk Transfer speed

“2400” 2400 bps

“4800” 4800 bps

“9600” 9600 bps

“19200” 19200 bps

“38400” 38400 bps

“57600” 57600 bps

“115200” 115200 bps

[Notice] This scheme of function setting, it need to execute GS ( E or reset the printer to

make printer with activation. Noted the printer must communicate the host device.

[Default] · d1...dk = “38400”。

<Function 12 > GS ( E pL pH fn a ( fn=12)

[Name] Transfer COM port scheme option

[Format] ASCII GS ( E pL pH fn a

Hex 1D 28 45 pL pH fn a

Decimal 29 40 69 pL pH fn a

[Range] (pL + pH × 256) =2 ( pL = 2, pH = 0)

fn = 12

a = 1

[Description] ·Transfer COM port scheme option, a pointed

a Scheme option

1 Transfer speed

GS ( H pL pH fn [parameters]

[Name] 请求传送响应或状态

[Format] ASCII GS ( H pL pH fn [parameters]

Hex 1D 28 48 pL pH fn [parameters]

Decimal 29 40 72 pL pH fn [parameters]

[Description] · 不同处理标志(ID)的响应。

· pL,pH(pL+pH×256)表示pH后的字节数(fn,[parameter])。

· fn 表示功能。

· [parameter] 表示每种功能的处理。

fn Format 功能号 功能Name

48 GS ( H pL pH fn m d1 d2 d3 d4 48 设置处理标志(ID)的响应

[Notice] · 不要在用OPOS或JavaPOS驱动控制打印机的系统中使用该指令。

<Function 48 > GS ( H pL pH fn m d1 d2 d3 d4 ( fn=48)

[Name] 设置处理标志(ID)的响应

[Format] ASCII GS ( H pL pH fn m d1 d2 d3 d4

Hex 1D 28 48 pL pH fn m d1 d2 d3 d4

Decimal 29 40 72 pL pH fn m d1 d2 d3 d4

[Range] (pL + pH × 256) = 6 (pL = 6, pH = 0)

fn = 48

m = 48

32 ≤ d ≤ 126

[Description] · 保存由(d1,d2,d3,d4)表示的执行标志(ID),返回该标志时,表示刚好

在这 功能之前的数据已执行完。

GS ( K pL pH fn [parameters]

[Name] 选择打印控制方式

[Format] ASCII GS ( K pL pH fn [parameters]

Hex 1D 28 4B pL pH fn [parameters]

Decimal 29 40 75 pL pH fn [parameters]

[Description] · 选择打印控制方式。

· pL,pH(pL+pH×256)表示pH后的字节数(fn,[parameter])。

· fn 表示功能。

· [parameter] 表示每种功能的处理。

fn Format 功能号 功能Name

50 GS ( K pL pH fn m 50 选择打印速度

97 GS ( K pL pH fn m 97 选择热敏头的分段加热数

<Function 50 > GS ( K pL pH fn m ( fn=50)

[Name] 选择打印速度

[Format] ASCII GS ( K pL pH fn m

Hex 1D 28 4B pL pH fn m

Decimal 29 40 75 pL pH fn m

[Range] (pL + pH × 256) = 2 (pL = 2, pH = 0)

fn = 50

0 ≤ m ≤ 9, 48 ≤ m ≤ 57

[Description] · 选择打印速度。

m 打印速度

0,48 指令GS ( E <功能 5:a=6>设置的值

1,49 选择速度级别1 慢

2,50 选择速度级别2 |

3,51 选择速度级别3 |

4,52 选择速度级别4 |

5,53 选择速度级别5 |

6,54 选择速度级别6 |

7,55 选择速度级别7 |

8,56 选择速度级别8 |

9,57 选择速度级别9 快

[Notice] · 当选择低功耗模式时,忽略上面的设置值。

[Default] m = 0 (指令GS ( E <功能 5:a=6>设置的值)

<Function 97 > GS ( K pL pH fn m ( fn=97)

[Name] 选择热敏头的分段加热次数

[Format] ASCII GS ( K pL pH fn m

Hex 1D 28 4B pL pH fn m

Decimal 29 40 75 pL pH fn m

[Range] (pL + pH × 256) = 2 (pL = 2, pH = 0)

fn = 97

0 ≤ m ≤ 2, 48 ≤ m ≤ 50,m = 4,52,128

[Description] · 选择热敏头的分段加热次数。

m 打印速度

0,48 指令GS ( E <功能 5:a=97>设置的值

1,49 分1次加热

2,50 分2次加热

4,52 分4次加热

128 自动控制分段加热次数

[Notice] · 只有选择当单色控制打印时才有效,当选择自动控制方式时,正常分1次加热方式打

印,当打印点数较多时(高负载)分2次加热打印。

· 当选择双色控制打印时,热敏头的加热方式固定为“分2次加热”。

· 当选择低功耗模式时,忽略上面的设置值。

[Default] m = 0 (指令GS ( E <功能 5:a=97>设置的值)

GS ( L pL pH m fn [parameters]

GS 8 L p1 p2 p3 p4 m fn [parameters]

[Name] 设置图形

[Format] ASCII GS ( L pL pH m fn [parameters]

Hex 1D 28 4C pL pH m fn [parameters]

Decimal 29 40 76 pL pH m fn [parameters]

ASCII GS 8 L p1 p2 p3 p4 m fn [parameters]

Hex 1D 38 4C p1 p2 p3 p4 m fn [parameters]

Decimal 29 56 76 p1 p2 p3 p4 m fn [parameters]

· 下面的Description只针对GS ( L指令来说明

· 注意:GS ( L 和 GS 8 L有相同的功能

· 如果在FormatDescription中的参数[parameters]超过了65533,就使用GS 8 L。

· GS ( L 和 GS 8 L的不同在下表中列出了,以下指令功能Description中没有关于GS

8 L的 说明,但[Range]、[Description] 、[Notice] 、[Default]]中除下表中列出的参数

外的其他参数都 是与GS ( L 相同的。

<下表中 参数表示pH或p4后的参数数量>

指令 参数 结构 最大值

GS ( L pL,pH 2字节 65,535

GS 8 L P1,p2,p3,p4 4字节 4,294,967,295

[Description] · 处理图形数据。

· pL,pH(pL+pH×256)表示pH后的字节数(m,fn,[parameter])。

· fn 表示功能。

· [parameter] 表示每种功能的处理。

fn Format 功能号 功能Name

0,48 GS ( L pL pH m fn 48 传送NV图形存贮器容量

2,50 GS ( L pL pH m fn 50 打印在打印缓冲区中的图形数据

3,51 GS ( L pL pH m fn 51 传送剩余的NV图形存贮器容量

64 GS ( L pL pH m fn d1 d2 64 传送定义的NV图形的索引码表

65 GS ( L pL pH m fn d1 d2 d3 65 删除全部NV图形数据

66 GS ( L pL pH m fn kc1 kc2 66 删除指定的NV图形数据

67 GS ( L pL pH m fn a kc1 kc2 b

xL xH yL yH [c d1...dk]1... [c

d1...dk]b

67 定义NV图形数据(光栅Format)

69 GS ( L pL pH m fn kc1 kc2 x y 69 打印指定的图形数据

112 GS ( L pL pH m fn a bx by c xL

xH yL yH d1…dk

112 存贮在打印缓冲区中的图形数据(光

栅Format)

[Notice] · 频繁写执行写NV存贮器指令可能会损坏NV存贮器,因此建议每天写NV存贮器不

要超过10次。

· 如果在执行该指令时,关闭打印机电源或通过接口复位打印机可能使打印机进入不

正常状态,因此在执行该指令时不要关闭打印机电源或从接口复位打印机。

· 打印机在执行该指令向NV NV存贮器写入数据时,打印机会变为“忙”并且停止接

收数据,因此当打印机“忙”时,主机不要再发送数据。包括实时指令

· 在用<功能 48、51或64>传送数据时,在传送完数据前,主机不要再发送其他数据。

并且要使用<功能 64>时,必须使用规定的握手协议。

<Function 48 > GS ( L pL pH m fn ( fn=0,48)

[Name] 传送NV图形存贮器容量

[Format] ASCII GS ( L pL pH m fn

Hex 1D 28 4C pL pH m fn

Decimal 29 40 67 pL pH m fn

[Range] (pL + pH × 256) = 2 (pL = 2, pH = 0)

m = 48

fn = 0,48

[Description] · 传送全部的NV图形存贮区容量(NV图形存贮区的字节数)。

<Function 50 > GS ( L pL pH m fn ( fn=2,50)

[Name] 打印在打印缓冲区中的图形数据

[Format] ASCII GS ( L pL pH m fn

Hex 1D 28 4C pL pH m fn

Decimal 29 40 67 pL pH m fn

[Range] (pL + pH × 256) = 2 (pL = 2, pH = 0)

m = 48

fn = 2,50

[Description] · 打印通过GS ( L<功能 112>处理过的在打印缓冲区中的图形数据。

<Function 51 > GS ( L pL pH m fn ( fn=3,51)

[Name] 传送剩余的NV图形存贮器容量

[Format] ASCII GS ( L pL pH m fn

Hex 1D 28 4C pL pH m fn

Decimal 29 40 67 pL pH m fn

[Range] (pL + pH × 256) = 2 (pL = 2, pH = 0)

m = 48

fn = 3,51

[Description] · 传送NV图形存贮区剩余的字节数容量。

<Function 64 > GS ( L pL pH m fn d1 d2 ( fn=64)

[Name] 传送定义的NV图形的索引码表

[Format] ASCII GS ( L pL pH m fn d1 d2

Hex 1D 28 4C pL pH m fn d1 d2

Decimal 29 40 67 pL pH m fn d1 d2

[Range] (pL + pH × 256) = 4 (pL = 4, pH = 0)

m = 48

fn = 64

d1 = 75

d2 = 67

[Description] · 传送定义的NV图形的索引码表。

<Function 65 > GS ( L pL pH m fn d1 d2 d3 ( fn=65)

[Name] 删除全部NV图形数据

[Format] ASCII GS ( L pL pH m fn d1 d2 d3

Hex 1D 28 4C pL pH m fn d1 d2 d3

Decimal 29 40 67 pL pH m fn d1 d2 d3

[Range] (pL + pH × 256) = 5 (pL = 5, pH = 0)

m = 48

fn = 65

d1 = 67

d2 = 76

d2 = 82

[Description] · 删除全部NV图形数据。

<Function 66 > GS ( L pL pH m fn kc1 kc2 ( fn=66)

[Name] 删除指定的NV图形数据

[Format] ASCII GS ( L pL pH m fn kc1 kc2

Hex 1D 28 4C pL pH m fn kc1 kc2

Decimal 29 40 67 pL pH m fn kc1 kc2

[Range] (pL + pH × 256) = 4 (pL = 4, pH = 0)

m = 48

fn = 65

32 ≤ kc1 ≤ 126

32 ≤ kc2 ≤ 126

[Description] · 删除由索引码(kc1和kc2)指定的NV图形数据。

<Function 67 >

GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c d1…dk]b ( fn=67)

[Name] 定义NV图形数据

[Format] ASCII GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c d1…dk]b

Hex 1D 28 4C pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c d1…dk]b

Decimal 29 40 67 pL pH m fn a kc1 kc2 b xL xH yL yH [c d1…dk]1…[c d1…dk]b

[Range] (pL, pH) 对于GS ( L:

12 ≤ (pL + pH × 256) ≤ 65535 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)

(p1, p2, p3, p4) 对于 GS 8 L:

12 ≤ (p1 + p2 × 256 + p3 × 65536 + p4 × 16777216) ≤ 4294967295

(0 ≤ p1 ≤ 255, 0 ≤ p2 ≤ 255, 0 ≤ p3 ≤ 255, 0 ≤ p4 ≤ 255)

GS ( L 和 GS 8 L的指令参数:

m = 48

fn = 67

a = 48

32 ≤ kc1 ≤ 126

32 ≤ kc2 ≤ 126

b = 1 [当选择单色控制打印]

b = 1, 2 [当选择双色控制打印]

1 ≤ (xL + xH × 256) ≤ 8192 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 32)

1 ≤ (yL + yH × 256) ≤ 2304 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 9)

c = 49 [当选择单色控制打印]

c = 49, 50 [当选择双色控制打印]

0 ≤ d ≤ 255

k = (int ((xL + xH × 256) + 7) / 8) × (yL + yH × 256)

总的最大存贮区容量 = 256 KB

[Description] · 定义由索引码(kc1和kc2)指定的一个存贮在NV图形区的记录的NV图形

数据。

· b表示定义的数据的颜色数量。

· xL,X表示图形横向的点数(xL + xH × 256)。

· yL,yH表示图形纵向的点数(yL + yH × 256)。

· c表示数据的颜色。

c 定义的数据的颜色(*)

49 颜色 1

50 颜色 2

(*) 颜色1为指定的双色热敏纸的黑色。

颜色2为指定的双色热敏纸的红色。

· d表示定义的数据(光栅 Format)。

[Notice] · 当没有足够的存贮容量来存贮由(xL + xH × 256) 和(yL + yH × 256)表示的 NV 图形

数据时,该功能被忽略

· 当执行该功能时占用的 NV图形数据区是:数据数量(k)+控制信息字节数(24

字节)

· NV 图形和 NV位图(FS q)不能同时定义,当执行该功能时,删除所有的 NV位图。

<Function 69 > GS ( L pL pH m fn kc1 kc2 x y ( fn=69)

[Name] 打印指定的NV图形数据

[Format] ASCII GS ( L pL pH m fn kc1 kc2 x y

Hex 1D 28 4C pL pH m fn kc1 kc2 x y

Decimal 29 40 67 pL pH m fn kc1 kc2 x y

[Range] (pL + pH × 256) = 6 (pL = 6, pH = 0)

m = 48

fn = 69

32 ≤ kc1 ≤ 126

32 ≤ kc2 ≤ 126

x = 1,2

y = 1,2

[Description] · 打印由索引码(kc1和kc2)指定的NV图形数据。

· 图形数据按 x,y来确定横向、纵向的放大倍数。

X,y 纵向 横向

1 203dpi 203dpi

2 101dpi 101dpi

<Function 112> GS ( L pL pH m fn a bx by c xL xH yL yH d1…dk ( fn=112)

[Name] 存贮NV图形数据到打印缓冲区(光栅Format)

[Format] ASCII GS ( L pL pH m fn a bx by c xL xH yL yH d1…dk

Hex 1D 28 4C pL pH m fn a bx by c xL xH yL yH d1…dk

Decimal 29 40 67 pL pH m fn a bx by c xL xH yL yH d1…dk

[Range] (pL, pH) 对于GS ( L:

12 ≤ (pL + pH × 256) ≤ 65535 (0 ≤ pL ≤ 255, 0 ≤ pH ≤ 255)

(p1, p2, p3, p4) 对于 GS 8 L:

12 ≤ (p1 + p2 × 256 + p3 × 65536 + p4 × 16777216) ≤ 4294967295

(0 ≤ p1 ≤ 255, 0 ≤ p2 ≤ 255, 0 ≤ p3 ≤ 255, 0 ≤ p4 ≤ 255)

GS ( L 和 GS 8 L的指令参数:

m = 48

fn = 112

a = 48

bx = 1, 2 [当选择单色控制打印]

by = 1, 2 [当选择双色控制打印]

c = 49 [当选择单色控制打印]

c = 49, 50 [当选择双色控制打印]

1 ≤ (xL + xH × 256) ≤ 2047 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 7)

当选择单色控制打印时:

1 ≤ (xL + xH × 256) ≤ 1662 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 6) [by = 1]

1 ≤ (yL + yH × 256) ≤ 831 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 3 [by = 2]

当选择双色控制打印时:

1 ≤ (xL + xH × 256) ≤ 831 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 3) [by = 1]

1 ≤ (yL + yH × 256) ≤ 415 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 1 [by = 2]

0 ≤ d ≤ 255

k = (int ((xL + xH × 256) + 7) / 8) × (yL + yH × 256)

总的最大存贮区容量 = 256 KB

[Description] · 存贮NV图形数据到打印缓冲区(光栅Format)。

· 图形数据按 bx,by来确定横向、纵向的放大倍数。

Bx,by 纵向 横向

1 203dpi 203dpi

2 101dpi 101dpi

· c表示数据的颜色。

c 定义的数据的颜色(*)

49 颜色 1

50 颜色 2

(*) 颜色1为指定的双色热敏纸的黑色。

颜色2为指定的双色热敏纸的红色。

· xL,xH表示图形横向的点数(xL + xH × 256)。

· yL,yH表示图形纵向的点数(yL + yH × 256)。

· d表示存贮的数据(光栅 Format)。

[Notice] · 双色打印必须使用特殊的双色热敏纸。

· 必须特殊型号的打印机才支持双色打印。

GS ( N pL pH fn [parameters]

[Name] 选择字体

[Format] ASCII GS ( N pL pH fn [parameters]

Hex 1D 28 4E pL pH fn [parameters]

Decimal 29 40 78 pL pH fn [parameters]

[Description] · 选择字体。

· pL,pH(pL+pH×256)表示pH后的字节数(fn,[parameter])。

· fn 表示功能。

· [parameter] 表示每种功能的处理。

fn Format 功能号 功能Name

48 GS ( N pL pH fn m 48 选择字符颜色

[Notice] · 该指令设置仅在双色打印时有效。

<Function 48 > GS ( N pL pH fn m ( fn=48)

[Name] 选择字符颜色

[Format] ASCII GS ( N pL pH fn m

Hex 1D 28 4E pL pH fn m

Decimal 29 40 78 pL pH fn m

[Range] (pL + pH × 256) = 6 (pL = 6, pH = 0)

fn = 48

m = 49,50

[Description] · 选择字符颜色。

M 字符颜色(*)

49 颜色1

50 颜色2 (*) 颜色1表示指定的双色热敏纸的黑色(高加热能量)。

颜色2表示指定的双色热敏纸的红色(低加热能量)。

[Notice] · 双色打印必须特殊型号的打印机的支持。

[Default] m = 49

GS ( k pL pH cn fn [parameters]

[Name] 设置和打印符号

[Description] · 处理符号数据。

· pL,pH(pL+pH×256)表示pH后的字节数(cn,fn,[parameter])。

· cn 表示座号类型。

· fn 表示功能。

· [parameter] 表示每种功能的处理。

Cn 符号类型

48 PDF417 (二维码)

49 QR CODE (二维码)

cn fn Format 功能号 功能Name

48 65 GS ( k pL pH cn fn n 065 PDF417:设置打印数据区域的列数

66 GS ( k pL pH cn fn n 066 PDF417:设置行数

67 GS ( k pL pH cn fn n 067 PDF417:设置模块的宽度

68 GS ( k pL pH cn fn n 068 PDF417:设置行高

69 GS ( k pL pH cn fn m n 069 PDF417:设置纠错等级

70 GS ( k pL pH cn fn m 070 PDF417:选择可选项

80 GS ( k pL pH cn fn m

d1…dk

080 PDF417:存贮数据到符号存贮区

81 GS ( k pL pH cn fn m 081 PDF417:打印在符号存贮区的符号数据

82 GS ( k pL pH cn fn m 082 PDF417:传送在符号存贮区的符号数据的

大小信息

65 GS ( k pL pH cn fn n1 n2 165 QR CODE:选择模式

67 GS ( k pL pH cn fn n 167 QR CODE:设置模块大小

69 GS ( k pL pH cn fn n 169 QR CODE:设置纠错等级

80 GS ( k pL pH cn fn m

d1…dk

180 QR CODE:存贮数据到符号存贮区

81 GS ( k pL pH cn fn m 181 QR CODE:打印在符号存贮区的符号数据

49

82 GS ( k pL pH cn fn m 182 QR CODE:传送在符号存贮区的符号数据

的大小信息

· “符号数据”是指在用<功能 80或180>接收的编码前的数据。

· “符号存贮区”是指存贮用<功能 80或180>接收的编码前的数据的区域。

[Notice] · 在用<功能 82或182>传送数据时,在传送完数据前,主机不要再发送其他数据。

<Function 065 > GS ( k pL pH cn fn n ( cn=48,fn=65)

[Name] PDF417:设置打印数据区域的列数

[Format] ASCII GS ( k pL pH cn fn n

Hex 1D 28 6B pL pH cn fn n

Decimal 29 40 107 pL pH cn fn n

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

cn = 48

fn = 65

0 ≤ n ≤ 30

[Description] · 设置PDF417打印数据区域的列数。

· 当n=时,表示自动处理,在此情况下,打印数据区域的列数由打印的码字数或

打印Range来计算。

· 当n≠0时,设置打印数据区域的列数是n个码字。

[Notice] · 下列的数据是不包括在列数内的。

· 起始符和停止符。

· 左行指示符号字符和右行指示符号字符。

[Default] n = 0

[Reference]

<Function 066 > GS ( k pL pH cn fn n ( cn=48,fn=66)

[Name] PDF417:设置行数

[Format] ASCII GS ( k pL pH cn fn n

Hex 1D 28 6B pL pH cn fn n

Decimal 29 40 107 pL pH cn fn n

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

cn = 48

fn = 66

n =0, 3 ≤ n ≤ 90

[Description] · 设置PDF417的行数。

· 当n=时,表示自动处理,在此情况下,行数由打印的码字数或打印Range来计算。

· 当n≠0时,设置的行数是n行。

[Default] n = 0

<Function 067 > GS ( k pL pH cn fn n ( cn=48,fn=67)

[Name] PDF417:设置模块宽度

[Format] ASCII GS ( k pL pH cn fn n

Hex 1D 28 6B pL pH cn fn n

Decimal 29 40 107 pL pH cn fn n

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

cn = 48

fn = 67

2 ≤ n ≤ 8

[Description] · 设置PDF417模块宽度为 n 点。

[Default] n = 3

<Function 068 > GS ( k pL pH cn fn n ( cn=48,fn=68)

[Name] PDF417:设置模块高度

[Format] ASCII GS ( k pL pH cn fn n

Hex 1D 28 6B pL pH cn fn n

Decimal 29 40 107 pL pH cn fn n

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

cn = 48

fn = 68

2 ≤ n ≤8

[Description] · 设置PDF417模块高为[n ×模块宽]。

[Default] n = 0

<Function 069 > GS ( k pL pH cn fn m n ( cn=48,fn=69)

[Name] PDF417:设置纠错等级

[Format] ASCII GS ( k pL pH cn fn m n

Hex 1D 28 6B pL pH cn fn m n

Decimal 29 40 107 pL pH cn fn m n

[Range] (pL + pH × 256) = 4 (pL = 4, pH = 0)

cn = 48

fn = 69

m = 48, 49

48≤ n ≤56 [当m =48 ]

0≤ n ≤40 [当m =48 ]

[Description] · 设置PDF417的纠错等级。

· 当 m = 48 时,纠错等级设置为“等级模式”,并取消“比率模式”设置的纠错等

级。其纠错码字数量如下表:

n 功能 纠错码字数量

48 选择纠错等级0 2

49 选择纠错等级1 4

50 选择纠错等级2 8

51 选择纠错等级3 16

52 选择纠错等级4 32

53 选择纠错等级5 64

54 选择纠错等级6 128

55 选择纠错等级7 256

56 选择纠错等级8 512

· 当 m = 49 时,纠错等级设置为由编码数据数量按“比率模式”确定的等级,并取

消“等级模式”设置的纠错等级。

比率设置为 n×10%,下表中的纠错等级是通过公式计算确定的[数据码字×n×0.1

=(A)](小数部分四省五入)其纠错码字数如下表:

结果(A) 功能 纠错码字数量

0~3 选择纠错等级1 5

4~10 选择纠错等级2 8

11~20 选择纠错等级3 16

21~45 选择纠错等级4 32

46~100 选择纠错等级5 64

101~200 选择纠错等级6 128

201~400 选择纠错等级7 256

401或以上 选择纠错等级8 512

[Default] m =49, n = 1

<Function 070 > GS ( k pL pH cn fn m ( cn=48,fn=70)

[Name] PDF417:选择可选项

[Format] ASCII GS ( k pL pH cn fn m

Hex 1D 28 6B pL pH cn fn m

Decimal 29 40 107 pL pH cn fn m

[Range] (pL + pH × 256) = 4 (pL = 4, pH = 0)

cn = 48

fn = 70

m = 0, 1

[Description] · 选择PDF417的可选项。

m 功能

0 选择标准PDF417

1 选择压缩PDF417

[Default] m = 0

<Function 080 > GS ( k pL pH cn fn m d1…dk ( cn=48,fn=80)

[Name] PDF417:存贮数据到符号存贮区

[Format] ASCII GS ( k pL pH cn fn m d1…dk

Hex 1D 28 6B pL pH cn fn m d1…dk

Decimal 29 40 107 pL pH cn fn m d1…dk

[Range] 4 ≤ (pL + pH × 256) ≤ 65535 (0 ≤ pL ≤ 255 , 0 ≤ pH ≤ 255 )

cn = 48

fn = 80

m = 48,

0 ≤ d ≤ 255

K = (pL + pH × 256) - 3

[Description] ·存贮PDF417的符号数据(d1…dk)到符号存贮区。

<Function 081 > GS ( k pL pH cn fn m ( cn=48,fn=81)

[Name] PDF417:打印在符号存贮区的符号数据

[Format] ASCII GS ( k pL pH cn fn m

Hex 1D 28 6B pL pH cn fn m

Decimal 29 40 107 pL pH cn fn m

[Range] (pL + pH × 256) =3 (pL = 3 ,pH = 0 )

cn = 48

fn = 81

m = 48,

[Description] · 编码并打印用GS ( k <Function 080> 存贮在符号存贮区的PDF417符号

数据。

[Notice] · 使用者必须留出打印 PDF417 的足够的安全空白区域(包括由 PDF417 符号规范中

定义的上下、左右边空)。

· 在标准模式下,该打印机不能打印高度超过 831点的符号。

<Function 082 > GS ( k pL pH cn fn m ( cn=48,fn=82)

[Name] PDF417:传送在符号存贮区的符号数据的大小信息

[Format] ASCII GS ( k pL pH cn fn m

Hex 1D 28 6B pL pH cn fn m

Decimal 29 40 107 pL pH cn fn m

[Range] (pL + pH × 256) =3 (pL = 3 ,pH = 0 )

cn = 48

fn = 82

m = 48,

[Description] · 传送用GS ( k <Function 080> 存贮在符号存贮区的PDF417符号数据的

编码大小 信息。

[Notice] · 该功能不进行打印

· 大小信息不包括安全空白区域(由 PDF417 符号规范中定义的上下、左右边空)。

<Function 165 > GS ( k pL pH cn fn n1 n2 ( cn=49,fn=65)

[Name] Q的CODE:选择模式

[Format] ASCII GS ( k pL pH cn fn n1 n2

Hex 1D 28 6B pL pH cn fn n1 n2

Decimal 29 40 107 pL pH cn fn n1 n2

[Range] (pL + pH × 256) = 4 (pL = 4, pH = 0)

cn = 49

fn = 65

n1 = 49, 50

n2 = 0

[Description] · 选择QR CODE的模式。

n1 功能

49 选择计算算法为模式1

50 选择计算算法为模式2

[Default] n1 = 50,n2 = 0

<Function 167 > GS ( k pL pH cn fn n ( cn=49,fn=67)

[Name] QR CODE:设置模块大小

[Format] ASCII GS ( k pL pH cn fn n

Hex 1D 28 6B pL pH cn fn n

Decimal 29 40 107 pL pH cn fn n

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

cn = 49

fn = 67

1 ≤ n ≤16

[Description] · 设置QR CODE的模块大小 n 点。

[Default] n = 3

<Function 169 > GS ( k pL pH cn fn n ( cn=49,fn=69)

[Name] QRCODE:设置纠错等级

[Format] ASCII GS ( k pL pH cn fn n

Hex 1D 28 6B pL pH cn fn n

Decimal 29 40 107 pL pH cn fn n

[Range] (pL + pH × 256) = 3 (pL = 3, pH = 0)

cn = 49

fn = 69

48≤ n ≤51

[Description] · 设置QR CODE的纠错等级。

N 功能 Reference:可恢复字码比

48 选择纠错等级L 7%

49 选择纠错等级M 15%

50 选择纠错等级Q 25%

51 选择纠错等级R 30%

[Default] n=48

<Function 180 > GS ( k pL pH cn fn m d1…dk ( cn=49,fn=80)

[Name] QR CODE:存贮数据到符号存贮区

[Format] ASCII GS ( k pL pH cn fn m d1…dk

Hex 1D 28 6B pL pH cn fn m d1…dk

Decimal 29 40 107 pL pH cn fn m d1…dk

[Range] 4 ≤ (pL + pH × 256) ≤ 7092 (0 ≤ pL ≤ 255 , 0 ≤ pH ≤ 27 )

cn = 49

fn = 80

m = 48,

0 ≤ d ≤ 255

K = (pL + pH × 256) - 3

[Description] ·存贮QR CODE的符号数据(d1…dk)到符号存贮区。

<Function 181 > GS ( k pL pH cn fn m ( cn=49,fn=81)

[Name] QR CODE:打印在符号存贮区的符号数据

[Format] ASCII GS ( k pL pH cn fn m

Hex 1D 28 6B pL pH cn fn m

Decimal 29 40 107 pL pH cn fn m

[Range] (pL + pH × 256) =3 (pL = 3 ,pH = 0 )

cn = 49

fn = 81

m = 48,

[Description] · 编码并打印用GS ( k <Function 180> 存贮在符号存贮区的QR CODE符

号数据。

[Notice] · 使用者必须留出打印 QR CODE的足够的安全空白区域(包括由 QR CODE符号规

范中定义的上下、左右边空)。

<Function 182 > GS ( k pL pH cn fn m ( cn=49,fn=82)

[Name] QR CODE:传送在符号存贮区的符号数据的大小信息

[Format] ASCII GS ( k pL pH cn fn m

Hex 1D 28 6B pL pH cn fn m

Decimal 29 40 107 pL pH cn fn m

[Range] (pL + pH × 256) = 3 (pL = 3 ,pH = 0 )

cn = 49

fn = 82

m = 48,

[Description] · 传送用GS ( k <Function 180> 存贮在符号存贮区的QR CODE符号数据

的编码大 小信息。

[Notice] · 该功能不进行打印

· 大小信息不包括安全空白区域(由 QR CODE 符号规范中定义的上下、左右边空)。

GS * x y d1...d(x × y × 8)

[Name] 定义下载位图

[Format] ASCII GS * x y d1...dk

Hex 1D 2A x y d1...dk

Decimal 29 42 x y d1...dk

[Range] 1 ≤ x ≤ 255, 1 ≤ y ≤ 48

x × y ≤1536

0 ≤ d ≤ 255

k=x× y× 8

[Description] 定义一个下载位图,其点数由 x 和 y 指定

· x 指定位图的横向字节数;

· y 指定位图的纵向字节数;

· d 指定位图的数据。

[Notice] · 位图横向上的点数为 x × 8;位图纵向上的点数为 y × 8。

· 如果 x × y 超出规定的Range,则这条指令无效。

· d为位图数据。数据对应位为1表示打印该点,为0表示不打印。

· 下载的位图在下列情况下被清除:

① 执行ESC @指令

② 打印机电源关闭或复位。

· 打印数据和下载位图的关系如下图所示:

[Reference] GS /

GS / m

[Name] 打印下载位图

[Format] ASCII GS / m

Hex 1D 2F m

Decimal 29 47 m

[Range] 0 ≤ m ≤ 3, 48 ≤ m ≤ 51

[Description] 打印下载位图,打印模式由 m 指定

m 选择打印模式如下:

m 模式 纵向分辨率纵向分辨率纵向分辨率纵向分辨率 (DPI) 横向分辨率横向分辨率横向分辨率横向分辨率 (DPI)

0, 48 正常 203 203

1, 49 倍宽 203 101

2, 50 倍高 101 203

3, 51 倍宽、倍高 101 101

[Notice] · 如果下载的位图没有被定义,这条指令被忽略。

· 在标准模式下,只有打印缓冲区没有数据时,此指令才有效。;

· 除倒置打印模式外,其它打印模式对该指令无效(包括加粗、双重打印、下划线、

字体放大以及反显打印等)。

· 如果下载的位图超出了打印区域,则超出的部分不打印。

. 该命令打印位图为下载到RAM中的位图,不是下载到FLASH中的位图。

[Reference] GS *

GS :

[Name] 开始 / 结束宏定义

[Format] ASCII GS :

Hex 1D 3A

Decimal 29 58

[Description] 开始 / 结束宏定义。

[Notice] · 在正常操作时,打印机接收到该指令开始宏定义。在宏定义时,打印机接收到该指

令结束宏定义。

· 当打印机在定义宏时接收到 GS ^指令,则结束宏定义并且清除宏定义。

· 打印机上电时,没有宏定义。

· ESC @不能清除宏定义,因此宏定义内容可以包括ESC @ 指令。

· 如果打印在刚接收完GS :指令后立刻又收到GS :时,打印机仍然没有宏定义。

· 宏定义的内容可以达到2048字节。如果宏定义的内容超出2048字节,超出的数据

被当作普通数据处理。

[Reference] GS ^

GS B n

[Name] 选择 / 取消黑白反显打印模式

[Format] ASCII GS B n

Hex 1D 42 n

Decimal 29 66 n

[Range] 0 ≤ n ≤ 255

[Description] 选择 / 取消黑白反显打印模式。

· 当 n 的最低位为 0时,取消反显打印。

· 当 n 的最低位为 1时,选择反显打印。

[Notice] · n只有最低位有效。

· 这条命令对所有字符(除过HRI字符)有效。

· 选择反显打印后,由ESC SP指令设置的字符间距也反显。

· 这条指令不影响位图、自定义位图、条码、HRI字符以及由HT, ESC $, and ESC \

设定的空白。

· 这条指令不影响行与行之间的空白。

· 黑白反显打印模式比下划线模式优先级高。在黑白反显打印模式选择时,下划线模

式不起作用,取消黑白反显模式后,设定的下划线模式会起作用。

[Default] n = 0

GS H n

[Name] 选择HRI字符的打印位置

[Format] ASCII GS H n

Hex 1D 48 n

Decimal 29 72 n

[Range] 0 ≤ n ≤ 3, 48 ≤ n ≤ 51

[Description] 打印条码时,为HRI字符选择打印位置。

n指定 HRI 打印位置:

n 打印位置打印位置打印位置打印位置

0, 48 不打印

1, 49 条码上方

2, 50 条码下方

3, 51 条码上、下方都打印

· HRI 是对条码内容Notice的字符。

[Notice] · HRI 字符的字体是由 GS f 指令来指定。

[Default] n = 0

[Reference] GS f, GS k

GS I n

[Name] 查询打印机 ID号

[Format] ASCII GS I n

Hex 1D 49 n

Decimal 29 73 n

[Range] 1 ≤ n ≤ 3, 49 ≤ n ≤ 51, 65 ≤ n ≤ 69

[Description] 查询打印机 ID号,ID 号类型由 n决定:

n 打印机 ID号 返回参数返回参数返回参数返回参数 ID (hexadecimal)

1,49 打印机模型 ID SP-POS88系列 20

2,50 打印机类型 ID 见下表

3,51 ROM 版本 ID 与打印机型号及批次有关

65 Firmware 版本 ID 与打印机型号及批次有关

66 厂家 SPRT

67 打印机 Name POS88V

68 打印机串号 与打印机型号及批次有关

69 支持汉字类型 简体中文: CHINA GB2312

简体中文(三级字库): CHINA GB18030

繁体中文:TAIWAN BIG-5

n = 2, 打印机类型 ID

Bit Off/On Hex Decimal Function

OFF 00 0 不支持双字节字符编码 0

ON 01 1 支持双字节字符编码

1 ON 02 2 有切刀(固定)

2 OFF 00 0 不用

3 OFF 00 0 不用

4 OFF 00 0 不用,固定为 0

5 _ _ _ 未定义

6 _ _ _ 未定义

7 OFF 00 0 不用,固定为 0

[Notice] · 当1 ≤ n ≤ 3 或49 ≤ n ≤ 51时,打印机返回单字节ID

· 当65 ≤ n ≤ 69, 返回Format如下:

头信息: Hexadecimal = 5FH / Decimal = 95 (1 byte)

数据: 打印机信息

NUL: Hexadecimal = 00H / Decimal = 0 (1 byte)

GS L nL nH

[Name] 设置左边距

[Format] ASCII GS L nL nH

Hex 1D 4C nL nH

Decimal 29 76 nL nH

[Range] 0 ≤ nL ≤ 255

0 ≤ nH ≤ 255

[Description] · 用 nL 和 nH设置左边距;

· 左边距设置为 [( nL + nH × 256) × 横向移动单位)] 英寸。

[Notice] · 在标准模式下,该命令只有在行首才有效。

· 在页模式下,此命令无效,打印机将该命令当作作普通字符处理。

· 此命令不影响在页模式下的打印。

· 如果设置超出了最大可用打印宽度,则取最大可用打印宽度

· 横向和纵向移动单位是由 GS P命令设置的,改变纵向和横向移动单位不影响当前

的左边距。

[Default] nL = 0, nH = 0

[Reference] GS P, GS W

GS P x y

[Name] 设置横向和纵向移动单位

[Format] ASCII GS P x y

Hex 1D 50 x y

Decimal 29 80 x y

[Range] 0 ≤ x ≤ 255

0 ≤ y ≤255

[Description] · 分别将横向移动单位近似设置成25.4/ x mm( 1/ x 英寸)纵向移动单位设

置成25.4/ y mm(1/ y 英寸)。

· 当 x 和 y 为0时, x 和 y被设置成Default。

[Notice] · 垂直于进纸方向为横向,进纸方向为纵向。

· 在标准模式下,下列命令用x 或者 y,即使字符旋转(倒置或者顺时针旋转90°也不

改变;

① 用 x 的命令: ESC SP, ESC $, ESC \, FS S, GS L, GS W

② 用 y 的命令:ESC 3, ESC J, GS V

· 页模式下,用 x 或者 y 要根据区域方向和打印起始位置来定:

① 当打印起始位置用ESC T命令设置成左上角(打印方向从左到右)或者右下

角(打印方向从右到左)时:

用 x 的命令: ESC SP, ESC $, ESC W, ESC \, FS S

用 y 的命令: ESC 3, ESC J, ESC W, GS $, GS \, GS V

② 当打印起始位置用ESC T命令设置成右上角(打印方向从上到下)或者左下

角(打印方向从下到上)时:

用 x 的命令: ESC 3, ESC J, ESC W, GS $, GS \

用 y 的命令: ESC SP, ESC $, ESC W, ESC \,FS S, GS V

· 此命令不影响以前前设定的其他设置。

· 最小移动单位的是由该命令和其它命令综合作用的结果。

· 一英寸等于25.4mm.。

[Default] x = 203, y = 203,此时一个移动单位就是一个打印点。横向距离为1/8mm,纵

向距离为1/8mm。

[Reference] ESC SP, ESC $, ESC 3, ESC J, ESC W, ESC \, GS $, GS L, GS V, GS W, GS \

GS V m GS V m n①①①① ①①①①

[Name] 选择切纸模式并切纸

[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] ① m = 0,48,1, 49

② m = 65,66, 0 ≤n ≤255

[Description] 选择一种切纸模式并切纸。

根据m的值选择切纸模式,如下所示:

M 切纸模式切纸模式切纸模式切纸模式

0,1,48,49 半切

65,66 进纸(切纸位置+[n ×(纵向移动单位)英寸])并且半切纸

[Notice①和②]

· 这条命令只有在行首有效。

[Notice②] · m = 0,48,1, 49,打印机直接切纸。

· 当 m = 65,66,打印机进纸[ 打印位置到切刀之间距离 + n ×(纵向移动单位)]

然后切纸。

· 横向移动单位和纵向移动单位是由GS P命令设置的。

· 进纸量用纵向移动单位来计算。

GS W nL nH

[Name] 设置打印区域宽度

[Format] ASCII GS W nL nH

Hex 1D 57 nL nH

Decimal 29 87 nL nH

[Range] 0 ≤ nL ≤ 255

0 ≤ nH ≤ 255

[Description] 用nL 和 nH 设置打印区域宽度。

· 将打印区域宽度设置为[( nL + nH × 256) × 横向移动单位)]英寸。

[Notice] · 在标准模式下,此命令仅在行首有效。

· 在页模式下此命令无效,命令数据被当成普通字符处理。

· 此命令不影响页模式下的打印。

· 如果[左边距 + 打印区宽度]超出可打印区域,则打印区域宽度为可打印区域宽度

减去左边距。

· 横向和纵向移动单位由GS P命令设置。改变横向和纵向移动单位不影响当前左边距

和区域宽度。

·计算打印区宽度使用横向移动单位。

[Default] nL = 64, nH = 2

[Reference] GS L, GS P

GS \ nL nH

[Name] 页模式下设置纵向相对位置

[Format] ASCII GS \ nL nH

Hex 1D 5C nL nH

Decimal 29 92 nL nH

[Range] 0 ≤ nL ≤ 255

0 ≤ nH ≤ 255

[Description] 页模式下,以当前点为Reference点设置纵向移动距离。

· 这条命令设置相对于当前点的纵向移动距离为[( nL + nH × 256) × 纵向或者横向移

动单位] 英寸。

[Notice] · 此命令只在页模式下有效,在其它模式下被忽略。

· 当打印位置向下移动时:nL + nH × 256 = N

当打印位置向上移动时,用补码计算:nL + nH × 256 = 65536 - N

· 任何超出打印区域的设置被忽略。

· 此命令根据由ESC T设置的打印区域方向来确定使用移动单位:

① 当打印起始位置设置成左上角(打印方向从左到右)或者右下角(打印方向

从右到左),使用纵向移动单位。

② 当打印起始位置设置成右上角(打印方向从上到下)或者左下角(打印方向

从下到上),使用横向移动单位。

· 横向和纵向移动单位由GS P命令设置。

· GS P 命令能改变横向和纵向移动单位。

[Reference] ESC $, ESC T, ESC W, ESC \, GS $, GS P

GS ^ r t m

[Name] 执行宏命令

[Format] ASCII GS ^ r t m

Hex 1D 5E r t m

Decimal 29 94 r t m

[Range] 0 ≤ r ≤ 255

0 ≤ t ≤ 255

m = 0, 1

[Description] 执行宏命令。

· r 指定执行宏的次数。

· t 指定执行宏的等待时间。

· m 指定执行宏的模式。

当 m 的最低位为0时:

宏以 t × 100 ms为间隔时间,连续执行 r 次。

当 m 的最低位为1时:

打印机等待 t × 100 ms时间后,指示灯闪烁,直到用户按下进纸键,打印

机才执行宏。如此循环 r 次。

[Notice] · 每次执行宏的等待时间为 t × 100 ms。

· 如果在宏定义时接收到这条命令则宏定义停止,正在定义的宏被清除。

· 如果宏没有定义或者 r 是0,则该命令无效。

· 当宏执行时( m = 1),不能用进纸键进纸。

[Reference] GS :

GS a n

[Name] 设定自动状态返回(ASB)

[Format] ASCII GS a n

Hex 1D 61 n

Decimal 29 97 n

[Range] 0 ≤ n ≤ 255

[Description 确定自动状态返回的内容,参数 n含义如下:

Bit Off/On Hex Decimal ASB相关状态相关状态相关状态相关状态

off 00 0 钱箱打开状态使能 0

on 01 1 钱箱打开状态无效

off 00 0 在线/离线状态使能 1

on 02 2 在线/离线状态使能

off 00 0 错误状态使能 2

on 04 4 错误状态无效

off 00 0 纸状态使能 3

on 08 8 纸状态无效

4-7 - - - 未定义

[Notes] · 如果上表中任何一项内容处于使能状态,当该状态改变时,打印机自动返回四个

字节的打印机状态

· 如果所有项目都处于无效状态,则ASB功能无效

· 打印机自动返回状态字节时,不确认主计算机是否准备好

· 本命令与其他命令一起按顺序执行,所以从发送该命令到自动状态返回设置有效

有一定时间延迟

· 即使打印机被ESC = 命令设置为无效状态, 打印机仍按设置进行自动状态返回

· 自动返回的状态信息如下:

第一字节(打印机信息)

Bit Off/On Hex Decimal 打印机状态打印机状态打印机状态打印机状态

0 Off 00 0 不用,固定为 0

1 Off 00 0 不用,固定为 0

Off 00 0 钱箱接口 3 脚为低电平 2

On 04 4 钱箱接口 3 脚为高低电平

Off 00 0 打印机在线 3

On 08 8 打印机离线

4 On 10 16 不用,固定为 0

Off 00 0 打印机上盖合上 5

On 20 32 打印机上盖打开

Off 00 0 未用进纸键进纸 6

On 40 64 正在用进纸键进纸

7 Off 00 0 不用,固定为 0

第二字节 (打印机信息)

Bit Off/On Hex Decimal 打印机状态打印机状态打印机状态打印机状态

0 - - - 未定义

1 - - - 未定义

2 - - - 未定义

Off 00 0 没有切刀错误 3

On 08 8 有切刀错误

4 Off 00 0 不用,固定为 0

Off 00 0 无可恢复错误 5

On 20 32 有可恢复错误

Off 00 0 无可自动恢复错误 6

On 40 64 有可自动恢复错误

7 Off 00 0 不用,固定为 0

Bit 5: 类似于塞纸等错误为可恢复错误,这些错误在排除错误起因后可用DLE ENQ n

(1 ≤ n ≤ 2)指令使打印机恢复正常工作,类似于控制板损坏等错误为不可恢复错误

Bit 6: 类似于打印头过热等错误为可自动恢复错误,打印机出现这类错误时经过一段

时间能够自动恢复到正常工作状态

第三字节 (纸传感器信息)

Bit Off/On Hex Decimal 打印机状态打印机状态打印机状态打印机状态

Off 00 0 未探测到纸将尽 0,1

On 03 3 纸将尽

2,3 Off . 00 0 未探测到纸尽

On . 0C 12 纸尽

4 Off 00 0 不用,固定为 0

5,6 - - - 未定义

7 Off 00 0 不用,固定为 0

第四字节(纸传感器信息)

Bit Off/On Hex Decimal 打印机信息打印机信息打印机信息打印机信息

0-3 - - - 未定义

4 Off 00 0 不用,固定为 0

5,6 - - - 未定义

7 Off 00 0 不用,固定为 0

GS b n

[Name] 平滑模式开/关

[Format] ASCII GS b n

Hex 1D 62 n

Decimal 29 98 n

[Range] 0 ≤ n ≤ 255

[Description] 开/关平滑模式。

· 当n的最低位为0,关闭平滑模式。

· 当n的最低位为1,打开平滑模式。

[Notice] · 只有n的最低位有效

· 平滑模式对内部宽字符和自定义字符都有效。

· 即使平滑模式是打开的,只要字符在宽、高方向有一项是正常大小,平滑模式就不

起作用。

[ [Default] n = 0

[Reference] GS H, GS k

GS f n

[Name] 选择 HRI 使用字体

[Format] ASCII GS f n

Hex 1D 66 n

Decimal 29 102 n

[Range] n = 0, 1, 48, 49

[Description] 打印条码时,为 HRI 字符选择一种字体

用 n 来选择字体如下:

n 字体字体字体字体

0,48 标准ASCII字符 (12 × 24)

1,49 压缩ASCII字符 (9 × 17)

[Notice] · HRI 字符是对条码内容Notice的字符。

· HRI 字符的打印位置由 GS H 命令指定。

[Default] n = 0

[Reference] GS H, GS k

GS g 0 m nL nH

[Name] 初始化维护计数器

[Format] ASCII GS g 0 nL nH

Hex 1D 67 30 nL nH

Decimal 29 103 48 nL nH

[Range] m =0

(nL + nH × 256) = 20, 21, 50, 70 (nL = 20, 21, 50, 70, nH = 0)

[Description] 设置由(nL+nH × 256)指定的可清零维护计数器到0

nL + nH × 256

十六进制 十进制

维护计数器[单位]

14 20 走纸行数[行]

15 21 打印头加热次数[次]

32 50 切刀操作次数[次]

46 70 打印机运行时间[小时]

[Notice] · 频繁写执行写NV存贮器指令可能会损坏NV存贮器,因此建议每天写NV存贮器不

要超过10次。

· 如果在执行该指令时,关闭打印机电源或通过接口复位打印机可能使打印机进入不

正常状态,因此在执行该指令时不要关闭打印机电源或从接口复位打印机。

· 打印机在执行该指令向NV NV存贮器写入数据时,打印机会变为“忙”并且停止接

收数据,因此当打印机“忙”时,主机不要再发送数据。

[Reference]

GS g 2 m nL nH

[Name] 传送维护计数器

[Format] ASCII GS g 2 nL nH

Hex 1D 67 32 nL nH

Decimal 29 103 50 nL nH

[Range] m =0

(nL + nH × 256) = 20, 21, 50, 70 , 148 , 149, 178, 198

(nL = 20, 21, 50, 70, , 148 , 149, 178, 198 , nH = 0)

[Description] 传送由(nL+nH × 256)指定的维护计数器的值

nL + nH × 256

十六进制 十进制

维护计数器[单位]

计数器类型

14 20 走纸行数[行]

15 21 打印头加热次数[次]

32 50 切刀操作次数[次]

46 70 打印机运行时间[小时]

可重置的

(可清零)

94 148 走纸行数[行]

95 149 打印头加热次数[次]

B2 178 切刀操作次数[次]

C6 198 打印机运行时间[小时]

累积的

[Notice] · 维护计数器的值是一测量值,因此这个值是受定时误差、怎样关电源和

什么时候关电源影响的。

· 在执行该指令时,在主机接收到返回数据前,不要发送其他数据。

[Reference]

GS h n

[Name] 选择条码高度

[Format] ASCII GS h n

Hex 1D 68 n

Decimal 29 104 n

[Range] 1 ≤ n ≤ 255

[Description] 选择条码高度。

条码高度为 n 点。

[Default] n = 162

[Reference] GS k

GS k m d1...dk NUL GS k m n d1...dn①①①① ①①①①

[Name] 打印条码

[Format] ①ASCII GS k m d1...d k NUL

Hex 1D 6B m d1...d k 00

Decimal 29 107 m d1...d k 0

②ASCII GS k m n d1... dn

Hex 1D 6B m n d1... dn

Decimal 29 107 m n d1... dn

[Range] ①0 ≤ m ≤ 6 (k和d的取值Range是由条码类型来决定)

②65 ≤ m ≤ 73 (k 和 d 的取值 Range是由条码类型来决定)

[Description] 选择一种条码类型并打印条码

m 用来选择条码类型,如下所示:

m 条码类型条码类型条码类型条码类型 字符个数字符个数字符个数字符个数 d

0 UPC-A 11 ≤ k ≤ 12 48 ≤ d ≤ 57

1 UPC-E 11 ≤ k ≤ 12 48 ≤ d ≤ 57

2 JAN13 (EAN13) 12 ≤ k ≤ 13 48 ≤ d ≤ 57

3 JAN 8 (EAN8) 7 ≤ k ≤ 8 48 ≤ d ≤ 57

4 CODE39 1 ≤ k ≤ 255 45 ≤ d ≤ 57, 65 ≤ d ≤ 90, 32, 36, 37,43

5 ITF 1 ≤ k ≤ 255 48 ≤ d ≤ 57

6 CODABAR 1 ≤ k ≤ 255 48 ≤ d ≤ 57, 65 ≤ d ≤ 68 , 36, 43,

45,46,47,58

65 UPC-A 11 ≤ n ≤ 12 48 ≤ d ≤ 57 ②

66 UPC-E 11 ≤ n ≤ 12 48 ≤ d ≤ 57

67 JAN13 (EAN13) 12 ≤n ≤ 13 48 ≤ d ≤ 57

68 JAN 8 (EAN8) 7 ≤n ≤ 8 48 ≤ d ≤ 57

69 CODE39 1 ≤ n ≤ 255 45 ≤ d ≤ 57, 65 ≤ d ≤ 90, 32, 36, 37,43

d1 = dk = 42

70 ITF 1 ≤ n≤ 255 48 ≤ d ≤ 57

71 CODABAR 1 ≤ n≤ 255 48 ≤ d ≤ 57 65 ≤ d ≤ 68, 36, 43,45,46,47

58

72 CODE93 1 ≤ n≤ 255 0 ≤ d ≤ 127

73 CODE128 2 ≤ n≤ 255 0 ≤ d ≤ 127

[Notice ①

· 该命令在这种Format下以 NULL 结束。

· 当选择UPC-A 或者UPC-E码时,打印机接收到12字节条码数据后,剩余的字符被

当作普通字符处理。

· 当选择JAN13 (EAN13)类型时,打印机接收到13字节条码数据后,剩余的字符被当

作普通字符处理。

· 当选择JAN8 (EAN8),类型时,打印机接收到8字节条码数据后,剩余的字符被当作

普通字符处理。

· ITF码数据个数必须是偶数。如果输入奇数个条码数据,则最后一个数据被忽略。

[Notice ②]

· n 用来指示条码数据的个数,打印机将其后边 n 字节数据作为条码数据处理。

· 如果 n 超出了规定的Range,打印机不处理这条命令,将其后的数据作为普通数据

处理。

[Notice (标准模式)]

· 如果条码数据d超出了规定的Range,该命令无效。

· 如果条码横向超出了打印区域,无效。

· 这条命令不管由ESC 2或ESC 3命令设置的行高是多少,走纸距离都与设定的条码

高度相等。

· 这条命令只有在打印缓冲区没有数据时才有效,如果打印缓冲区有数据,该命令被

忽略。

· 打印条码后,将打印位置设置在行首。

· 打印模式设置(如加粗、双重打印、下划线、字符大小、反色以及字符顺时针旋转

90°等)不影响这条命令,但是倒置模式对条码打印有影响。

[Notice (页模式)]

· 这条命令只将条码图形生成到打印缓冲区,但是并不打印。处理完条码数据后将打

印位置移到条码的右边。

· 如果 d 超出了规定的Range,该命令将被忽略。

· 如果条码宽度超出了打印区域,该命令被忽略。

当选择 CODE128 ( m = 73) 时:

· Reference附录A,CODE 128的相关信息和字符集。

· 在使用CODE 128 时,按照下列说明进行编码:

① 在条码数据前必须先选择字符集(CODE A、CODE B 和 CODE C中的一个)。

② 选择字符集是通过发送字符“{” 和另外一个字符结合来完成的;ASCII字符“{”

通过连续发送字符“{”两次来完成。

指定指定指定指定 发送数据发送数据发送数据发送数据

字符集字符集字符集字符集 ASCII Hex Decimal

SHIFT {S 7B, 53 123,83

CODE A {A 7B, 41 123, 65

CODE B {B 7B, 42 123, 66

CODE C {C 7B, 43 123, 67

FNC1 {1 7B, 31 123, 49

FNC2 {2 7B, 32 123, 50

FNC3 {3 7B, 33 123, 51

FNC4 {4 7B, 34 123, 52

"{" {{ 7B, 7B 123, 123

[实例] 例如打印“No. 123456”

在这个实例中,打印机首先用CODE B 打印“No.”,接着用CODE C 打印余下的数

字:

GS k 73 10 123 66 78 111 46 123 67 12 34 56

· 如果在条码数据的最前端不是字符集选择,则打印机将停止这条命令的处理,并将

余下的数据作为普通数据处理。

· 如果“{”和紧接着它的那个字符不是上面所指定的组合,则打印机停止这条命令的

处理,并将余下的数据作为普通数据处理。

· 如果打印机接收的字符不是条码字符集数据,则打印机停止这条命令的处理,并将

余下的数据作为普通数据处理。

· 打印机打印HRI字符时,不打印shift字符和字符集选择数据。

· 功能字符的HRI字符不打印。

· 控制字符(<00>H to <1F>H and <7F>H)的HRI字符也不打印;

<其它> 一定要保证条码的左右间隙。间隙因条码类型不同而不同。

[Reference] GS H, GS f, GS h, GS w, 附录 A

GS r n

[Name] 返回状态

[Format] ASCII GS r n

Hex 1D 72 n

Decimal 29 114 n

[Range] n = 1, 2, 49, 50

[Description] 返回由n值指定的状态:

n 功能功能功能功能

1,49 返回纸传感器状态

2,50 返回钱箱状态

[Notice] . 该指令只对串口打印机有效。

· 接收缓冲器中此命令前的数据被处理完之后,才执行这条指令,因此,发送该指令

与接收到返回状态有一定的时间滞后。

· 返回状态字节各位对应关系如下所示:

纸传感器状态 ( n = 1,49 ):

位位位位 0/1 Hex Decimal 状态状态状态状态

0 00 0 纸将尽传感器,有纸 0,1

1 03 3 纸将尽传感器,纸将尽

0 00 0 纸尽传感器,有纸 2,3

1 0c 12 纸尽传感器,缺纸

4 0 00 0 不用,固定为0

5,6 未定义

7 0f 00 0 不用,固定为0

钱箱状态 ( n = 2, 50):

位位位位 0/1 Hex Decimal 状态状态状态状态

0 00 0 钱箱接口引脚3为低电平 0

1 01 1 钱箱接口引脚3为高电平

1- 3 未定义

4 0 00 0 不用,固定为0

5,6 未定义

7 0 00 0 不用,固定为0

[Reference] DLE EOT,GS a

GS w n

[Name] 设置条码宽度

[Format] ASCII GS w n

Hex 1D 77 n

Decimal 29 119 n

[Range] 2 ≤ n ≤ 6

[Description] 设置条码横向模块宽度

用 n 来指定条码的横向模块宽度:

双基本模块宽度双基本模块宽度双基本模块宽度双基本模块宽度 n 单基本模块宽度单基本模块宽度单基本模块宽度单基本模块宽度

((((mm)))) 窄基本模块窄基本模块窄基本模块窄基本模块((((mm)))) 宽基本模块宽基本模块宽基本模块宽基本模块((((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

· 单基本模块条码如下:

UPC-A, UPC-E, JAN13 (EAN13), JAN8 (EAN8), CODE93, CODE128

· 双基本模块条码如下:

CODE39, ITF, CODABAR

[Default] n = 2

[Reference] GS k

汉字字符控制命令汉字字符控制命令汉字字符控制命令汉字字符控制命令

FS ! n

[Name] 设置汉字字符模式

[Format] ASCII FS ! n

Hex 1C 21 n

Decimal 28 33 n

[Range] 0 ≤n ≤ 255

[Description] 用 n 值设置汉字的打印模式如下:

位位位位 0/1 Hex Decimal 功能功能功能功能

0, 1 未定义

0 00 0 取消倍宽 2

1 04 4 选择倍宽

0 00 0 取消倍高 3

1 08 8 选择倍高

4-6 未定义

0 00 0 取消下划线 7

1 80 128 选择下划线

[Notice] · 当倍宽与倍高度模式同时被设定时,字符横向和纵向同时被放大两倍(包括左右

间距)。

· 打印机能对所有字符加下划线,包括左右间距。但不能对由于HT指令(横向跳格)

引起的空格进行加划线,也不对顺时针旋转90度的字符加下划线。

· 下划线线宽由FS -设定,与字符大小无关。

· 当一行中字符高度不同时,该行中的所有字符以底线对齐。

· 可以用FS W 或者 GS !对字符加粗,最后一条指令有效。

· 也可以用FS –选择或取消下划线模式,最后一条指令有效。

[Default] n = 0

[Reference] FS - , FS W,GS !

FS &

[Name] 选择汉字模式

[Format] ASCII FS &

Hex 1C 26

Decimal 28 38

[Description] 选择汉字模式

[Notice] · 当选中汉字模式时,打印机判断字符是否为汉字内码,如是汉字内码,先处理第

一字节,然后判断第二字节是否为汉字内码。

· 打印机上电后自动选择汉字模式;

[Reference] FS . , FS C

FS - n

[Name] 选择 / 取消汉字下划线模式

[Format] ASCII FS - n

Hex 1C 2D n

Decimal 28 45 n

[Range] 0 ≤ n ≤ 2, 48 ≤ n ≤ 50

[Description] 根据 n 的值,选择或取消汉字的下划线:

n 功能功能功能功能

0, 48 取消汉字下划线

1, 49 选择汉字下划线(1点宽)

2, 50 选择汉字下划线(2点宽)

[Notice] · 打印机能对所有字符加下划线,包括左右间距。但不能对由HT指令(横向跳格)

引起的空格加下划线,也不对顺时针旋转90度的字符加下划线。

· 消下划线模式后,不再执行下划线打印,但原先设置的下划线线宽不会改变。默认

下划线线宽为1点。

· 即使改变字符大小,设定的下划线线宽也不会改变。

· 用FS !也可选择或取消下划线模式,最后一条指令有效。

[Default] n = 0

[Reference] FS !

FS .

[Name] 取消汉字模式

[Format] ASCII FS .

Hex 1C 2E

Decimal 28 46

[Description] 取消汉字模式

[Notice] · 当汉字模式被取消时,所有字符都当作作ASCII字符处理,每次只处理一个字节。

· 上电自动选择汉字模式。

[Reference] FS &, FS C

FS 2 c1 c2 d1...dk

[Name] 定义用户自定义汉字

[Format] ASCII FS 2 c1 c2 d1...dk

Hex 1C 32 c1 c2 d1...dk

Decimal 28 50 c1 c2 d1...dk

[Range] c1 ,c2代表定义字符的字符编码

c1 = FEH

A1H ≤ c2 ≤ FEH

0 ≤ d ≤ 255

k = 72

[Description] 定义由c1,c2指定的汉字

[Notice] · c1 ,c2代表用户自定义汉字的编码,c1指定第一个字节,c2指定第二个字节。

· d代表数据。每个字节的相应位为1表示打印该点,为0不打印该点。

[Default] 没有自定义汉字

自定义汉字字型与数据之间关系见下图:

FS C n

[Name] 选择汉字代码系统

[Format] ASCII FS C n1 n2

Hex 1C 43 n1 n2

Decimal 28 67 n1 n2

[Range] n=0,1,48,49

[Description] 选择汉字代码系统

n 选择汉字代码系统

0, 48 简体中文(GB2312或GB18030)

1, 49 繁体中文(BIG5)

[Notice] · 该指令不改变Flash中的参数设置。

· 在执行ESC @指令、关闭电源或打印机复位后,恢复为Default

[Default] n = 0 简体中文型号

n = 1 繁体中文型号

FS S n1 n2

[Name] 设置汉字字符左右间距

[Format] ASCII FS S n1 n2

Hex 1C 53 n1 n2

Decimal 28 83 n1 n2

[Range] 0 ≤ n1 ≤ 255

0 ≤ n2 ≤ 255

[Description] 分别将汉字的左间距和右间距设置为 n1 和 n2。

· 当打印机支持GS P指令时,左间距是 [n1 × 横向或者纵向移动单位]英寸,右间距

是[n2 × 横向或者纵向移动单位]英寸。

[Notice] · 设置倍宽模式后,左右间距也加倍。

· 移动单位是由GS P指令设置的。 即使横向和纵向移动单位被GS P改变,原先设定

的字符间距也不改变。

· 在标准模式下,用横向移动单位。

· 在页模式下,根据打印区域起始位置来选择是用横向移动单位还是纵向移动单位:

① 当起始位置在打印区域的左上角或右下角,用横向移动单位。

② 当起始位置在打印区域的右上角或左下角,用横向移动单位。

③ 汉字的最大右间距约为36mm,超过此值取最大值。

[Default] n1 = 0, n2 = 0

[Reference] GS P

FS W n

[Name] 选择 / 取消 汉字倍高倍宽

[Format] ASCII FS W n

Hex 1C 57 n

Decimal 28 87 n

[Range] 0 ≤ n ≤ 255

[Description] 选择或者取消汉字倍高倍宽模式。

· 当n的最低位为0,取消汉字倍高倍宽模式。

· 当n的最低位为1,选择汉字倍高倍宽模式。

[Notice] · 只有n的最低位有效

· 在汉字倍高倍宽模式模式下,打印汉字的大小,与同时选择倍宽和倍高模式时相同。

· 取消汉字倍高倍宽模式后,以后打印出的汉字为正常大小。

· 当一行字中字符高度不同时,该行中的所有字符都按底线对齐。

· 也可以通过FS ! 或者 GS !指令(选择倍高和倍宽模式)来选择或取消汉字倍高倍

宽模式,最后接收到的指令有效。

[Default] n = 0

[Reference] FS !, GS !

陈旧的指令陈旧的指令陈旧的指令陈旧的指令

FS p n m

推荐使用GS ( L (功能 69)指令代替FS p指令,其向上兼容FS p指令,FS p指令为废弃的指令。

[Name] 打印下载到FLASH中的位图

[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] 以m指定的模式打印下载到FLASH中的位图。

m 模式模式模式模式 纵向分辨率纵向分辨率纵向分辨率纵向分辨率 (DPI) 横向分辨率横向分辨率横向分辨率横向分辨率 (DPI)

0.48 正常模式 203 203

1.49 倍宽模式 203 101

2.50 倍高模式 101 203

3.51 倍高倍宽模式 101 101

· n表示位图(由指令FS q定义)的图号。

· m指定打印位图的模式。

[细节] · Flash位图是由指令FS q定义存储在Flash存储器中并用指令FS p打印的位图。

· 当Flash 位图没有被定义时,该指令无效。

· 在标准模式下,该指令只有在打印缓冲区里没有数据时有效。

· 该指令除了受倒置打印模式的影响外,不受其他打印模式的影响(如:倍高、倍宽、

下划线、字符放大、反显打印、顺时针旋转90度等)。

· 如果所要打印的下载位图超出当前打印区域,则不打印超出的部分。

· 打印完位图后,打印机换行,按普通模式处理其后的数据。

[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

推荐使用GS ( L (功能 67)指令代替FS q指令,其向上兼容FS q指令,FS q指令为废弃的指令。

[Name] 定义Flash 位图

[Format] ASCII FS q n [ xL xH yL yH d1...dk]...[ xL xH yL yH d1...dk]

Hex 1C 71 n [xL xH yL yH d1...dk]...[ xL xH yL yH d1...dk]

Decimal 28 113 n [xL xH yL yH d1...dk]...[ xL xH yL yH d1...dk]

[Range] 1 ≤ n ≤ 255

0 ≤ xL ≤ 255

1 ≤ ( xL + xH × 256) ≤ 1023

1 ≤ ( yL + yH × 256) ≤ 288

0 ≤ d ≤ 255

k = ( xL + xH × 256) × ( yL + yH × 256) × 8

Flash下载容量最大为8096字节

[Description] 定义Flash 位图:

· n 指定所要定义的Flash 位图的数目。

· xL、 xH指定Flash 位图的横向点数( xL + xH × 256) × 8。

· yL、 yH指定Flash 位图的纵向点数( yL + yH × 256) × 8。

[Notice] · 频繁执行该指令能损坏Flash 存储器,推荐每天最多写Flash 10次。

· 该指令删除所有的以前由该指令定义的Flash 位图,打印机不能对上一次定义的多

幅位图中的一个进行重新定义,在这种情况下,必须重新发送所有的数据。

· 由于在处理该指令的过程中,打印机处于忙状态,它向Flash 中写数据并且停止接

收其他指令,因此,在该指令的执行过程中,禁止向打印机发送其他命令,包括实

时指令。

· Flash位图是由指令FS q定义存储在Flash存储器中并用指令FS p打印的位图。

· 在标准模式下,该指令仅在行首时有效。

· 从 FS 到 yH 的七个字节数据作为命令数据处理,不是图形数据的一部分。

· 当位图数据字节数超出由它左边的xL、xH、yL、yH定义的Range,则打印机只处理

xL、xH、yL、yH定义的Range的数据。

· 在第一组Flash位图里,当xL, xH, yL, yH中任何一个参数超出定义的Range时,该

指令无效。

· 在下载多幅位图时,如果打印机处理xL、xH、yL、yH超出定义的Range,则打印机

停止执行这条指令。命令中在此之后的位图无效,在此之前的位图有效。

· d是定义的位图数据,在数据中相应位为1表示打印该点,为0表示不打印。

· 这条指令定义了 n 幅Flash位图。每个位图的序列号从 1 依次增加,因此,第一个

数据组 [xL xH yL yH d1...dk] 是Flash位图 1 的数据,最后一个数据组 [xL xH yL

yH d1...dk] 是Flash位图 n 的数据。在用FS p 指令打印位图时,也是如此。

· 定义一幅Flash位图的数据由 [xL xH yL yH d1...dk] 组成。因此,当只有一幅位图时,

n = 1。打印机占用Flash存储器字节数如下:

[位图数据字节数:( xL + xH × 256)×( yL + yH × 256)× 8] + [头信息:4]

· 在打印机里Flash下载空间最大为64K bits ( 8K bytes),该指令可以定义多幅Flash位

图,但不能定义一幅大小超过64K bits的位图(不同的打印机下载空间也不相同,

请参照打印机配置信息)。

· 在写Flash 之前,打印机立即处于忙状态。

· 在处理该指令的过程中,打印机不传送状态也不执行状态查询。

· 在宏定义的过程中接受到该指令,打印机将结束宏定义,开始执行该指令。

· 如果一幅Flash位图被定义,执行ESC @命令、复位和关闭电源不能将其擦除。

· 该指令只是定义Flash位图,不执行打印,打印Flash位图由FS p指令执行。

[Reference] FS p

[实例] 当 xL = 64, xH = 0, yL = 96, yH = 0

GS v 0 m xL xH yL yH d1....dk

推荐使用GS ( L (功能 112和功能50)指令代替GS v 0 指令,其向上兼容GS v 0 指令,GS v

0 指令为废弃的指令。

[Name] 打印光栅位图

[Format] ASCII GS v 0 m xL xH yL yH d1...dk

Hex 1D 76 30 m xL xH yL yH d1...dk

Decimal 29 118 48 m xL xH yL yH d1...dk

[Range] 0 ≤ m ≤ 3, 48 ≤ m ≤ 51

0 ≤ xL ≤ 255

0 ≤ xH ≤ 255

0 ≤ yL ≤ 255

0 ≤ d ≤ 255

k = ( xL + xH × 256) × ( yL + yH × 256) ( k ≠ 0)

[Description] 打印光栅位图,由m值选择光栅位图模式

m 模式模式模式模式 纵向分辨率纵向分辨率纵向分辨率纵向分辨率 (DPI) 横向分辨率横向分辨率横向分辨率横向分辨率(DPI)

0, 48 正常 203 DPI 203 DPI

1, 49 倍宽 203 DPI 101 DPI

2, 50 倍高 101 DPI 203 DPI

3, 51 倍宽、倍高 101 DPI 101 DPI

· xL、xH表示水平方向位图字节数(xL+ xH × 256)

· yL、yH表示垂直方向位图点数( yL+ yH × 256)

[Notice] · 在标准模式下,只有打印机缓冲区无数据时该指令才有效。

· 字符放大、加粗、双重打印、倒置打印、下划线、黑白反显等打印模式对该指令无

效。

· 位图超出打印区域的部分不打印。

· ESC a(选择对齐模式)对光栅位图有效。

· 宏定义的过程中,该命令将停止宏定义而执行该命令。该命令不作为宏定义的一

部分。

· d 代表位图数据。每个字节的相应位为1表示打印该点,为0不打印该点。

[实例] 当 xL+ xH × 256 = 64

ESC c 0 n

[Name] 选择纸张类型

[Format] ASCII ESC c 0 n

Hex 1B 63 30 n

Decimal 27 99 40 n

[Range] 0 ≤ n ≤ 2

[Description] 选择纸张类型

n = 0, 设置纸张类型为连续纸

n = 1, 2, 设置纸张类型为标记纸

[Notice] . 标记纸是指印有黑白标记的打印纸

. 当纸张类型设置为标记纸时,请不要使用连续纸,否则执行GS FF命令会导致打

印机走纸很长距离,当纸张类型设置为连续纸时,请不要使用标记纸,否则打印机

会误报缺纸

[Default] n = 0

[Reference] GS FF

GS FF

[Name] 标记纸定位

[Format] ASCII GS FF

Hex 1D 0C

Decimal 29 12

[Description] 打印机走纸,使下一个标记到达特定的位置

[Notice] · 本命令只有纸张类型为标记纸时才有效

. 当纸张类型设置为标记纸时,请不要使用连续纸,否则本命令会导致打印机走纸

很长距离

[Reference ESC c 0

GS # n

[Name] 定义当前下载图号

[Format] ASCII GS # n

Hex 1D 23 n

Decimal 29 33 n

[Range] 1 ≤ n ≤ 8

[Description] 选择当前的下载位图图号,下载位图和打印位图根据此图号进行

[Notice] · 该命令只针对下载到RAM中的位图,设定内容掉电后丢失。

. 下载到FLASH中的位图不使用本命令指定的图号。

附录附录附录附录 A: CODE128 码码码码

A.1 CODE128码综述码综述码综述码综述 CODE 128码通过交替使用字符集A、字符集B和字符集C,能够对128个ASCII字符和00~99的100

个数字以及一些特殊字符进行编码。每个字符集编码的字符如下:

· 字符集 A: ASCII 字符 00H 到 5FH

· 字符集 B: ASCII 字符 20H 到 7FH

· 字符集 C: 00~99的100个数字

CODE128码也能对下列特殊字符进行编码:

· SHIFT 字符

“SHIFT”能使条码符号SHIFT字符后边第一个字符从字符集A转换到字符集B,或从字符集B转换

到字符集A,从第二个字符开始恢复到SHIFT以前所用的字符集。“SHIFT”字符仅能在字符集A和

字符集B之间转换使用,它无法使当前的编码字符进入或退出字符集C的状态。

· 字符集选择字符(CODE A、CODE B、 CODE C)

这些字符能将其后边的编码字符转换到字符集A、B或C。

· 功能字符(FNC1、 FNC2、FNC3、FNC4)

这些功能符的用处取决于应用软件。在字符集C中,只有FNC1 可用。

A.2 字符集字符集字符集字符集

字符集A中的字符

发送数据发送数据发送数据发送数据 发送数据发送数据发送数据发送数据 发送数据发送数据发送数据发送数据 字符字符字符字符

Hex Decimal 字符字符字符字符

Hex Decimal 字符字符字符字符

Hex Decimal

NULL

SOH

STX

ETX

EOT

ENQ

ACK

BEL

BS

HT

LF

VT

FF

CR

SO

SI

DLE

DC1

DC2

DC3

DC4

NAK

SYN

ETB

CAN

EM

SUB

ESC

FS

GS

RS

US

SP

!

"

#

$

%

&

'

00

01

02

03

04

05

06

07

08

09

0A

0B

0C

0D

0E

0F

10

11

12

13

14

15

16

17

18

19

1A

1B

1C

1D

1E

1F

20

21

22

23

24

25

26

27

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

(

)

*

+

,

-

.

/

0

1

2

3

4

5

6

7

8

9

:

;

<

=

>

?

@

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

28

29

2A

2B

2C

2D

2E

2F

30

31

32

33

34

35

36

37

38

39

3A

3B

3C

3D

3E

3F

40

41

42

43

44

45

46

47

48

49

4A

4B

4C

4D

4E

4F

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

P

Q

R

S

T

U

V

W

X

Y

Z

[

\

]

^

_

FNC1

FNC2

FNC3

FNC4

SHIFT

CODEB

CODEC

50

51

52

53

54

55

56

57

58

59

5A

5B

5C

5D

5E

5F

7B,31

7B,32

7B,33

7B,34

7B,53

7B,42

7B,43

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

123,49

123,50

123,51

123,52

123,83

123,66

123,67

字符集B中的字符

发送数据发送数据发送数据发送数据 发送数据发送数据发送数据发送数据 发送数据发送数据发送数据发送数据 字符字符字符字符

Hex Decimal 字符字符字符字符

Hex Decimal 字符字符字符字符

Hex Decimal

SP

!

"

#

$

%

&

'

(

)

*

+

,

-

.

/

0

1

2

3

4

5

6

7

8

9

:

;

<

=

>

?

@

A

B

C

D

E

F

G

20

21

22

23

24

25

26

27

28

29

2A

2B

2C

2D

2E

2F

30

31

32

33

34

35

36

37

38

39

3A

3B

3C

3D

3E

3F

40

41

42

43

44

45

46

47

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

[

\

]

^

_

`

a

b

c

d

e

f

g

h

i

j

k

l

m

n

o

48

49

4A

4B

4C

4D

4E

4F

50

51

52

53

54

55

56

57

58

59

5A

5B

5C

5D

5E

5F

60

61

62

63

64

65

66

67

68

69

6A

6B

6C

6D

6E

6F

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

p

q

r

s

t

u

v

w

x

y

z

{

|

}

DEL

FNC1

FNC2

FNC3

FNC4

SHIFT

CODEA

CODEC

70

71

72

73

74

75

76

77

78

79

7A

7B,7B

7C

7D

7E

7F

7B,31

7B,32

7B,33

7B,34

7B,53

7B,41

7B,43

112

113

114

115

116

117

118

119

120

121

122

123,123

124

125

126

127

123,49

123,50

123,51

123,52

123,83

123,65

123,67

字符集C中的字符

发送发送发送发送数据数据数据数据 发送数据发送数据发送数据发送数据 发送数据发送数据发送数据发送数据 字符字符字符字符

Hex Decimal 字符字符字符字符

Hex Decimal 字符字符字符字符

Hex Decimal

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

00

01

02

03

04

05

06

07

08

09

0A

0B

0C

0D

0E

0F

10

11

12

13

14

15

16

17

18

19

1A

1B

1C

1D

1E

1F

20

21

22

23

24

25

26

27

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

28

29

2A

2B

2C

2D

2E

2F

30

31

32

33

34

35

36

37

38

39

3A

3B

3C

3D

3E

3F

40

41

42

43

44

45

46

47

48

49

4A

4B

4C

4D

4E

4F

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

FNC1

CODEA

CODEB

50

51

52

53

54

55

56

57

58

59

5A

5B

5C

5D

5E

5F

60

61

62

63

7B,31

7B,41

7B,42

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

123,49

123,65

123,66

附录附录附录附录 B::::打印模式及其转换打印模式及其转换打印模式及其转换打印模式及其转换

B.1 综述综述综述综述

打印机有两种工作模式:标准模式和页模式。在标准模式下,只要打印机行缓冲区满或者接收

到打印或进纸指令,打印机就打印并进纸。而在页模式下,所有的打印数据和进纸指令都被存储在

指定的内存空间里,打印机不执行任何操作。直到接收到一个ESC FF 或 FF 指令,打印机将会把

打印区域所有内容都打印出来。

例如:当打印机在标准模式下接收到“ABCDEF”<LF>时,它立刻将“ABCDEF”打印出来,

并进纸一行。而在页模式下,打印机将“ABCDEF”写到内存中的打印区域中,接下来的打印数据

放在打印区域的下一行。ESC L 指令将打印机切换到页模式,在此之后的所有数据都在页模式下

处理。这样执行ESC FF指令能将接收到的所有数据打印出来,而执行FF 指令不但能将接收到的所

有数据打印出来,而且还将打印机切换到标准模式。执行ESC S 指令也能将打印机切换到标准模

式,但是它不打印在页模式下接收到的数据,并且将这些数据清除掉。

图图图图 B.1 标准模式和页模式之间的切换标准模式和页模式之间的切换标准模式和页模式之间的切换标准模式和页模式之间的切换

B....2 在标准模式和页模式下设定各种值在标准模式和页模式下设定各种值在标准模式和页模式下设定各种值在标准模式和页模式下设定各种值

1) 有些命令(如:ESC SP、 ESC 2、ESC 3、和 FS S)既可以用在标准模式下又可以用

在页模式,而且它们的参数也相同。但是在两种模式下的设置是独立的,它们被分别存储

起来。

B....3 打印区域设置打印区域设置打印区域设置打印区域设置

1) 打印区域是由ESC W指令设置的。如果在接收到ESC W指令之前所有的打印和进纸操作

都已经完成,则打印机以左边(当你面对打印机时)作为打印区域的坐标原点(x0,y0)。

矩形打印区域的宽度(dx 点)在 x 向(垂直于进纸方向)从坐标原点(x0,y0)向右扩

展,高度(dy 点)在 y 向(进纸方向)。如果没有用ESC W设置打印区域,则打印区域

采用Default。

2) 打印机在打印区域和打印区域方向(由ESC T指令设置)设置之后,接收到的打印数据将会

在打印区域内按照图B.2所示位置排列,A点为打印区域的起始位置,这是个Default。(当

一个字符被打印时,A 点作为基线)

打印数据中的下载的位图或条码数据以当前位置作为其左下角(图B.3中的B点),与基线

对齐。

3) 在接收到一个包含有进纸的命令(如:LF 或 ESC J)之前,如果打印数据(包括字符间

距)已经超出打印区域,则打印机自动进纸一行(进纸多少,取决于由ESC 2和ESC 3设

置的行高),同时打印位置移到下一行行首。

4) 默认行高是4mm(约1/6英寸),相当于纵向上32点。如果在下一行的打印数据中含有在纵

向上放大超出2倍的字符,或者位图占用2行甚至更多行,以及条码比正常字符高时,打印机

进纸量不能满足需要,造成打印的字符和上一行打印的字符叠加。为了避免这些,可以增加

行高。

例如

当打印一个6个字节高度的下载位图时,用下边公式:

{纵向点数(8×6)- 打印区域起始位置的进纸点数(24)} × 纵向移动单位(203/203)

= 24,也就是说,要打印出完整的位图,需要在打印区域起始位置的基础上将打印位置下

移24点。

用下列命令:

ESC W xL, xH, yL, yH, dxL, dxH, dyL, dyH

ESC T n

ESC 3 24 �设置新的行高

LF �走纸一行

GS / 1

ESC 2 �将行高恢复到Default

图图图图 B.2 字符数据的存储位置字符数据的存储位置字符数据的存储位置字符数据的存储位置

图图图图 B.3 打印数据的存储位置打印数据的存储位置打印数据的存储位置打印数据的存储位置

图图图图 B.3 下载位图的存储位置下载位图的存储位置下载位图的存储位置下载位图的存储位置