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.
Summary INTRODUCTION .................................................................................................................5 DEVELOPERS ADVICE......................................................................................................5 1 COMMANDS ....................................................................................................................6 1.1 Direct command...........................................................................................................
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.
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® 1 commands. For further information refer to the documentation below available in our website: www.bematech.
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 DECIMAL HEXADECIMAL : : : LF 10 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.
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 •ESC •ESC •ESC P is a command without parameters; Q n is a command with one parameter only; K n1 n2 is a command with two parameters; D n1...nk is a command with a variable number of parameters. A character ‘h’ following an alphanumeric string represents an hexadecimal number.
MP-4000 TH POS Printer Rev.1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Bit images and graphics Code ESC $ n1 n2 ESC * ! n1 n2 b1...bn Function Fill in blank bit columns 24-bit graphics ESC K n1 n2 b1...bn FS p n m FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n GS / m GS * x y d1...d(x × y × 8) GS v 0 m xL xH yL yH d1...dk 8-bit graphics Print NV bit image Define NV bit image Print downloaded bit image Define downloaded bit image Print Raster Bitmap Format hexadecimal 1B 24 n1 n2 1B 2A 21 n1 n2 b1 ...
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Barcodes Code GS h n GS w n GS H n GS f n GS k 0 d1…d11 NUL GS k 65 11 d1...d11 GS k 1 d1…d6 NUL GS k 66 6 d1…d6 GS k 2 d1…d12 NUL GS k 67 12 d1…d12 GS k 3 d1…d7 NUL GS k 68 7 d1…d7 GS k 4 d1…dn NUL GS k 69 n d1…dn GS k 5 d1…dn NUL GS k 70 n d1...
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 2.2 ESC/POS Command Table Operation Code GS F9h 5 01h GS F9h 20h 31h GS F9h 1Fh 31h ESC = n ESC @ ESC c 3 n ESC c 4 n ESC c 5 n ESC p m t1 t2 GS ( A pL pH n m DLE DC4 n m t GS V m (n) ESC ( A pL pH fn n c t1 t2 Function Select ESC/POS operation mode. Writes on flash. Use with caution. Select ESC/POS temporary operation mode. Doesn’t alters flash. Return to previous set of commands configured before temporary setting.
MP-4000 TH POS Printer Rev.1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Bit images and graphics Code ESC * ! n1 n2 b1...bn Function 24-bit graphics FS p n m FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n GS / m GS * x y d1...d(x × y × 8) GS v 0 m xL xH yL yH d1...dk Print NV bit image Define NV bit image Print downloaded bit image Define downloaded bit image Print Raster Bitmap 22-aug-2007 Firmware Release: 1.5 Format hexadecimal 1B 2A 21 n1 n2 b1 ... bn 1C 70 n m 1C 71 n [xL xH yL yH d1...dk]1...[xL xH yL yH d1.
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] Hexadecimal Decimal ASCII 1D F9 35 00 29 249 53 0 GS F9h 5 00h [Description] Tells printer to interpret ESC/Bema commands from now.
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] Hexadecimal Decimal ASCII 1D F9 1F 31 29 249 31 49 [Description] Tells printer to interpret the command set that was configured before an temporary set has been done. GS F9h 1Fh 31h ESC @ [Function] Initializes the MP-4000 TH printer.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC w [Function] Performs a full paper cut. [Format] Hexadecimal Decimal ASCII 1B 77 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.
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.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual fn = 0, 30h – deactivate buzzer n = (n1 + n2 × 256) – time in milliseconds vol = 0, 30h – low volume vol = 1, 31h – high volume 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.
MP-4000 TH POS Printer Rev.1.4 [Description] Programmer’s Manual 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.
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] [Format] [Description] n 0, 30h 1, 31h 2, 32h 3, 33h 4, 34h 5, 35h Get printer information.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS F9h ( 0 [Function] [Format] [Description] Load default user configuration. ASCII GS F9h ( 0 Hexadecimal 1D F9 28 30 Decimal 29 249 40 48 Reload all configurations from flash memory. GS F9h ) 0 [Function] [Format] [Description] Print user configuration. ASCII GS F9h ( 0 Hexadecimal 1D F9 29 30 Decimal 29 249 41 48 Print user configuration. GS F7h BS NUL ! i1...i4 s1..s4 [Function] [Format] [Description] [Example] Set IP address and subnet mask.
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.
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.
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.
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.
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.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.4 Character Types ESC - n [Function] Enable / disable underlined print mode [Format] ASCII ESC - n Hexadecimal 1B 2D n Decimal 27 45 n [Range] n = 0,1 [Default] n=0 [Description] Enables or disables the underlined print mode. 9 When n is 1 (01h or 31h), underlined mode is enabled. 9 When n is 0 (00h or 30h), underlined mode is disabled. [Notes] All subsequent text and spaces are underlined.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC E [Function] Enable emphasized print mode [Format] ASCII ESC E Hexadecimal 1B 45 Decimal 27 69 [Description] Enables emphasized print mode. [Notes] Emphasized print is bolder than normal print. Emphasized print is available in all print modes. ESC F [Function] Disable emphasized print mode [Format] ASCII ESC F Hexadecimal 1B 46 Decimal 27 70 [Description] Disables emphasized print mode.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC S n [Function] Enable superscript and / or subscript [Format] ASCII ESC S n Hexadecimal 1B 53 n Decimal 27 83 n [Range] n = 0, 1 [Description] Enables superscript character and or subscript. 9 When n is 0 (00h or 30h), the superscript is enabled. The following characters are printed on the upper side of the print line. 9 When n is 1 (01h or 31h), the subscript is enabled.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 9 When n is 2 (32h), the intensity selected is NORMAL. 9 When n is 3 (33h), the intensity selected is STRONG. 9 When n is 4 (34h), the intensity selected is VERY STRONG.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.5 Print width, character width and height DC2 [Function] Disable condensed mode [Format] ASCII DC2 Hexadecimal 12 Decimal 18 [Description] Disables the condensed mod set by the ESC SI or SI command. DC4 [Function] Disable on-line expanded print [Format] ASCII DC4 Hexadecimal 14 Decimal 20 [Description] Disables the on-line expanded print set by ESC SO or SO command.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC H [Function] Set default column per line [Format] ASCII ESC H Hexadecimal 1B 48 Decimal 27 72 [Description] Set the default cpl. All characters type can be set in this mode. See table 1 to know the number of cpl, according to your printer model. ESC P [Function] Set default column per line [Format] ASCII ESC P Hexadecimal 1B 50 Decimal 27 80 [Description] This command set the default cpl.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC SO [Function] Set on-line expanded mode [Format] ASCII ESC SO Hexadecimal 1B 0E Decimal 27 14 [Description] If this command is received in the beginning of the line, expanded is valid for all line. If already exist some characters in the line, next characters in this line (if any) will be in expanded mode. Next lines will be in normal mode.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual SI [Function] Set condensed mode [Format] ASCII SI Hexadecimal 0F Decimal 15 [Description] This command set the ESC SI cpl. All characters type can be set in this mode. See table 1 to know the number of cpl, according to your printer model. It is a copy of ESC SI command.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.6 Bit images and graphics 3.6.1 24-bit graphics 1st bit-column { byte{ byte { 8th bit-column 1st byte 2nd 3rd MSB (bit 7) LSB (bit 0) For this 24-bit graphic pattern we have eight bit-columns, each with a height of 3 bytes (24 bits).
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC $ n1 n2 [Function] Fill in blank bit columns [Format] ASCII ESC $ n1 n2 Hexadecimal 1B 24 n1 n2 Decimal 27 36 n1 n2 [Description] This command fills in blank bit columns, from the actual column until column number (n1+n2*256), where n1+n2*256<= N. See ‘N’ value in the table 2. ESC * ! n1 n2 b1...bn [Function] 24-bit graphics [Format] ASCII ESC * ! n1 n2 b1...bn Hexadecimal 1B 2A 21 n1 n2 b1 ...
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC K n1 n2 b1...bn [Function] 8-bit graphics [Format] ASCII ESC K n1 n2 b1...bn Hexadecimal 1B 4B n1 n2 b1 ... bn Decimal 27 75 n1 n2 b1 … bn [Description] Selects the “8 pin” bit image (compatible with matrix printers) where you use n1+n2*256 columns, with 1 byte per column thus using a lower resolution and up to ‘N’ columns. If the image you want to print has less than ‘N’ graphic columns, a LF must be sent to complete line printing.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n [Function] Define NV bit image. [Format] ASCII FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n Hexadecimal 1C 70 n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n Decimal 28 112 n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS / m [Function] Print downloaded bit image. [Format] ASCII GS / m Hexadecimal 1D 2F m Decimal 29 47 m [Description] Prints a downloaded bit image using the mode specified by m. m 0, 48 1, 49 2, 50 3, 51 Mode Normal Double-width Double-height Quadruple Vertical Dot Density 180 dpi 180 dpi 90 dpi 90 dpi Horizontal Dot Density 180 dpi 90 dpi 180 dpi 90 dpi [dpi: dots per 25.4 mm {1"}] • m specifies the bit image mode.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual • The following figure shows the relationship between the downloaded bit image and the printed data: GS v 0 m xL xH yL yH d1...dk [Function] Print raster bitmap. [Format] ASCII GS v 0 m xL xH yL yH d1...dk Hexadecimal 1D 76 30 m xL xH yL yH d1...dk Decimal 29 118 48 m xL xH yL yH d1...
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual • xL, xH, select the number of data bytes (xL+xH×256) in the horizontal direction for the bit image. • yL, yH, select the number of data bytes (yL+yH×256) in the vertical direction for the bit image. • Data outside the printing area is read in and discarded on a dot-by-dot basis.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.7 Communication ENQ [Function] Serial communication status enquiry [Format] ASCII ENQ Hexadecimal 05 Decimal 05 [Description] After this command is issued, the printer returns a status by the serial RS-232 communication port, defined below. 3.7.1 Serial interface status byte The serial interface status byte is composed of 8 bits – 7 through 0 – the most significant bit is Bit 7 and the least significant bit is Bit 0.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.7.2 Serial / USB / EPP interface advanced status bytes The serial/USB/EPP interface status bytes is composed of 8 bits – 7 through 0 – the most significant bit is Bit 7 and the least significant bit is Bit 0. 1) Printer Status 7 1 6 5 4 3 2 1 Buffer Wait On / Off Overrun 0 status line Error Bit 2: Overrun Error – indicates when data sent to printer will be losted.
MP-4000 TH POS Printer Rev.1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ETX [Function] End buffer [Format] ASCII ETX Hexadecimal 03 Decimal 03 [Description] The printer will be BUSY while the printing is performed, changing status only when the buffer is empty. On serial interfaces DTR (RTS) will be low while the printing is performed.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.8 Data Control CAN [Function] Cancel last line [Format] ASCII CAN Hexadecimal 18 Decimal 24 [Description] This commands clears the last line sent to the printer. All other data is stored. DEL [Function] Cancel last character [Format] ASCII DEL Hexadecimal 7F Decimal 127 [Description] This commands clears the last character sent to the printer. All other data is stored. 22-aug-2007 Firmware Release: 1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 3.9 Barcodes GS h n [Function] Sets the height n of the barcode generated [Format] ASCII GS h n Hexadecimal 1D 68 n Decimal 29 104 n [Description] Each height unit corresponds to a dot of 0.125 mm, so the final height is n x 0.125 mm where 1 ≤ n ≤ 255. The default is n=162.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS f n [Function] Sets the font used to print the human readable information (HRI) [Format] ASCII GS f n Hexadecimal 1D 66 n Decimal 29 102 n [Description] For a normal font (‘N’ characters per line), n=0 or n=48. For a condensed font (‘N’ characters per line), n=1 or n=49. The default is normal font. See N value in the Table 2.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 1 d1…d6 NUL [Function] Prints an UPC-E barcode [Format] ASCII GS k 1 d1…d6 NUL Hexadecimal 1D 6B 01 d1…d6 00 Decimal 29 107 1 d1…d6 0 [Description] d1...d6 is a sequence of 6 bytes containing the barcode information with 48 ≤ d ≤ 57. A check sum digit will be added automatically.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 67 12 d1…d12 [Function] Prints an EAN-13 barcode [Format] ASCII GS k 67 12 d1…d12 Hexadecimal 1D 6B 43 0C d1…d12 Decimal 29 107 67 12 d1…d12 [Description] It is a cop of command GS k 2 d1…d12 NUL. GS k 3 d1…d7 NUL [Function] Prints an EAN-8 barcode [Format] ASCII GS k 3 d1…d7 NUL Hexadecimal 1D 6B 03 d1…d7 00 Decimal 29 107 3 d1…d7 0 [Description] d1…d7 is a sequence of 7 bytes containing the barcode information with 48 ≤ d ≤ 57.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 4 d1…dn NUL [Function] Prints a CODE 39 barcode [Format] ASCII GS k 4 d1…dn NUL Hexadecimal 1D 6B 04 d1…dn 00 Decimal 29 107 4 d1…dn 0 [Description] d1…dn is the sequence of n bytes containing the barcode information. The bytes that can be used in d are 32, 36, 37, 42, 43, 45 to 57 and 65 to 90 (upper case letters) or 97 to 122 (lower case letters). Lower case and upper case letters can’t be combined in the same barcode.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 70 n d1…dn [Function] Prints an ITF barcode [Format] ASCII GS k 70 n d1…dn Hexadecimal 1D 6B 46 n d1…dn Decimal 29 107 70 n d1…dn [Description] It is a copy of the command GS k 5 d1…dn NUL GS k 6 d1…dn NUL [Function] Prints a CODABAR barcode [Format] ASCII GS k 6 d1…dn NUL Hexadecimal 1D 6B 06 d1…dn 00 Decimal 29 107 6 d1…dn 0 [Description] d1…dn is the sequence of n bytes containing the barcode information.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 72 d1…dn [Function] Prints a CODE 93 barcode [Format] ASCII GS k 72 d1…dn Hexadecimal 1D 6B 48 n d1…dn Decimal 29 107 72 n d1…dn [Description] n indicates the number of bytes that will be sent and d1…dn is the sequence of n bytes containing the barcode information. This code can use all bytes from 0 to 127. A check sum digit will be added automatically.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 128 n1 n2 n3 n4 n5 n6 d1…dn [Function] Prints a PDF-417 barcode [Format] ASCII GS k 128 n1 n2 n3 n4 n5 n6 d1…dn Hexadecimal 1D 6B 80 n1 n2 n3 n4 n5 n6 d1…dn Decimal 29 107 128 n1 n2 n3 n4 n5 n6 d1…dn [Description] n1 is the ECC level (from 0 to 8) (Error correction level). n2 is the pitch height (from 1 to 8) where height=n2 x 0.125mm. n3 is the pitch width (from 1 to 4) where width=n3 x 0.125mm.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 22 d1…dn NUL [Function] Prints a MSI barcode [Format] ASCII GS k 22 d1…dn NUL Hexadecimal 1D 6B 16 d1…dn 00 Decimal 29 107 22 d1…dn 0 [Description] d1…dn is the sequence of n bytes containing the barcode information. The bytes that can be used in d are 48 to 57. The limitation of size for this barcode is given by the print field as well as the configured bar width. A check sum digit will be added automatically.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS k 131 n d1…dn [Function] Prints a PLESSEY barcode [Format] ASCII GS k 131 n d1…dn Hexadecimal 1D 6B 83 n d1…dn Decimal 29 107 131 n d1…dn [Description] It is a copy of the command GS k 23 d1…dn NUL GS k 132 n1 n2 [Function] Programs barcode’s left margin [Format] ASCII GS k 132 n1 n2 Hexadecimal 1D 6B 84 n1 n2 Decimal 29 107 132 n1 n2 [Description] Programs the position of the barcode’s left margin position given by n1 + n2 x 256.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 4. ESC/POS Commands 4.1 Operation Commands The following section details each of the commands presented in the Command Table, ESC/POS section. GS F9h 5 01h [Function] Select ESC/POS operation mode. [Format] ASCII GS F9h 5 01h Hexadecimal 1D F9 35 01 Decimal 29 249 53 1 [Description] Tells printer to interpret ESC/POS commands from now.
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] [Description] ASCII GS F9h 1Fh 31h Hexadecimal 1D F9 1F 31 Decimal 29 249 31 49 Tells printer to interpret the command set that was configured before an temporary set has been done. ESC = n [Function] Select peripheral device.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC c 3 n [Function] Select paper sensor(s) to output paper end signals. [Format] ASCII ESC c 3 n Hexadecimal 1B 63 33 n Decimal 27 99 51 n [Description] Selects the paper sensor(s) to output paper end (PE) signals.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC c 5 n [Function] Enable/disable panel buttons. [Format] ASCII ESC c 5 n Hexadecimal 1B 63 35 n Decimal 27 99 53 n [Description] [Default] Enables or disables the panel buttons: 9 When the LSB of n is 0, the panel buttons are enabled. 9 When the LSB of n is 1, the panel buttons are disabled. n=0 ESC p m t1 t2 [Function] Generate pulse.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS ( A pL pH n m [Function] Execute test print. [Format] ASCII GS ( A pL pH n m Hexadecimal 1D 28 41 pL pH n m Decimal 29 40 65 pL pH n m [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.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS V m (n) [Function] Select cut mode and cut paper. [Format] ASCII GS V m (n) Hexadecimal 1D 56 m (n) Decimal 29 86 m (n) [Description] Selects a mode for cutting paper and executes paper cutting.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 4.2 Vertical positioning LF [Function] Print and line feed. [Format] ASCII Hexadecimal Decimal [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. LF 0A 10 FF [Function] Print and return to standard mode.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC $ nL nH [Function] Set absolute print position. [Format] ASCII Hexadecimal Decimal [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)]. ESC $ nL nH 1B 24 nL nH 27 36 nL nH ESC 2 [Function] Select default line spacing.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC d n [Function] Print and feed n lines. [Format] ASCII Hexadecimal Decimal [Description] Prints the data in the print buffer and feeds n lines. 22-aug-2007 Firmware Release: 1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 4.3 Horizontal positioning HT [Function] Horizontal tab. [Format] ASCII Hexadecimal Decimal [Description] Moves the print position to the next horizontal tab position. [Details] • This command is ignored unless the next horizontal tab position has been set. • Horizontal tab positions are set with ESC D. HT 09 9 ESC SP n [Function] Set right-side character spacing.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual ESC a n [Function] Select justification. [Format] ASCII Hexadecimal Decimal [Description] Aligns all the data in one line to the specified position defined by n as follows: ESC a n 1B 61 n 27 97 n Justification Left justification Centering Right justification n 0, 48 1, 49 2, 50 GS L nL nH [Function] Set relative print position.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 4.4 Character types ESC - n [Function] Turn underline mode on/off. [Format] ASCII Hexadecimal Decimal [Description] Turns underline mode on or off, based on the following values of n: n 0, 48 1, 49 ESC - n 1B 2D n 27 45 n Function Turns off underline mode Turns on underline mode (1-dot thick) ESC E n [Function] Turn emphasized mode on/off. [Format] ASCII Hexadecimal Decimal [Description] Turns emphasized mode on or off.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS B n [Function] Activate/deactivate black/white reverse printing. [Format] ASCII GS B n Hexadecimal 1D 42 n Decimal 27 66 n Activate/deactivate black/white reverse printing mode. • When the LSB of n is 0, white/black reverse mode is turned off. • When the LSB of n is 1, white/black reverse mode is turned on. Only the lowest bit of n is valid. This command doesn’t affect graphic and bitimage commands.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 4.5. Communication DLE EOT n [Function] Real-time status transmission. [Format] ASCII Hexadecimal Decimal [Description] Transmits the selected printer status specified by n in real-time, according to the following table: n 1 2 3 4 [Details] DLE EOT n 10 04 n 16 4 n Action Transmit printer status Transmit offline status Transmit error status Transmit paper roll sensor status • The printer transmits the current status.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual n = 3: Error status Bit 0 1 2 3 Off/On Hex Decimal Function Off 00 0 Not used. Fixed to Off. On 02 2 Not used. Fixed to On. – – – Undefined Off 00 0 No autocutter error. On 08 8 Autocutter error occurs. 4 On 10 16 Not used. Fixed to On. 5 Off 00 0 No unrecoverable error. On 20 32 Unrecoverable error occurs. 6 Off 00 0 No auto-recoverable error. On 40 64 Auto recoverable error occurs. 7 Off 00 0 Not used. Fixed to Off.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual • This command is executed even when the printer is offline, the receive buffer is full, or there is an error status with a serial interface model. GS I n [Function] Transmit printer ID.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual GS a n [Function] Enable/Disable Automatic Status Back (ASB). [Format] ASCII Hexadecimal Decimal [Description] Enables or disables ASB and specifies the status items to include, using n as follows: Bit 0 1 2 3 4-7 [Details] Off/On Off On Off On Off On Off On - Hex 00 01 00 02 00 04 00 08 - GS a n 1D 61 n 29 97 n Decimal 0 1 0 2 0 4 0 8 - Status for ASB Drawer kick-out connector pin 3 status disabled.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Second byte - Printer Information Bit 0 1 2 3 Off/On Hex Decimal Status for ASB Undefined. Undefined. Undefined. Off 00 0 No autocutter error. On 08 8 Autocutter error occurred. 4 Off 00 0 Not used. Fixed to Off. 5 Off 00 0 No unrecoverable error. On 20 32 Unrecoverable error occurred. 6 Off 00 0 No automatically recoverable error. On 40 64 Automatically recoverable error occurred. 7 Off 00 0 Not used. Fixed to Off.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual this command and transmitting the status, depending on the receive buffer status. • When Auto Status Back (ASB) is enabled using GS a, the status transmitted by GS r and the ASB status must be differentiated using the table in Appendix III. • The status types to be transmitted are shown below: Paper sensor status (n = 1, 49): Bit Off/On Hex Decimal Status for ASB 0, 1 Off 00 0 Paper roll near-end sensor: paper adequate.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual 4.6. Data Control CAN [Function] Cancel print data [Format] ASCII CAN Hexadecimal 18 Decimal 24 [Description] Deletes all the print data in the current buffer. 4.7. Barcodes ESC/POS barcode functions are the same defined on ESC/Bema commands. Please, refer to ESC/Bema commands. 4.8. Bit images and graphics ESC/POS Bit images and graphics functions are the same defined on ESC/Bema commands. Please, refer to ESC/Bema commands.
MP-4000 TH POS Printer Rev.1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Appendix II – Character Tables ASCII The codes from 00h up to 7Fh are shown below: Code Page 437 22-aug-2007 Firmware Release: 1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Code Page 850 Code Page 850 character set is from 00h up to 7Fh and is the same characters as the ASCII table. Characters between 80h and FFh are available for use for international languages. 22-aug-2007 Firmware Release: 1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Code Page 858 22-aug-2007 Firmware Release: 1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Code Page 860 22-aug-2007 Firmware Release: 1.
MP-4000 TH POS Printer Rev.1.4 Programmer’s Manual Code Page 866 Code Page 866 character set is from 00h up to 7Fh and is the same characters as the ASCII table. Characters between 80h and FFh are available for use for cyrillic languages (Russian, Bulgarian, Serbian, etc.). 22-aug-2007 Firmware Release: 1.
Appendix III - Transmission Status Identification Because the specified status bits transmitted from the ESC/POS commands are fixed, the user can confirm the command to which the status belongs, as shown in the following table. When using Auto Status Back (ASB), however, process the consecutive three-byte code (except for XOFF) as ASB data after confirming the first byte of the ASB.