Referencia de Comandos VKP80II
Referencia de Comandos VKP80II
Referencia de Comandos VKP80II
VKP80
VKP80II
STA
T
LIN US
E FE
ED
RS23
FOR
M
ETH FEED
ERN
ET
USB
Vin
VKP80II-EE
Edit by:
CUSTOM ENGINEERING S.p.A.
Str. Berettine 2 - 43010 Fontevivo (PARMA) - Italy
http: www.custom.biz
All rights reserved
Command Reference
Introduction
1 INTRODUCTION
1.1 Command description
Each command reported in this manual is described as shown in the following picture. In the first heading
line (grey colour) is reported the hexadecimal command value. In the second heading line are listed the printers on which it is possible to use the command (for example printer AAAA).
The next fields give all the information useful to use the command.
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Command title
ASCII, hexadecimal and decimal command value.
Limits of the values the command and its variables can take
Description of command function
Additional information about command use and settings .
Default value of the command and its variables.
Pertaining commands related to described command.
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$
$0A
0A
X Y
The information reported in the picture are aligned with line X or line Y:
LINE X
Description valid for all the printers listed in the second heading line.
LINE Y
Description valid for a specific printer (written in bold).
LEGEND
$
{}
n, m, t, x, y
indicates the representation of the command hexadecimal value (for example $40 means
HEX 40).
indicates an ASCII character not performable.
are optional parameters that can have different values.
Command Reference
Introduction
1.2 Print direction
The printer has two printing direction which can be selected by means of the control characters: normal and
reverse.
ABCDEFGHILMNOPQRS
abcdefghilmnopqrs
1234567890
PAPER OUTFEED DIRECTION
1234567890
abcdefghilmnopqrs
ABCDEFGHILMNOPQRS
Normal Mode
Command Reference
Reverse Mode
ESC/POS Emulation
2 ESC/POSTM EMULATION
The following table lists all the commands for function management in ESC/POS Emulation of the printer.
The commands can be transmitted to the printer at any moment, but they will only be carried out when the
commands ahead of them have been executed. The commands are carried out when the circular buffer is
free to do so.
COMMAND DESCRIPTION TABLE
Tab.1
Com. HEX
Com. ASCII
Description
PRINT COMMANDS
$0A
LF
$0C
FF
Form feed
$0D
CR
$1B $0C
ESC FF
$1B $4A
ESC J
$1B $64
ESC d
$1B $30
ESC 0
$1B $32
ESC 2
$1B $33
ESC 3
CHARACTER COMMANDS
$18
CAN
$1B $20
ESC SP
$1B $21
ESC !
$1B $25
ESC %
$1B $26
ESC &
$1B $2D
ESC -
$1B $34
ESC 4
$1B $3F
ESC ?
$1B $45
ESC E
$1B $47
ESC G
$1B $4D
ESC M
$1B $52
ESC R
$1B $56
ESC V
$1B $74
ESC t
$1B $7B
ESC { }
$1B $C1
ESC { }
$1D $21
GS !
$1D $42
GS B
$08
BS
Back space
$09
HT
Horizontal tab
$1B $24
ESC $
ESC ( v
$1B $44
ESC D
ESC/POS Emulation
$1B $54
ESC T
$1B $57
ESC W
$1B $5C
ESC \
$1B $61
ESC a
Select justification
$1D $24
GS $
$1D $4C
GS L
$1D $57
GS W
$1D $5C
GS \
BIT-IMAGE COMMANDS
$1B $2A
ESC *
$1D $2A
GS *
$1D $2F
GS /
GS v 0
STATUS COMMANDS
$10 $04
DLE EOT
$1B $76
ESC v
$1D $72
GS r
Transmit status
$1D $E0
GS { }
$1D $E1
GS { }
$1D $E2
GS { }
$1D $E3
GS { }
$1D $E4
GS { }
$1D $E5
GS { }
$1D $48
GS H
$1D $66
GS f
$1D $68
GS h
$1D $6B
GS k
Print barcode
$1D $77
GS w
BARCODE COMMANDS
$1D $3A
GS :
$1D $5E
GS ^
Execute macro
$1B $69
ESC i
Total cut
$1D $56
GS V
MISCELLANEOUS COMMANDS
$1B $3D
ESC =
$1B $40
ESC @
Initialize printer
$1B $4C
ESC L
$1B $53
ESC S
ESC c 5
$1B $FA
ESC { }
$1B $FF
ESC { }
$1C $C0
FS { }
GS C 0
GS C 1
Command Reference
ESC/POS Emulation
$1D $43 $32
GS C 2
Select counter
GS C ;
$1D $49
GS I
Transmit printer ID
$1D $50
GS P
$1D $63
GS c
Print counter
$1D $D0
GS { }
$1D $E6
GS { }
$1D $7C
GS { }
$1D $E7
GS { }
$1D $F0
GS { }
$1D $F6
GS { }
$1D $F8
GS { }
GS e
Ejector commands
EJECTOR COMMANDS
$1D $65
Command Reference
ESC/POS Emulation
Given below are more detailed descriptions of each command.
$08
Printers:
[Name]
[Format]
Back space
ASCII
Hex
Decimal
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
BS
08
8
$09
Printers:
[Name]
[Format]
Horizontal tab
ASCII
HT
Hex
09
Decimal
9
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$0A
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Prints the data in the buffer and feeds one line based on the current line spacing.
Sets the print position to the beginning of the line.
$0D
Command Reference
ESC/POS Emulation
$0C
Printers:
[Name]
[Format]
Form Feed
ASCII
FF
Hex
0C
Decimal
12
Prints the data in the buffer, cuts the paper and presents the ticket.
[Description]
[Notes]
[Default]
[Reference]
[Example]
$0D
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$10 $04 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
Command Reference
ESC/POS Emulation
[Example]
OFF/ON
HEX
Decimal
RESERVED.
RESERVED.
FUNCTION
RESERVED.
Off
00
On-line.
On
08
Off-line.
RESERVED.
Not defined.
Not defined.
RESERVED.
OFF/ON
HEX
Decimal
RESERVED.
1
2
3
4
5
6
7
FUNCTION
RESERVED.
Off
00
Cover closed.
On
04
Cover opened.
Off
00
On
08
RESERVED.
Off
00
Paper present
On
20
32
Off
00
No error.
On
40
64
Error.
RESERVED.
OFF/ON
HEX
Decimal
RESERVED.
RESERVED.
RESERVED.
3
4
5
6
7
10
Command Reference
FUNCTION
Off
00
Cutter ok
On
08
Cutter error
RESERVED.
Off
00
No unrecoverable error.
On
20
32
Unrecoverable error.
Off
00
No auto-recoverable error.
On
40
64
Auto-recoverable error.
RESERVED.
ESC/POS Emulation
n=4: Paper roll sensor status
BIT
OFF/ON
HEX
Decimal
RESERVED.
RESERVED.
2,3
4
5, 6
7
FUNCTION
Off
00
On
0C
12
RESERVED.
Off
00
Paper present
On
60
96
RESERVED.
OFF/ON
HEX
Decimal
RESERVED.
RESERVED.
FUNCTION
RESERVED.
Off
00
On
08
RESERVED.
RESERVED.
RESERVED.
RESERVED.
OFF/ON
HEX
Decimal
RESERVED.
FUNCTION
RESERVED.
Off
00
On
04
RESERVED.
RESERVED.
Off
00
Paper present.
Printing stop due to paper end.
On
20
32
RESERVED.
RESERVED.
Command Reference
11
ESC/POS Emulation
n=20: FULL status (6 bytes)
1st Byte = $10 (DLE);
2nd Byte = $0F;
3rd Byte = paper status
BIT
0
1
OFF/ON
HEX
Decimal
Off
00
Paper present.
FUNCTION
On
01
RESERVED.
Off
00
On
04
RESERVED.
RESERVED.
Off
00
On
20
32
Off
00
On
40
64
Off
00
On
80
128
5
6
7
Notch found
(*) Virtual paper end is set when the paper length available, readed by $1D $E1, is 0.
12
Command Reference
OFF/ON
HEX
Decimal
Off
00
Cover closed
FUNCTION
On
01
Cover opened.
Off
00
Cover closed
On
02
Cover opened.
Off
00
No spooling.
On
04
Spooling.
Off
00
On
08
RESERVED.
Off
00
LF key released
On
20
32
LF key pressed.
Off
00
FF key released.
On
40
64
FF key pressed.
RESERVED.
ESC/POS Emulation
OFF/ON
HEX
Decimal
Off
00
FUNCTION
On
01
Off
00
No COM error
On
02
RESERVED.
Off
00
On
08
RESERVED.
Off
00
Acknowledge command
On
20
32
Off
00
On
Paper jam
RESERVED.
OFF/ON
HEX
Decimal
FUNCTION
Off
00
Cutter ok
On
01
Cutter error
RESERVED.
Off
00
RAM ok.
On
00
RAM error
Off
0C
12
EEPROM ok.
On
EEPROM error.
RESERVED.
RESERVED.
Off
Flash ok.
On
Flash error
RESERVED.
$18
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Reference]
[Example]
Command Reference
13
ESC/POS Emulation
$1B $0C
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
In page mode, prints all buffered data in the printing area collectively.
This command is enabled only in page mode.
After printing, the printer does not clear the buffered data, setting values for $1B $54
and $1B $57 and the position for buffering character data.
$0C, $1B $4C, $1B $53
$1B $20 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $21 n
Printers:
[Name]
[Format]
[Range]
[Description]
14
Command Reference
ESC/POS Emulation
BIT
0
1
2
3
4
5
6
7
[Notes]
[Default]
[Reference]
[Example]
OFF/ON
HEX
Decimal
FUNCTION
11/15 cpi
15/20 cpi
Off
00
18 x 24
14 x 24
On
01
14 x 24
10 x 24
Undefined.
Undefined.
Off
00
On
08
Off
00
On
10
16
Off
00
On
20
32
Off
00
On
40
64
Off
00
On
80
128
The printer can underline all characters, but cannot underline the spaces set by $09,
$1B $24, $1B $5C and 90/270 rotated characters.
This command resets the left and right margin at default value (see $1D $4C, $1D
$57).
$1B $45 can also be used to turn the emphasized mode on/off. However, the last-received
setting command is the effective one.
$1B $2D can also be used to turn the underlining mode on/off. However, the last-received
setting command is the effective one.
$1D $21 can also be used to select character height/width. However, the last-received
setting command is the effective one.
$1B $34 can also be used to turn the italic mode on/off. However, the last-received setting command is the effective one.
n=0
$1B $2D, $1B $34, $1B $45, $1D $21
$1B $24 nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
Command Reference
15
ESC/POS Emulation
If the setting is outside the printing area width, it sets the absolute print position, but the
left or right margin is set at default value.
The horizontal and vertical motion unit are specified by $1D $50 or $1D $D0.
$1D $50 or $1D $D0 can change the horizontal (and vertical) motion unit. However, the
value cannot be less than the minimum horizontal movement amount.
[Default]
[Reference]
[Example]
$1B $25 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
[Name]
[Format]
[Range]
[Description]
[Notes]
16
Command Reference
ESC/POS Emulation
[Default]
[Reference]
[Example]
d is the dot data for the characters. The dot pattern is in the horizontal direction starting
from the left. Any remaining dots on the right remain blank.
The data to define a user-defined character is ( X Y) bytes.
To print a dot, set the corresponding bit to 1; to not have it print, set to 0.
This command can define different user-defi ned character patterns for each font. To
select the font, use $1B $21, $1B $C1.
The user-defi ned character defi nitions are cleared when:
$1B $40 or $1D $2A or $1B $3F are executed or the printer is reset or the power shut
off.
Internal character set.
$1B $25, $1B $3F
18 dots (11 cpi)
14 dots (15 cpi)
p1
p2
MSB
LSB
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $50
Command Reference
17
ESC/POS Emulation
$1B $2A m nL nH d1...dk
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
VERTICAL DIRECTION
HORIZONTAL DIRECTION
MODE
N dots
DPI
DPI
N of data (k)
67
100
nL + nH x 256
67
200
nL + nH x 256
32
24
200
100
(nL + nH x 256) x 3
33
24
200
200
(nL + nH x 256) x 3
The nL and nH parameters indicate the number of dots of the bit image in the horizontal
direction. The number of dots is calculated using: nL + nH x 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 the dot.
If the value of m is outside the specified range, nL and data following it are processed
as normal data.
If the width of the printing area set by $1D $4C and $1D $57 is less than the width required by the data set using $1B $2A, the excess data are ignored.
To print the bit image use $0A, $0D, $1B $4A or $1B $64.
After printing a bit image, the printer returns to normal data processing mode.
This command is not affected by the emphasized, double-strike, underline (etc.) print
modes, except for the upside-down mode.
The relationship between the image data and the dots to be printed is as follows:
8-dot bit image
MSB
d1 d2 d3
Bitimage
data
LSB
Print data
18
Command Reference
d1 d4 d7
d2 d5 d8
d3 d6 d9
Print data
MSB
Bitimage
data
LSB
ESC/POS Emulation
[Default]
[Reference]
[Example]
$1B $2D n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $30
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $32
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Command Reference
19
ESC/POS Emulation
$1B $33 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $34 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
20
Function
0, 48
1, 49
Command Reference
ESC/POS Emulation
$1B $3D n
Printers:
[Name]
[Format]
[Range]
[Description]
Bit
Decimal
Function
Off
00
Printer Disabled.
01
Printer Enabled.
Undefined
Undefined
Undefined
Undefined
Undefined
Undefined
[Default]
[Reference]
[Example]
Hex
On
[Notes]
Off/On
Off
00
On
80
128
When the printer is disabled, it ignores all transmitted data until the printer is enabled
through this command.
When the Pass-trough function is enabled, all transmitted data are sent on the 2nd serial.
n=1
$1B $3F n
Printers:
[Nome]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Command Reference
21
ESC/POS Emulation
$1B $40
Printers:
[Name]
[Format]
Initialize printer
ASCII
ESC @
Hex
1B
40
Decimal
27
64
Clears the data in the print buffer and resets the printer mode to that in effect when power
was turned on.
The data in the receiver buffer is not cleared.
The macro definitions are not cleared.
[Description]
[Notes]
[Default]
[Reference]
[Example]
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
22
Command Reference
ESC/POS Emulation
$1B $45 n
Printers:
[Name]
[Format]
[Range]
[Description]
0 n 255
Turns emphasized mode on/off.
When the LSB of n is 0, the emphasized mode is off.
When the LSB of n is 1, the emphasized mode is on.
Only the LSB of n is effective.
$1B $21 also turns on and off the emphasized mode. However, the last received command is the effective one.
n=0
$1B $21
[Notes]
[Default]
[Reference]
[Example]
n
n
n
$1B $47 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $4A n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
Command Reference
23
ESC/POS Emulation
In standard mode, the vertical motion unit is used.
The horizontal and vertical motion units are specified by $1D $50 or $1D $D0.
$1D $50 or $1D $D0 can change the vertical (and horizontal) motion unit. However, the
value cannot be less than the minimum vertical movement amount.
[Default]
[Reference]
[Example]
$1B $4C
Printers:
[Nome]
[Formato]
[Description]
[Notes]
[Reference]
[Example]
24
Command Reference
ESC/POS Emulation
$1B $4D n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Char /Inch
Function
A=11cpi
B=15cpi
0,48
1,49
A=15cpi
B=20cpi
0,48
1,49
A=20cpi
B=15cpi
0,48
1,49
$1B $C1
$1B $52 n
Printers:
[Name]
[Format]
[Range]
[Description]
Hex
23
24
40
5B
5C
5D
5E
60
7B
7C
7D
7E
Characters Set
U.S.A.
France
Germany
United Kingdom
Denmark I
Sweden
Italy
Spain 1
Pt
Japan
Norway
10
Denmark II
[Notes]
[Default]
[Reference]
[Example]
n=0
Command Reference
25
ESC/POS Emulation
$1B $53
Printers:
[Name]
[Format]
[Description]
[Notes]
[Reference]
[Example]
$1B $54 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
26
PRINT DIRECTION
STARTING POSITION
0, 48
Left to right
Upper left
1,49
Bottom to top
Lower left
2,50
Right to left
Lower right
3,51
Top to bottom
Upper right
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 $1B $57.
Parameters for horizontal or vertical motion units ( x or y) differ as follows,depending
on the starting position of the printing area:
1) 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:
Command Reference
ESC/POS Emulation
[Default]
[Reference]
[Example]
Commands using horizontal motion units: $1B $20, $1B $24, $1B $5C.
Commands using vertical motion units: $1B $33, $1B $4A, $1D $24, $1D $5C.
2) 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: $1B $33, $1B $4A, $1D $24, $1D $5C.
Commands using vertical motion units: $1B $20, $1B $24, $1B $5C.
n=0
$1B $24, $1B $4C, $1B $57, $1B $5C, $1D $24, $1D $50, $1D $5C.
$1B $56 n
Printers:
[Name]
[Format]
[Range]
[Description]
FUNCTION
0, 48
1, 49
[Notes]
When underlined mode is turned on, the printer does not underline 90 rotated characters. All the same its possible select the underline mode.
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.
This command is not available in Page mode.
If this command is entered in Page mode, the printer all the same save the setting.
[Default]
[Reference]
[Example]
n=0
$1B $21 , $1B $2D
[Name]
[Format]
[Range]
[Description]
Command Reference
27
ESC/POS Emulation
[Notes]
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 $1B
$54 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 $1D $50. Changing the horizontal
or vertical motion unit does not affect the current printing area.
The $1D $50 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.
[Default]
[Reference]
[Example ]
$1B $5C nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
28
Command Reference
ESC/POS Emulation
[Default]
[Reference]
[Example]
$1B $61 n
Printers:
[Name]
[Format]
Select justification
ASCII
ESC a
n
Hex
1B
61
n
Decimal
27
97
n
0 n 2, 48 n 50
Aligns all data in one line to the specified position. n selects the type of justification as follows:
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
JUSTIFICATION
0, 48
Flush left
1, 49
Centered
2, 50
Flush right
Centred
ABC
ABCD
ABCDE
ABC
ABCD
ABCDE
Flush right
ABC
ABCD
ABCDE
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
FUNCTION
n=1
Command Reference
29
ESC/POS Emulation
$1B $64 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $69
Printers:
[Name]
[Format]
Total cut
ASCII
ESC i
Hex
1B
69
Decimal
27
105
This command enables cutter operation. If there is no cutter, a disabling flag is set and
any subsequent cut commands will be ignored.
The printer waits to complete all paper movement commands before it executes a total cut.
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1B $74 n
Printers:
[Name]
[Format]
[Range]
[Description]
30
PAGE
2 (PC850 [Multilingual])
3 (PC860 [Portuguese])
4 (PC863 [Canadian-French])
5 (PC865 [Nordic])
19
255
Space page
Command Reference
ESC/POS Emulation
[Notes]
[Default]
[Reference]
[Example]
n=0
See character code table.
For printing Euro symbol (), the command sequence is: 1B, 74, 13, D5
$1B $76
Printers:
[Name]
[Format]
[Description]
BIT
OFF/ON
0,1
2,3
[Note]
[Default]
[Reference]
[Example]
HEX
Decimal
FUNCTION
Off
00
On
03
Off
00
On
(0C)
(12)
Off
00
Undefined.
Undefined.
Off
00
[RESERVED]
This command is executed immediately, even when the data buffer is full (Busy).
After the paper autoload all buffers (receive and print) are cleared.
$10 $04 n
$1B $7B n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
Command Reference
31
ESC/POS Emulation
Upside-down printing Off
Upside-down printing On
ABCDEFG
123456
[Example]
ABCDEFG
123456
Printing direction
$1B $C1 n
Printers:
[Name]
[Format]
[Range]
[Description]
n
0, 48
[Default]
[Reference]
[Example]
FUNCTION
Font A = 11 cpi
Font B = 15 cpi
1, 49
Font A = 15 cpi
Font B = 20 cpi
2,50
Font A = 20 cpi
Font B = 15 cpi
n=0
$1B $21
$1B $FA n xH xL yH yL
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
32
FUNCTION
Command Reference
ESC/POS Emulation
$1B $FF n nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
FUNCTION
[Default]
[Reference]
[Example]
$1C $C0 xH xL yH yL dxH dxL dyH dyL xlH xlL ylH ylL num
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
Command Reference
33
ESC/POS Emulation
[Example]
LOGO
GRAPHIC PAGE
$1D $21 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
34
n
n
n
HEX
Decimal
Width
HEX
Decimal
Height
00
1 (normal)
00
1 (normal)
10
16
2 (width = 2x)
01
2 (height = 2x)
20
32
3 (width = 3x)
02
3 (height = 3x)
30
48
4 (width = 4x)
03
4 (height = 4x)
40
64
5 (width = 5x)
04
5 (height = 5x)
50
80
6 (width = 6x)
05
6 (height = 6x)
60
96
7 (width = 7x)
06
7 (height = 7x)
70
112
8 (width = 8x)
07
8 (height = 8x)
Command Reference
ESC/POS Emulation
[Default]
[Reference]
[Example]
n=0
$1B $21
$1D $24 nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Reference]
[Example]
[Name]
[Format]
[Range]
[Description]
[Notes]
Command Reference
35
ESC/POS Emulation
The following figure shows the relationship between the downloaded bit image and the
printed data.
x * 8 dots
d1
dy+1
MSB
dy*2+1
y * 8 dots
d2
LSB
dy
dy*2
dx*y*8
[Default]
[Reference]
[Example]
$1D $5C
$1D $2F m
Printers:
[Name]
[Format]
[Description]
[Notes]
36
m
m
m
using the mode specified by m. m selects a mode from
MODE
0,48
Normal
1, 49
Double-width
2, 50
Double-height
3, 51
Quadruple
This command is ignored if a downloaded bit image has not been defined.
In standard mode, this command is effective only when there is no data in the print
buffer.
This command has no effect in the print modes (emphasized, underline, character size,
or white/black reverse printing), except for upside-down printing mode.
If the downloaded bit-image to be printed exceeds the printable area, the excess data
is not printed.
If the printing area width set by $1D $4C and $1D $57 is less than the bit image horizontal size, the following processing is performed:
1) The printing area width is extended toward the right side up to hold the bit image. In
this case, printing does not exceed the printable area.
Command Reference
ESC/POS Emulation
2) If the printing area width cannot be extended toward the right side, because theres
no more printing area, the left margin is reduced to accommodate the bit image.
[Default]
[Reference]
[Example]
$1D $2A
$1D $3A
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $42 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Command Reference
37
ESC/POS Emulation
$1D $43 $30 n m
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Printing position
0,48
Flush right
1,49
Flush right
2,50
Flush left
If n or m is out of the defi ned range, the previously set print mode is not changed.
If n = 0, m is not applicable.
n = 0, m = 0
$1D $43 $31, $1D $43 $32, $1D $43 $3B, $1D $63
n = 3,m = 0
n = 3, m = 1 n = 3, m=2
1
001
1
indicates a space
[Name]
[Format]
[Range]
[Description]
[Notes]
38
Command Reference
ESC/POS Emulation
[Default]
[Reference]
[Example]
Setting the count-down mode, the maximum counter value is [aL + (aH * 256)] and the
minimum value is [bL + (bH * 256)]. If the counting down reaches a value less than the
minimum, it resets to the maximum value.
When this command is executed, the internal count that indicates the repetition number
specified by r is cleared.
aL = 1, aH = 0, bL = 255, bH = 255, n = 1, r = 1
$1D $43 $30, $1D $43 $32, $1D $43 $3B, $1D $63
[Name]
[Format]
Set counter
ASCII
GS
C
2
nL
nH
Hex
1D
43
32
nL
nH
Decimal
29
67
50
nL
nH
0 nL, nH 255
Sets the serial number counter value.
nL and nH determine the value of the serial number counter set by [nL + (nH * 256)].
In count-up mode, if the counter value specified by this command goes out of the counter
operation range specified by $1D $43 $31 or $1D $43 $3B, it is forced to convert to the
minimum value through $1D $63.
In count-down mode, if the counter value specifi ed by this command goes out of the
counter operation range specified by $1D $43 $31 or $1D $43 $3B, it is forced to convert
to the maximum value through $1D $63.
nL = 1, nH = 0
$1D $43 $30, $1D $43 $31, $1D $43 $3B, $1D $63
[Range]
[Description]
[Note]
[Default]
[Reference]
[Example]
[Name]
[Format]
[Range]
[Description]
[Notes]
Command Reference
39
ESC/POS Emulation
[Default]
[Reference]
[Example]
In setting count-up mode, the minimum value of the counter is sa and the maximum value
is sb. If counting up reaches a value exceeding the maximum, it resets to the minimum
value. If the counter value set by sc is outside the counter operation range, the counter
value is forced to convert to the minimum value by executing $1D $63.
In setting count-down mode, the maximum value of the counter is sa and the minimum
value is sb. If counting down reaches a value less than the minimum, it resets to the
maximum value. If the counter value set by sc is outside the counter operation range,
the counter value is forced to convert to the maximum value by executing $1D $63.
Parameters sa to sc can be omitted. If omitted, they remain unchanged.
Parameters sa to sc cannot contain characters other than 0 to 9.
sa = 1, sb = 65535, sn = 1, sr = 1, sc = 1
$1D $43 $30, $1D $43 $32, $1D $43 $31, $1D $63
$1D $48 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
40
FUNCTION
0, 48
Not printed
1, 49
2, 50
3, 51
HRI characters are printed using the font specified by $1D $66.
n=0
$1D $66, $1D $68
Command Reference
ESC/POS Emulation
$1D $49 n
Printers:
[Name]
[Format]
Transmit printer ID
ASCII
GS
I
n
Hex
1D
49
n
Decimal
29
73
n
1 n 3, 49 n 51
Transmits the printer ID specified by n follows:
[Range]
[Description]
[Notes]
Printer ID
Specification
1, 49
Printer model ID
2, 50
Type ID
Undefined
3, 51
ROM version ID
The printer only transmits 1 byte (printer ID) without confi rmation that the host is ready
to receive data.
This command is executed when the data is processed in the data buffer. Therefore,
there could be a time lag between command reception and data transmission, depending
on data buffer status.
[Default]
[Reference]
[Example]
$1D $4C nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
Printable area
Left margin
[Notes]
Command Reference
41
ESC/POS Emulation
The $1D $50 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.
The horizontal and vertical motion unit are specifi ed by $1D $50 or $1D $D0. Changing
the horizontal or vertical motion unit does not affect the current left margin.
The $1D $50 or $1D $D0 command can change the horizontal (and vertical) motion
unit.
[Default]
[Reference]
[Example]
[Name]
[Format]
[Range]
[Description]
[Notes]
$1D $56 m,
x = 204, y = 408
(for the 204 dpi model)
$1B $4A, $1D $4C, $1D $57, $1D $D0
$1D $56 m n
Printers:
[Name]
[Format]
[Range]
42
Command Reference
m
56
86
m
56
86
m
m
n
m
m
n
n
ESC/POS Emulation
[Description]
Selects cut mode and executes the cut command. m selects cut mode as follows:
m
0, 48
65
[Notes]
[Default]
[Reference]
[Example]
FUNCTION
Total cut
Form feed (cut position + [ n x vertical motion unit]) and total cut
$1D $57 nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
Printable area
Left margin
[Notes]
[Default]
[Reference]
[Example]
Command Reference
43
ESC/POS Emulation
$1D $5C nL nH
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Reference]
[Example]
$1D $5E r t m
Printers:
[Name]
[Format]
Execute macro
ASCII
GS
^
r
t
m
Hex
1D
5E
r
t
m
Decimal
29
94
r
t
m
0 r, t 255
0m1
Executes a macro.
r specifies the number of times to execute the macro.
t specifies the waiting time for executing the macro. The waiting time is t 100 msec.
for each macro execution.
m specifies macro executing mode: When the LSB of m = 0, the macro is executed r
times continuously at the interval specified by t.
When the LSB of m = 1, after waiting for the period specifi ed by t, the LED indicator blinks and the printer waits for the FEED button to be pressed. After the button
is pressed, the printter executes the macro once. The printer repeats the operation r
times.
[Range]
[Description]
[Notes]
44
Command Reference
ESC/POS Emulation
If the macro is not defined or if r is 0, nothing is executed.
When the macro is executed by pressing the LINE FEED button (m=1), the paper cannot be fed using the LINE FEED button.
[Default]
[Reference]
[Example]
$1D $3A
$1D $63
Printers:
[Name]
[Format]
Print counter
ASCII
Hex
Decimal
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
GS
1D
29
c
63
102
Sets the serial counter value in the print buffer and increments or decrements the counter
value.
After setting the current counter value in the print buffer as print data (a character
string),the printer counts up or down based on the count mode set. The counter value in
the print buffer is printed when the printer receives a print command or the buffer is full.
The counter print mode is set using $1D $43 $30.
The counter mode is set using $1D $43 $31 or $1D $43 $3B.
In count-up mode, if the counter value set by this command goes out of the counter
operation range set by $1D $43 $31 or $1D $43 $3B, it is forced to revert to the minimum
value.
In count-down mode, if the counter value set by this command goes out of the counter
operation range set by $1D $43 $31 or $1D $43 $3B, it is forced to revert to the maximum
value.
$1D $43 $30, $1D $43 $31, $1D $43 $32, $1D $43 $3B
$1D $65 n m
Printers:
[Name]
[Format]
Ejector commands
ASCII
GS
Hex
1D
Decimal
29
1 n 3, 5 n 6,
[Range]
[Description]
e
n
m
65
n
m
101
n
m
n = 8, n = 18, n = 20 n = 32; 0 t 255
Command Reference
45
ESC/POS Emulation
Bit
0
1
2
3
4
5
6
7
Off/On
Hex
Decimal
Function
Off
00
On
01
Off
00
RESERVED
Off
00
On
04
Off
00
On
08
Off
00
On
10
16
Off
00
On
20
32
Emitter motor on
Off
00
Not error
On
40
64
Error
Off
00
On
80
128
Paper jam
n = 8 sets the length of thicket dispense with m steps (1 step =7.3 mm).
n = 18 Disable the dispenser continuous mode, sets the normal functioning: when printing
the ticket remaines in the outlet paper mouth, unitl a cut command or eject command will
be sent.
n = 20 Enable the dispenser continuous mode: when printing the ticket doesnt remain in
the outlet paper mouth, but continuously presented it.
n = 32 Produce a ticket with m steps (1 step = 7.3 mm) and a timeout t
(t = 1 z1 sec. t = 2 z2 sec)
[Notes]
[Reference]
[Example]
46
Command Reference
ESC/POS Emulation
$1D $66 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
FONT
0, 48
Font A
1, 49
Font B
$1D $68 n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
n = 162
$1D $6B
Command Reference
47
ESC/POS Emulation
$1D $6B m [d1...dk] $00,
Printers:
[Name]
[Format]
Print barcode
ASCII
Hex
Decimal
ASCII
Hex
Decimal
0 m 20
65 m 90
[Range]
[Description]
[Notes]
48
GS
1D
29
GS
1D
29
k
6B
107
k
6B
107
m
m
m
m
m
m
NUL
00
0
n
n
n
Selects a bar code system and prints the bar code. m selects a bar code system as follows:
m
BARCODE SYSTEM
No. OF CHARACTERS
REMARKS
UPC-A
11 k 12
48 d 57
UPC-E
11 k 12
48 d 57
EAN13 (JAN)
12 k 13
48 d 57
EAN8 (JAN)
7k8
48 d 57
CODE39
1k
48 d 57, 65 d 90,
32, 36, 37, 43, 45, 46, 47
ITF
1 k (even number)
48 d 57
CODABAR
1k
48 d 57, 65 d1 68,
36, 43, 45, 46, 47, 58
CODE93
1 k 255
1 d 127
CODE128
2 k 255
1 d 127
20
CODE32
8k9
48 d 57
65
UPC-A
11 n 12
48 d 57
66
UPC-E
11 n 12
48 d 57
67
EAN13 (JAN)
12 n 13
48 d 57
68
EAN8 (JAN)
7n8
48 d 57
69
CODE39
1 n 255
70
ITF
1 n 255
48 d 57
71
CODABAR
1 n 255
48 d 57, 65 d1 68,
36, 43, 45, 46, 47, 58
72
CODE93
1 n 255
1 d 127
73
CODE128
2 n 255
1 d 127
90
CODE32
8n9
48 d 57
If d is outside of the specified range, the printer prints the following message: BAR CODE
GENERATOR IS NOT OK! and processes the data which follows as normal data.
If the horizontal size exceeds the printing area, the printer only feeds the paper.
This command feeds as much paper as is required to print the bar code, regardless of
the line spacing.
After printing the bar code, this command sets the print position to the beginning of the line.
This command is not affected by print modes (emphasized, double-strike, underline or
character size), except for upside-down and justification mode.
Command Reference
ESC/POS Emulation
[Note per
[Note per
[Default]
[Reference]
[Example]
DATA TRANSMISSION
SPECIFIC
CHARACTER
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
Command Reference
49
ESC/POS Emulation
$1D $72 n
Printers:
[Name]
[Format]
Transmit status
ASCII
GS
r
n
Hex
1D
72
n
Decimale
29
114
n
n =1, 49
Transmits the status specified by n as follows:
[Range]
[Description]
n
1, 49
FUNCTION
Transmits paper sensor status (as for $1B $76).
OFF/ON
HEX
Decimal
Off
00
On
03
Off
00
On
(0C)
(12)
RESERVED
Undefined.
Undefined.
RESERVED
0,1
2,3
[Notes]
[Default]
[Reference]
[Example]
FUNCTION
This command is executed when the data is processed in the data buffer. Therefore,
there may be a time lag between receiving the command and transmitting the status,
depending on data buffer status.
$10 $04, $1B $76
[Name]
[Format]
[Range]
[Description]
50
MODE
0,48
Normal
1, 49
Double width
2, 50
Double height
3, 51
Quadruple
Command Reference
ESC/POS Emulation
[Notes]
xL, xH selects the number of data bits (xL + xH 256) in the horizontal direction for the
bit image.
yL, yH selects the number of data bits (yL + yH 256) in the vertical direction for the bit image.
k shows the number of data of the image. Its an explanation parameter so it isnt necessary to transmit it.
d shows the data of the image.
In standard mode for receipt paper, this command is effective only when there is no data
in the print buffer.
The data (d) identify as 1 a printed bit and as 0 a non printed bit.
If a raster bit image is longer than one line, the surplus data arent printed.
This command has no effect in all print modes (character size, emphasized, upsidedown, underline, white/black reverse printing, etc.) for raster bit image, except the reverse
mode (90 anticlockwise rotation).
This command feed the paper as much as is necessary to print the raster bit image,
though the spacing set by $1B $32 or $1B $33.
Dont use this command during a macro execution because it cant be included in a macro.
After the printing, the printing position moves to the beginning of the line.
The following table shows the report between the image data and the printing result:
d1
d2
...
dx
dX+1
dX+2
...
dX x 2
...
...
dk-2
dk-1
[Default]
[Reference]
[Example]
$1D $77 n
Printers:
[Name]
[Format]
[Range]
VKP80, VKP80II
1n6
[Description]
VKP80II-EE
Sets the horizontal size of the bar code. n specifies the bar code width (referred
to the narrow bar) as follows:
n
MODULE WIDTH ( mm )
$1, $81
0.125
$2, $82
0.25
$3, $83
0.375
$4, $84
0.5
$5, $85
0.625
$6, $86
0.75
Command Reference
51
ESC/POS Emulation
If barcode CODE128 the wide and narrow bar ratio is the following:
n
If n<$80
If n>$80
3:1
$81
3:1
$82
2,5:1
$83
2,33:1
$84
2,25:1
$85
3:1
$86
3:1
VKP80, VKP80II
Sets the horizontal size of the bar code. n specifies the bar code width as follows:
[Notes]
[Default]
[Reference]
[Example]
MODULE WIDTH ( mm )
0.125
0.25
0.375
0.5
0.625
0.75
n=3
$1D $6B
$1D $7C n
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
52
PRINTING DENSITY
0, 48
- 50%
1, 49
- 37.5%
2, 50
- 25%
3, 51
- 12.5%
4, 52
0%
5, 53
+ 12.5%
6, 54
+ 25%
7, 55
+ 37.5%
8,56
+ 50%
Printing density reverts to the default value when the printer is reset or turned off.
n=4
Command Reference
ESC/POS Emulation
$1D $D0 xH xL yH yL (mode 2)
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $E0 n
Printers:
[Name]
[Format]
[Range]
[Description]
Bit
Off/On
0
1
2
3
Hex
Decimal
Function
Off
00
On
01
Off
00
On
02
Off
00
On
04
Off
00
On
08
Undefined
Undefined
Undefined
Undefined
Command Reference
53
ESC/POS Emulation
[Notes]
[Default]
[Reference]
[Example]
Once enable at least one byte of the FULL STATUS, for each change of at least one of
the bits which compose the required status, the status sent in automatic from the printer
will be so composed as follows:
1 Byte = 0x10 ($10)
2 Byte = n
Next byte (depends how many bits are active in in)
$10 $04 n
$1D $E1
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $E6
$1D $E2
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
54
Command Reference
ESC/POS Emulation
$1D $E3
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $E4
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $E5
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Command Reference
55
ESC/POS Emulation
$1D $E6 nH nL
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
To see the virtual paper-end is pointed out after 15 metres from the first detection of near
paper end, its necessary convert 15 metres in 1500 centimetres and then, calculate nH
and nL value in the following mode:
nH = 1500 / 256 = 5
nL = 1500 - (nH x 256) = 1500 - (5 x 256) = 220
and then send the following command:
Hex:
$1D
$E6
$05
$DC
Decimal:
29
230
5
220
$1D $E7 nH nL
Printers:
[Name]
[Format]
[Range]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $F0 n
Printers:
[Name]
[Format]
[Range]
[Description]
0n2
Sets printing speed. n specifies the printing speed as follows:
56
Command Reference
{}
F0
240
n
n
n
ESC/POS Emulation
[Notes]
[Default]
[Reference]
[Esempio]
PRINTING SPEED
High quality
Normal
High speed
Printing speed reverts to the default value when the printer is reset or turned off.
n=1
$1D $F6
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
$1D $F8
Printers:
[Name]
[Format]
[Description]
[Notes]
[Default]
[Reference]
[Example]
Command Reference
57
ESC/POS Emulation
58
Command Reference
Commands Index
3 COMMANDS INDEX
ESC/POSTM EMULATION
$08............................................................................8
$09............................................................................8
$0A ...........................................................................8
$0C ...........................................................................9
$0D ...........................................................................9
$10 $04 n..................................................................9
$18..........................................................................13
$1B $0C..................................................................14
$1B $20 n ...............................................................14
$1B $21 n ...............................................................14
$1B $24 nL nH ........................................................15
$1B $25 n ...............................................................16
$1B $26 y c1 c2 [x1 d1...d (y x x1)]...[xkd1...d (y x
xk)] ..........................................................................16
$1B $28 $76 nL nH .................................................17
$1B $2A m nL nH d1...dk ........................................18
$1B $2D n...............................................................19
$1B $30 ..................................................................19
$1B $32 ..................................................................19
$1B $33 n ...............................................................20
$1B $34 n ...............................................................20
$1B $3D n...............................................................21
$1B $3F n ...............................................................21
$1B $40 ..................................................................22
$1B $44 [n1...nk] $00 .............................................22
$1B $45 n ...............................................................23
$1B $47 n ...............................................................23
$1B $4A n ...............................................................23
$1B $4C..................................................................24
$1B $4D n...............................................................25
$1B $52 n ...............................................................25
$1B $53 ..................................................................26
$1B $54 n ...............................................................26
$1B $56 n ...............................................................27
$1B $57 xL xH yL yH dxL dxH dyL dyH ..................27
$1B $5C nL nH .......................................................28
$1B $61 n ...............................................................29
$1B $63 $35 n ........................................................29
$1B $64 n ...............................................................30
$1B $69 ..................................................................30
$1B $74 n ...............................................................30
$1B $76 ..................................................................31
$1B $7B n ...............................................................31
$1B $C1 n...............................................................32
$1B $FA n xH xL yH yL ...........................................32
$1B $FF n nL nH ....................................................33
$1C $C0 xH xL yH yL dxH dxL dyH dyL xlH xlL ylH
ylL num ...................................................................33
$1D $21 n ...............................................................34
$1D $24 nL nH .......................................................35
$1D $2A x y d1...d (x x y x 8)..................................35
$1D $2F m ..............................................................36
$1D $3A..................................................................37
$1D $42 n ...............................................................37
Command Reference
59
World Headquarters
Via Berettine, 2 - 43100 Fontevivo
Tel. +39 0521 680111 - Fax +39 0521 610701
info@custom.biz - www.custom.biz
All rigths reserved
www.custom.biz