Bematech MP-4000 TH Programmer's Manual

0 (0)
MP-4000 TH Programmer's Manual Rev.1.4
August 2007 (First edition: November 2006)
Copyright© by Bematech S.A, Curitiba-PR, Brazil. All rights reserved.
No part of this publication may be copied, reproduced, adapted or translated without the prior written permission of Bematech S.A., except when allowed by patent rights.
Information in this publication is purely informative, subjected to change without notice and no liability is assumed with respect to its use. However, as product improvements become available, Bematech S.A. will make every effort to provide updated information for the products described in this publication. The latest version of this manual can be obtained through Bematech website:
www.bematech.com
Notwithstanding the other exceptions contained in this Manual, the consequences and responsibility are assumed by the Purchaser of this product or third parties as a result of: (a) intentional use for any improper, unintended or unauthorized applications of this product, including any particular purpose; (b) unauthorized modifications, repairs, or alterations to this product; (c) use of the product without complying with Bematech S.A. operating and maintenance instructions; (d) use of the product as component in systems or other applications in which the failure of this could create a situation where personal injury or material damages may occur. In the events described above, Bematech S.A. and its officers, administrators, employees, subsidiaries, affiliates and dealers shall not be held responsible or respond by any claim, costs, damages, losses, expenses and any other direct or indirect injury, as well as claims which alleges that Bematech S.A. was negligent regarding the design or manufacture of the product.
Bematech S.A. shall not be liable against any damages or problems arising from the use of any options or any consumable products other than those designated as original Bematech products or approved products by Bematech S.A.
Any product names or its logotypes mentioned in this publication may be trademarks of its respective owners and shall be here recognized.
Product warranties are only the ones expressly mentioned in the Quick Start. Bematech S.A. disclaims any and all implied warranties for the product, including but not limited to implied warranties of merchantability or fitness for a particular purpose. In addition, Bematech S.A. shall not be responsible or liable for any special, incidental or consequential damages or lost profits or savings arising from the use of the product by the Purchaser, the User or third parties.
Summary
INTRODUCTION .................................................................................................................5
DEVELOPERS ADVICE......................................................................................................5
1 COMMANDS ....................................................................................................................6
1.1 Direct command.........................................................................................................................6
1.2 Control sequence........................................................................................................................6
2 USING THE COMMAND SUMMARY............................................................................... 7
2.1 ESC/Bema Command Table......................................................................................................7
2.2 ESC/POS Command Table......................................................................................................11
3. ESC/BEMA COMMANDS .............................................................................................14
3.1 Operation Commands ..............................................................................................................14
3.2 Vertical positioning..................................................................................................................22
3.3 Horizontal positioning..............................................................................................................25
3.4 Character Types .......................................................................................................................27
3.5 Print width, character width and height...................................................................................31
3.6 Bit images and graphics...........................................................................................................35
3.6.1 24-bit graphics .............................................................................................................35
3.6.2 8-bit graphics ...............................................................................................................35
3.7 Communication........................................................................................................................42
3.7.1 Serial interface status byte ............................................................................................42
3.7.2 Serial / USB / EPP interface advanced status bytes......................................................43
3.7.3 Standard parallel interface status byte ..........................................................................44
3.8 Data Control.............................................................................................................................46
3.9 Barcodes...................................................................................................................................47
4. ESC/POS COMMANDS ................................................................................................57
4.1 Operation Commands ..............................................................................................................57
4.2 Vertical positioning..................................................................................................................63
4.3 Horizontal positioning..............................................................................................................66
4.4 Character types.........................................................................................................................68
4.5. Communication.......................................................................................................................70
4.6. Data Control............................................................................................................................76
4.7. Barcodes..................................................................................................................................76
4.8. Bit images and graphics..........................................................................................................76
APPENDIX I – TABLES....................................................................................................77
Table 1 - Characters Per Line ........................................................................................................77
Table 2 - Paper Width....................................................................................................................77
APPENDIX II – CHARACTER TABLES............................................................................78
ASCII.............................................................................................................................................78
Code Page 437 ...............................................................................................................................78
Code Page 850 ...............................................................................................................................79
Code Page 858 ...............................................................................................................................80
Code Page 860 ...............................................................................................................................81
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Code Page 866 ...............................................................................................................................82
APPENDIX III - TRANSMISSION STATUS IDENTIFICATION.........................................83
22-aug-2007 Firmware Release: 1.5
4
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Introduction
The objective of this manual is to give to programmers all necessary information to properly program and integrate the MP-4000 TH printer into a system. The MP-4000 TH printer is able to interpret ESC/Bema commands and ESC/POS
For further information refer to the documentation below available in our website:
® 1
commands.
www.bematech.com
User’s Manual – Contains information referring to operation, features and specifications of
the MP-4000 TH printer.
Service Manual – Contains information necessary to identify and resolve MP-4000 TH printer
problems.
Developers advice
Beside this manual, the drivers and API (and all their documentation) listed below are available from our website (http://www.bematech.com
Windows 2000/XP/Vista-32 – API dynamic-link library driver (mp2032.dll); recent
spooler drivers (BemaSetupXXxX.exe); parallel port driver and USB port driver; software for testing purposes.
Windows 9x/ME/NT4 - API dynamic-link library driver (mp2032.dll); old and
unsupported spooler drivers (BemaSetupXXxX.exe);
Linux (x86) - CUPS
implementantion of mp2320 library as a shared object (mp2032.so);
1 ESC/POS® is registered trademark of Seiko Epson Corporation.
TM
spooler drivers compatible with Redhat 8.0; partial
22-aug-2007 Firmware Release: 1.5
):
5
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
1 Commands
The MP-4000 TH printer has a series of programming commands that may be used in the remote mode. Two types of commands can be sent:
1.1 Direct command
In this mode, a simple ASCII code is enough to command the printer. For example:
ASCII CODE : LF DECIMAL : 10 HEXADECIMAL : 0A
This command causes the printer to perform a line feed.
1.2 Control sequence
In this mode, more than one code may be sent to command or program the printer. This “control sequence” always starts with the ASCII code “ESC”, “FS” or “GS”. For example:
ASCII CODE : ESC W 1 DECIMAL : 27 87 01 HEXADECIMAL : 1B 57 01
This command switches the printing mode to “expanded”. Following is a summary of all commands accepted by the MP-4000 TH printer.
22-aug-2007 Firmware Release: 1.5
6
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
2 Using the command summary
The following section lists and describes all resident commands including command parameters. The command syntax is as follows:
•ESC P is a command without parameters;
•ESC Q n is a command with one parameter only;
•ESC K n1 n2 is a command with two parameters;
•ESC D n1...nk is a command with a variable number of parameters.
A character ‘h’ following an alphanumeric string represents an hexadecimal number. A number with no ‘h’ following it is in decimal mode. An italic item is a parameter to the escape function.
Note: MP-4000 TH printer is capable of interpreting ESC/Bema commands and
ESC/POS commands.
2.1 ESC/Bema Command Table
Operation
Code Function Format hexadecimal Page
GS F9h 5 00h Select ESC/Bema operation mode. Writes on flash.
Use with caution.
GS F9h 20h 30h Select ESC/Bema temporary operation mode.
Doesn’t alters flash.
GS F9h 1Fh 31h Return to previous set of commands configured
before temporary setting.
ESC @ Initializes the MP-4000 TH printer 1B 40 14
ESC b n n = 1 => PE signal reflects drawer sensor
n = 0 => PE signal reflects paper sensor
ESC v n Activate drawer for n milliseconds (-50ms < n <
200ms) ESC w Performs a full paper cut 1B 77 15 ESC m Performs a partial paper cut 1B 6D 15
ESC y n Enable / disable panel keys 1B 79 n 15
ESC x Enable Dump Mode 1B 78 16
ESC z n Enable (n = 1) / disable (n = 0) automatic line feed 1B 7A n 16 ESC ( A pL pH fn n1 n2 vol GS F9h – n Set printer priority (high quality or high speed) 1D F9 2D n 17 GS F9h ! n Set paper width 1D F9 21 n 17 GS F9h , n Enable/Disable paper near end sensor 1D F9 2C n 18 GS F9h + n Set and save printing intensity 1D F9 2B n 18 GS FAh n Set printer language 1D FA n 18
GS F9h “ 0 Get printer log 1D F9 22 30 19
GS F9h ‘ n Get printer information 1D F9 27 n 19
GS F9h ( 0 Load default user configuration 1D F9 28 30 20 GS F9h ) 0 Print user configuration 1D F9 29 30 20 GS F7h BS NUL !
i
...i4 s1..s
1
GS F9h * n Set USB address 1D F9 2A n 20
4
Activate/deactivate buzzer 1B 28 41 pL pH fn n1
Set IP address and subnet mask 1D F7 08 00 21 i
1D F9 35 00 13
1D F9 20 30 13
1D F9 1F 31 14
1B 62 n 14 1B 76 n 14
16
n2 vol
...i4
1
s
..s
1
4
20
22-aug-2007 Firmware Release: 1.5
7
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Vertical positioning
Code Function Format hexadecimal Page
ESC C n Set page size in lines 1B 43 n 21 ESC c n1 n2 Set page size in millimeters 1B 63 n1 n2 21 ESC J n Performs a fine line feed 1B 4A n 21
FF Feeds one page 0C 21 LF Feeds one line 0A 22 ESC 2 Line feed of 1/6 inch 1B 32 22
ESC 3 n Line feed of n/144 inch 1B 33 n 23 ESC f 1 n Vertical skipping 1B 66 31 n 23 ESC A n Feeding paper (n * 0,375mm) 1B 41 n 23
Horizontal positioning
Code Function Format hexadecimal Page
ESC f 0 n Horizontal skipping 1B 66 30 n 24 ESC Q n Set right margin 1B 51 n 24 ESC l n Set left margin 1B 6C n 24 ESC a n Centralize (n = 1) or left align (n = 0) characters 1B 61 n 25
Character types
Code Function Format hexadecimal Page
ESC - n Enable / disable underlined print mode 1B 2D n 26
ESC 4 Enable italic print mode 1B 34 26 ESC 5 Disable italic print mode 1B 35 26 ESC E Enable emphasized print mode 1B 45 27 ESC F Disable emphasized print mode 1B 46 27
ESC t n Select code page 1B 74 n 27 ESC S n Enable superscript and / or subscript 1B 53 n 28
ESC T Disable superscript and subscript modes 1B 54 28
ESC N n Select Intensity Mode 1B 4E n 28 ESC ! n Select print mode 1B 21 n 29 ESC } n Enable / Disable inverted mode 1B 7D n 29
Print width, character width and height
Code Function Format hexadecimal Page
DC2 Disable condensed mode 12 30 DC4 Disable on-line expanded print 14 30
ESC d n Enable / Disable double height print mode 1B 64 n 30
ESC H Set default column per line 1B 48 31 ESC P Set default column per line 1B 50 31 ESC SI Set condensed mode 1B 0F 31 ESC SO Set on-line expanded mode 1B 0E 32 ESC V Set on-line double height mode 1B 56 32
ESC W n Enable / Disable expanded mode 1B 57 n 32
SI Enable condensed mode 0F 33 SO Enable on-line expanded mode 0E 33
22-aug-2007 Firmware Release: 1.5
8
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Bit images and graphics
Code Function Format hexadecimal Page
ESC $ n1 n2 Fill in blank bit columns 1B 24 n1 n2 35 ESC * ! n1 n2 b1...bn 24-bit graphics 1B 2A 21 n1 n2 b1 ...
35
bn ESC K n1 n2 b1...bn 8-bit graphics 1B 4B n1 n2 b1 ... bn 36 FS p n m Print NV bit image 1C 70 n m 36 FS q n [xL xH yL yH
d
...dk]1...[xL xH yL yH
1
d
...dk]
1
n
Define NV bit image 1C 71 n [x
d
...dk]1...[xL xH yL yH
1
d
...dk]
1
n
L xH yL yH
37
GS / m Print downloaded bit image 1D 2F m 38 GS * x y d1...d GS v 0 m xL xH yL yH
...dk
d
1
Define downloaded bit image 1D 2A x y d1...d
(x × y × 8)
Print Raster Bitmap 1D 76 30 m x
d
1
...d
38
(x × y × 8)
39
L xH yL yH
k
Communication
Code Function Format hexadecimal Page
ENQ Serial communication status enquiry 05 41 GS ° 1
Serial / USB communication advanced status 1D F8 31 41 ETX End buffer 03 44 STX Clear buffer 02 44
Data Control
Code Function Format hexadecimal Page
CAN Cancel last line 18 45 DEL Cancel last character 7F 45
22-aug-2007 Firmware Release: 1.5
9
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Barcodes
Code Function Format hexadecimal Page
GS h n Sets the height n of the barcode generated 1D 68 n 46 GS w n Determines the width of the barcode 1D 77 n 46 GS H n Choose the position of the human readable
1D 48 n 46
information (HRI) of the barcode
GS f n Sets the font used to print the human readable
1D 66 n 47
information (HRI)
GS k 0 d1…d11 NUL Prints an UPC-A barcode 1D 6B 00 d1…d GS k 65 11 d1...d11 Prints an UPC-A barcode 1D 6B 41 0B d1…d GS k 1 d1…d6 NUL Prints an UPC-E barcode 1D 6B 01 d1…d GS k 66 6 d1…d6 Prints an UPC-E barcode 1D 6B 42 06 d1…d GS k 2 d1…d12 NUL Prints an EAN-13 barcode 1D 6B 02 d1…d GS k 67 12 d1…d12 Prints an EAN-13 barcode 1D 6B 43 0C d1…d GS k 3 d1…d7 NUL Prints an EAN-8 barcode 1D 6B 03 d1…d GS k 68 7 d1…d7 Prints an EAN-8 barcode 1D 6B 44 07 d1…d GS k 4 d1…dn NUL Prints a CODE 39 barcode 1D 6B 04 d1…d GS k 69 n d1…dn Prints a CODE 39 barcode 1D 6B 45 n d1…d GS k 5 d1…dn NUL Prints an ITF barcode 1D 6B 05 d1…d GS k 70 n d1...dn Prints an ITF barcode 1D 6B 46 n d1…d GS k 6 d1…dn NUL Prints a CODABAR barcode 1D 6B 06 d1…d GS k 71 n d1…dn Prints a CODABAR barcode 1D 6B 47 n d1…d GS k 72 d1…dn Prints a CODE 93 barcode 1D 6B 48 n d1…d GS k 73 n d1…dn Prints a CODE 128 barcode 1D 6B 49 n d1…d GS k 128 n1 n2 n3 n4
n
5 n6
d1…d
n
Prints a PDF-417 barcode 1D 6B 80 n
n
d1…d
6
n
GS k 21 d1…d9 NUL Prints an ISBN barcode 1D 6B 15 d1…d GS k 22 d1…dn NUL Prints a MSI barcode 1D 6B 16 d1…d GS k 130 n d1…dn Prints a MSI barcode 1D 6B 82 n d1…d GS k 23 d1…dn NUL Prints a PLESSEY barcode 1D 6B 17 d1…d GS k 131 n d1…dn Prints a PLESSEY barcode 1D 6B 83 n d1…d GS k 132 n1 n2 Programs barcode’s left margin 1D 6B 84 n1 n
00 47
11
47
11
00 48
6
48
6
00 48
12
49
12
00 49
7
49
7
00 50
n
50
n
00 50
n
51
n
00 51
n
51
n
52
n
52
n
1 n2 n3 n4 n5
00 53
9
00 54
n
54
n
00 54
n
55
n
55
2
53
22-aug-2007 Firmware Release: 1.5
10
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
2.2 ESC/POS Command Table
Operation
Code Function Format hexadecimal Page
GS F9h 5 01h Select ESC/POS operation mode. Writes on flash.
Use with caution. GS F9h 20h 31h Select ESC/POS temporary operation mode.
Doesn’t alters flash. GS F9h 1Fh 31h Return to previous set of commands configured
before temporary setting.
ESC = n Select peripheral device 1B 3D n 57
ESC @ Initialize printer 1B 40 57
ESC c 3 n Select paper sensor(s) to output paper-end signals 1B 63 33 n 58 ESC c 4 n Select paper sensor(s) to stop printing 1B 63 34 n 58 ESC c 5 n Enable/disable panel buttons 1B 63 35 n 59 ESC p m t1 t2 General pulse 1B 70 m t1 t2 59 GS ( A pL pH n m Execute test print 1D 28 41 pL pH n m 60 DLE DC4 n m t Generate pulse at real-time 10 14 n m t 60 GS V m (n) Select cut mode and cut paper 1D 56 m (n) 61 ESC ( A pL pH fn n c t1 t2
Activate buzzer 1B 28 41 pL pH fn n c
Vertical positioning
Code Function Format hexadecimal Page
LF Print and line feed 0A 62 FF Print and return to standard mode 0C 62 CR Print and carriage return 0D 62
ESC $ nL nH Set absolute print position 1B 24 nL n
ESC 2 Select default line spacing 1B 32 63
ESC 3 n Set line spacing 1B 33 n 63 ESC \ nL nH Set relative print position 1B 5C nL n ESC d n Print and feed n lines 1B 64 n 64
Horizontal positioning
Code Function Format hexadecimal Page
HT Horizontal tab 09 65
ESC SP n Set right-side character spacing 1B 20 n 65 ESC D n1…nK NUL Set horizontal tab positions 1B 44 n1…nk 00 65 ESC a n Select justification 1B 61 n 66 GS L nL nH Set left margin 1D 4C nL nH 66
Character types
Code Function Format hexadecimal Page
ESC – n Turn underline mode on/off 1B 2D n 67 ESC E n Turn emphasized mode on/off 1B 45 n 67 ESC M n Select character font 1B 4D n 67 GS B Activate/deactivate black/white reverse printing 1D 42 n 68 ESC R n Select an international character set 1B 52 n 68 ESC t n Select character code table 1B 74 n 68
1D F9 35 01 56
1D F9 20 31 56
1D F9 1F 31 57
61
t1 t2
63
H
63
H
22-aug-2007 Firmware Release: 1.5
11
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Communication
Code Function Format hexadecimal Page
DLE EOT n Real-time status transmission 10 04 n 69 DLE ENQ n Real-time request to printer 10 05 n 70 GS I n Transmit printer ID 1D 49 n 71 GS a n Enable/disable Automatic Status Back (ASB) 1D 61 n 72 GS r n Transmit status 1D 72 n 73
Data Control
Code Function Format hexadecimal Page
CAN Cancel print data 18 75
Barcodes
Code Function Format hexadecimal Page
GS h n Set bar code height 1D 68 n 46 GS w n Set bar code width 1D 77 n 46 GS H n Select printing position of HRI characters 1D 48 n 46 GS f n Select font for HRI characters 1D 66 n 47 GS k 0 d1…d11 NUL Prints an UPC-A barcode 1D 6B 00 d1…d1 GS k 65 11 d1...d11 Prints an UPC-A barcode 1D 6B 41 0B d1…d1 GS k 1 d1…d6 NUL Prints an UPC-E barcode 1D 6B 01 d1…d GS k 66 6 d1…d6 Prints an UPC-E barcode 1D 6B 42 06 d1…d GS k 2 d1…d12 NUL Prints an EAN-13 barcode 1D 6B 02 d1…d1 GS k 67 12 d1…d12 Prints an EAN-13 barcode 1D 6B 43 0C d1…d1 GS k 3 d1…d7 NUL Prints an EAN-8 barcode 1D 6B 03 d1…d GS k 68 7 d1…d7 Prints an EAN-8 barcode 1D 6B 44 07 d1…d GS k 4 d1…dn NUL Prints a CODE 39 barcode 1D 6B 04 d1…d GS k 69 n d1…dn Prints a CODE 39 barcode 1D 6B 45 n d1…d GS k 5 d1…dn NUL Prints an ITF barcode 1D 6B 05 d1…d GS k 70 n d1...dn Prints an ITF barcode 1D 6B 46 n d1…d GS k 6 d1…dn NUL Prints a CODABAR barcode 1D 6B 06 d1…dn 00 51 GS k 71 n d1…dn Prints a CODABAR barcode 1D 6B 47 n d1…d GS k 72 d1…dn Prints a CODE 93 barcode 1D 6B 48 n d1…d GS k 73 n d1…dn Prints a CODE 128 barcode 1D 6B 49 n d1…d GS k 128 n1 n2 n3 n4
n
5 n6
d1…d
n
Prints a PDF-417 barcode 1D 6B 80 n1 n2 n
d1…d
n
6
n
GS k 21 d1…d9 NUL Prints an ISBN barcode 1D 6B 15 d1…d9 00 53 GS k 22 d1…dn NUL Prints a MSI barcode 1D 6B 16 d1…d GS k 130 n d1…dn Prints a MSI barcode 1D 6B 82 n d1…d GS k 23 d1…dn NUL Prints a PLESSEY barcode 1D 6B 17 d1…dn 00 54 GS k 131 n d1…dn Prints a PLESSEY barcode 1D 6B 83 n d1…d GS k 132 n1 n2 Programs barcode’s left margin 1D 6B 84 n1 n2 55
00 47
1
47
1
00 48
6
48
6
00 48
2
49
2
00 49
7
49
7
00 50
n
50
n
00 50
n
51
n
51
n
52
n
52
n
53
3 n4 n5
00 54
n
54
n
55
n
22-aug-2007 Firmware Release: 1.5
12
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
Bit images and graphics
Code Function Format hexadecimal Page
ESC * ! n1 n2 b1...bn 24-bit graphics 1B 2A 21 n1 n2 b1 ...
35
bn FS p n m Print NV bit image 1C 70 n m 36 FS q n [xL xH yL yH
...dk]1...[xL xH yL yH
d
1
d
...dk]
1
n
Define NV bit image 1C 71 n [x
...dk]1...[xL xH yL yH
d
1
d
...dk]
1
n
L xH yL yH
37
GS / m Print downloaded bit image 1D 2F m 38 GS * x y d1...d GS v 0 m xL xH yL yH
d
...dk
1
Define downloaded bit image 1D 2A x y d1...d
(x × y × 8)
Print Raster Bitmap 1D 76 30 m x
d
1
...d
38
(x × y × 8)
L xH yL yH
k
39
22-aug-2007 Firmware Release: 1.5
13
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
3. ESC/Bema Commands
3.1 Operation Commands
The following section details each of the commands presented in the Command Table, ESC/Bema section.
GS F9h 5 00h
[Function] Select ESC/Bema operation mode.
[Format] ASCII GS F9h 5 00h Hexadecimal 1D F9 35 00 Decimal 29 249 53 0
[Description] Tells printer to interpret ESC/Bema commands from now.
[Notes] This command saves data on printer flash memory and therefore is
slow, which may affect printer performance and funcionality if mixed with
other faster commands. Please, use with caution.
When ESC/Bema mode is enabled and a DB25 serial interface is connected, the printer will automatically change its flow control to RTS/CTS.
GS F9h 20h 30h
[Function] Select ESC/Bema temporary operation mode.
[Format] ASCII GS F9h 20h 30h Hexadecimal 1D F9 20 30 Decimal 29 249 32 48
[Description] Tells printer to interpret ESC/Bema commands from now.
[Notes] This command doesn’t writes anything on flash memory, so it can be
used anyway.
When ESC/Bema mode is enabled and a DB25 serial interface is connected, the printer will automatically change its flow control to RTS/CTS.
22-aug-2007 Firmware Release: 1.5
14
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
GS F9h 1Fh 31h
[Function] Return to previous set of commands configured before temporary setting.
[Format] ASCII GS F9h 1Fh 31h Hexadecimal 1D F9 1F 31 Decimal 29 249 31 49
[Description] Tells printer to interpret the command set that was configured before an
temporary set has been done.
ESC @
[Function] Initializes the MP-4000 TH printer.
[Format] ASCII ESC @ Hexadecimal 1B 40 Decimal 27 64
[Description] All settings, including character font, line spacing, left margin, right
margin, intensity and inverted mode are canceled.
ESC b n
[Function] Select sensor to signalize.
[Format] ASCII ESC b n Hexadecimal 1B 62 n Decimal 27 98
[Range] n = 0, 1, 48, 49 [Default] n = 0
[Description] When n = 1 (or n = 49), PE signal reflects drawer sensor. When n = 0 (or
n = 48), PE signal reflects paper sensor.
[Notes] PE is a signal from the parallel interface.
ESC v n
[Function] Activate drawer.
[Format] ASCII ESC v n Hexadecimal 1B 76 n Decimal 27 118 n
[Description] Activate drawer pin for n milliseconds (-50ms < n < 200ms).
22-aug-2007 Firmware Release: 1.5
15
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
ESC w
[Function] Performs a full paper cut.
[Format] ASCII ESC w Hexadecimal 1B 77 Decimal 27 119
[Description] This command operates the auto cutter, performing a full cut in the
paper.
[Notes] When presenter is activated there is a minimum receipt size (roughly 3.3
inches) to avoid paper jam inside the presenter. If the receipt size is less than the minimum, the full cut command will automatically add line feeds to perform the cut.
ESC m
[Function] Performs a partial paper cut.
[Format] ASCII ESC m Hexadecimal 1B 6D Decimal 27 109
[Description] This command operates the auto cutter, performing a partial cut in the
paper.
[Notes] This command is available only if presenter is not activated.
ESC y n
[Function] Enable / disable panel keys.
[Format] ASCII ESC y n Hexadecimal 1B 79 n Decimal 27 121 n
[Range] n = 0,1 [Default] n = 1
[Description] Enables or disables the panel key.
9 When n is 0 (00h or 30h), the panel key is disabled. 9 When n is 1 (01h or 31h), the panel key is enabled. 9
[Notes] When the panel key is disabled, no button on the panel is usable.
22-aug-2007 Firmware Release: 1.5
16
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
ESC x
[Function] Enable Dump Mode.
[Format] ASCII ESC x
Hexadecimal 1B 78
Decimal 27 120
[Description] Enables dump mode. In this mode advanced users and programmers
can identify communication problems between the host and the printer
or check if a certain programmed data is correctly being sent to the
printer, thus being a debugging tool.
[Note] The dump mode is disabled just resetting the printer.
ESC z n
[Function] Enable / disable automatic line feed.
[Format] ASCII ESC z n
Hexadecimal 1B 7A n Decimal 27 122 n
[Description] Enables automatic line feed.
9 When n is 1 (01h or 31h), the automatic line feed is enabled. 9 When n is 0 (00h or 30h), the automatic line feed is disabled.
[Notes] If automatic line feed is enabled, the printer will perform a LF if a CR is
received.
ESC ( A pL pH fn n1 n2 vol
[Function] Activate/deactivate buzzer.
[Format] ASCII ESC ( A pL pH fn n1 n2 vol
Hexadecimal 1B 28 41 pL pH fn n1 n2 vol Decimal 27 40 65 p
[Description] Activate or deactivate printer buzzer.
(p fn = 1, 31h – activate buzzer
22-aug-2007 Firmware Release: 1.5
+ pH × 256) = 4, i.e., pL must be 4 and p
L
fn n1 n2 vol
L pH
must be 0.
H
17
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
fn = 0, 30h – deactivate buzzer n = (n1 + n vol = 0, 30h – low volume vol = 1, 31h – high volume
× 256) – time in milliseconds
2
GS F9h - n
[Function] Set printer priority.
[Format] ASCII GS F9h - n
Hexadecimal 1D F9 2D n Decimal 29 249 45 n
[Description] Set printer priority to high quality or high speed.
n = 1, 31h – high quality n = 0, 30h – high speed
GS F9h ! n
[Function] Set paper width.
[Format] ASCII GS F9h ! n
Hexadecimal 1D F9 21 n Decimal 29 249 33 n
[Description] Set printer paper width as shown on following table:
paper width (mm) printing width (mm)
n
00h 58 48 01h 76 72 02h 80 72 03h 80 76 04h 82.5 72 05h 82.5 76
22-aug-2007 Firmware Release: 1.5
06h 82.5 80 07h 76 64 08h 80 64 09h 82.5 64
18
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
[Description] This command has no effect when ESC/POS mode is enabled.
ESC/POS mode fixes paper/printing width to 80 mm / 76 mm.
GS F9h , n
[Function] Enable/disable paper near end sensor.
[Format] ASCII GS F9h , n
Hexadecimal 1D F9 2C n Decimal 29 249 44 n
[Description] Enable or disable paper near end sensor (PNES).
n = 1, 31h – enable PNES n = 0, 30h – disable PNES
GS F9h + n
[Function] Set and save printing intensity.
[Format] ASCII GS F9h + n
Hexadecimal 1D F9 2B n Decimal 29 249 43 n
[Description] Set and save printing intensity on flash memory.
n may vary from 0 (00h, 30h) to 4 (04h, 34h), meaning weakest to
strongest printing respectively.
GS FAh n
[Function] Set printer language.
[Format] ASCII GS FAh n
Hexadecimal 1D FA n Decimal 29 250 n
[Description] Set printer language.
n = 0, 30h – english
n = 1, 31h – portuguese n = 2, 32h - spanish
22-aug-2007 Firmware Release: 1.5
19
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
GS F9h “ 0
[Function] Get printer log.
[Format] ASCII GS F9h “ 0
Hexadecimal 1D F9 22 30
Decimal 29 249 34 48
[Description] Tells the printer to send its log.
[Note] This command doesn’t work with parallel port in SPP mode.
GS F9h ‘ n
[Function] Get printer information.
[Format] ASCII GS F9h n
Hexadecimal 1D F9 27 n Decimal 29 249 39 n
[Description] Get printer information as shown on following table:
n Information 0, 30h Product code 1, 31h Serial number 2, 32h Manufacturing date 3, 33h Firmware version 4, 34h Reserved 5, 35h Manufacturing timestamp (dd/mm/yyyy hh:mm:ss format)
22-aug-2007 Firmware Release: 1.5
20
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
GS F9h ( 0
[Function] Load default user configuration. [Format] ASCII GS F9h ( 0
Hexadecimal 1D F9 28 30
Decimal 29 249 40 48
[Description] Reload all configurations from flash memory.
GS F9h ) 0
[Function] Print user configuration. [Format] ASCII GS F9h ( 0
Hexadecimal 1D F9 29 30
Decimal 29 249 41 48
[Description] Print user configuration.
GS F7h BS NUL ! i1...i4 s1..s4
[Function] Set IP address and subnet mask.
[Format] ASCII GS F7h BS NUL ! i1...i4 s1..s4
Hexadecimal 1D F7 08 00 21 i1...i4 s1..s4 Decimal 29 247 08 00 33 i1...i4 s1..s4
[Description] Set IP address and subnet mask on hexadecimal format without
points.
[Example] IP 10.1.1.250 and SUBNET 255.0.0.0 must be sent as 0Ah 01h 01h
FAh FFh 00h 00h 00h
GS F9h * n
[Function] Set USB address. [Format] ASCII GS F9h * n Hexadecimal 1D F9 2A n Decimal 29 249 42 n [Description] Set USB address to allow the use of more than one printer on same
computer.
22-aug-2007 Firmware Release: 1.5
21
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
3.2 Vertical positioning
ESC C n
[Function] Set page size in lines.
[Format] ASCII ESC C n
Hexadecimal 1B 43 n
Decimal 27 67 n [Range] 0 < n < 256 [Default] n = 12 [Description] Sets the page size where n is the number of lines (single height).
ESC c n1 n2
[Function] Set page size in millimeters.
[Format] ASCII ESC c n1 n2
Hexadecimal 1B 63 n1 n2
Decimal 27 99 n1 n2 [Range] 0 < n1 < 256; 0 < n2 < 256 [Description] Sets the page size in millimeters where size is 0,125mm*n1 *n2.
ESC J n
[Function] Performs a fine line feed.
[Format] ASCII ESC J n
Hexadecimal 1B 4A n
Decimal 27 74 n [Range] 0 < n < 256 [Description] Performs the feeding of n*0,125mm of paper.
[Notes] This command is very useful in the graphic mode.
22-aug-2007 Firmware Release: 1.5
22
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
FF
[Function] Feeds one page.
[Format] ASCII FF
Hexadecimal 0C
Decimal 12
[Description] Performs a form feed to the top of the form.
[Notes] The form feed command can be disabled. Set the page size to zero.
LF
[Function] Feeds one line.
[Format] ASCII LF
Hexadecimal 0A
Decimal 10
[Description] Prints the contents of the buffer (if exists) and performs one line feed
using the default line spacing.
[Notes] The next character print position is on the left margin of the next line.
ESC 2
[Function] Line feed of 1/6”.
[Format] ASCII ESC 2
Hexadecimal 1B 32
Decimal 27 50
[Description] Sets the line feed of 1/6 inch. The line feed rate per line is specified by
1/6 inch.
[Notes] This is the default value when printer performed a reset or ESC @ was
received.
22-aug-2007 Firmware Release: 1.5
23
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
ESC 3 n
[Function] Line feed of n/144 inch. [Format] ASCII ESC 3 n
Hexadecimal 1B 33 n
Decimal 27 51 n [Range] 16 n 255 [Description] The line feed rate per line is specified by n/144 inch.
[Notes] This command takes effect immediately.
ESC f 1 n
[Function] Vertical skipping
[Format] ASCII ESC f 1 n
Hexadecimal 1B 66 31 n
Decimal 27 102 49 n [Range] 0 n 255 [Description] Performs a vertical skipping of n characters. [Notes] The command 1Bh 66h 01h n has the same effect.
ESC A n
[Function] Feeding paper n * 0,375mm. [Format] ASCII ESC A n
Hexadecimal 1B 41 n
Decimal 27 65 n [Range] 0 < n < 256 [Description] Performs the feeding of n * 0,375mm. [Notes] If n < 17, the line feed will be equal to zero. For n > 100, the line feed
will be equal to 32mm. For other values, the line feed is equal to
n*0,375mm.
22-aug-2007 Firmware Release: 1.5
24
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
3.3 Horizontal positioning
ESC f 0 n
[Function] Horizontal skipping
[Format] ASCII ESC f 0 n
Hexadecimal 1B 66 30 n
Decimal 27 102 48 n [Range] 0 n 255 [Description] Performs a horizontal skipping of n characters. [Notes] The command 1B 66 00 n has the same effect.
ESC Q n
[Function] Set right margin.
[Format] ASCII ESC Q n
Hexadecimal 1B 51 n
Decimal 27 81 n [Range] 0 < n < 256
[Description] Sets right margin in characters from the default left margin.
[Notes] If the right margin is set to the left of the current horizontal position, the
new margin becomes valid in the next line.
ESC I n
[Function] Set left margin.
[Format] ASCII ESC I n
Hexadecimal 1B 6C n
Decimal 27 108 n [Range] 0 < n < 256
[Description] Sets left margin in characters from the default left margin.
[Notes] If the left margin is set to the right of the current horizontal position, the
new margin becomes valid in the next line.
22-aug-2007 Firmware Release: 1.5
25
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual
ESC a n
[Function] Aligning the characters
[Format] ASCII ESC a n
Hexadecimal 1B 61 n
Decimal 27 97 n [Range] n = 0, 1 [Default] n = 0
[Description] This command sets the horizontal justification.
9 When n is 0 (00h or 30h), align is left justified. 9 When n is 1 (01h or 31h), align is center justified.
[Notes] The power on default is left justified.
22-aug-2007 Firmware Release: 1.5
26
Loading...
+ 58 hidden pages