MP-4200 TH Programmer’s Manual - Revision 1.0 POS Printer MP-4200 TH Programmer’s Manual P/N: 501.4421.00 - Revision 1.0 April 2010 (First Edition: April 2010) 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.
MP-4200 TH Programmer’s Manual - Revision 1.0 Disposal and Recycling Information General Information This symbol indicates that your product must be disposed of properly according to local laws and regulations. When your product reaches its end of life, contact Bematech or your local authorities to learn about recycling options. Safety Information This section presents important information intended to ensure safe and effective use of this product.
MP-4200 TH Programmer’s Manual - Revision 1.0 Summary List of Tables iv Acronyms and Abbreviations v Revision History vi Chapter 1: Introduction 1 1.1 Objective 1.2 Structure Chapter 2: Quick Reference Guide 2.1 ESC/Bema Quick Reference Guide 2.
MP-4200 TH Programmer’s Manual - Revision 1.0 List of Tables Table 1: Arguments used to describe MP-4200 TH commands. ..................... 8 Table 2: Printer settings commands for ESC/Bema mode ............................ 9 Table 3: Vertical positioning commands for ESC/Bema mode ......................10 Table 4: Horizontal positioning commands for ESC/Bema mode....................10 Table 5: Character formatting commands for ESC/Bema mode.....................
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.0 Revision History vi Date Version Description April 2010 1.0 Initial release.
MP-4200 TH Programmer’s Manual - Revision 1.0 Chapter 1 Introduction MP-4200 TH is a Bematech thermal printer designed to speed up receipt printing operations with high performance in both text and graphic modes. Its main features include: • Printing speeds of up to 250mm/s in both text and graphic modes. • Four paper widths: 58mm, 76mm, 80mm or 82.5mm. • Two commands sets: ESC/Bematech or ESC/POS®. • One USB device interface always available to connect with host computers.
MP-4200 TH Programmer’s Manual - Revision 1.0 Chapter 2 Quick Reference Guide MP-4200 TH is a dual command set printer. A command set describes the behavior of the printer when sequences of bytes are received through the communication interface. The two command sets available at the MP-4200 TH are ESC/Bematech (or ESC/Bema for short) and ESC/POS®, but only one of them is active at a given time. There are commands specifically designed to switch from current command set to the other. 2.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.0 2.2 ESC/POS® Quick Reference Guide ESC/POS® is a standard defined by Seiko Epson Corporation. ESC/POS® commands can be classified as executing or setting. An executing command makes the printer to execute something and does not affect further incoming data. On the other hand, a setting command makes the printer to change its internal flags that may affect incoming data. ESC/POS® commands supported by MP-4200 TH are summarized in Table 11, Table 12 and Table 13.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.0 MP-4200 TH also supports ideograms for Traditional Chinese (Big-5E), Simplified Chinese (EUC-CN) and Japanese (JIS or Shift JIS). Table 12 shows MP-4200 TH ESC/POS commands dedicated to ideograms control. Ideograms control Table 12 Command Classification Command Name FS ! Set print mode(s) for ideograms x FS & Select ideogram mode x FS - Turn underline mode on/off for ideograms x FS .
MP-4200 TH Programmer’s Manual - Revision 1.0 Chapter 3 ESC/Bematech Command Set This chapter presents detailed information about each ESB/Bematech command implemented by the MP-4200 TH printer. GS F9h 5 n [Function] [Format] [Range] [Description] [Notes] Select printer operating mode. ASCII GS F9h 5 n Hexadecimal 1D F9 35 n Decimal 29 249 53 n n = 0; n = 1; n = 48; n = 49; If n is 0 (00h or 30h), ESC/Bema is selected. If n is 1 (01h or 31h), ESC/POS is selected.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F9h C 00h [Function] [Format] [Description] Get printer current command set. ASCII GS F9h C 00h Hexadecimal 1D F9 43 00 Decimal 29 249 67 0 Return one byte with current command set. If returned byte is 0 (00h), printer is operating in ESC/Bema mode. If returned byte is 1 (01h), printer is operating in ESC/POS mode. GS F9h SP n [Function] [Format] [Range] [Description] [Notes] Select printer operating mode of operation temporarily.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC v n [Function] [Format] [Range] [Description] Activate drawer #1 for n milliseconds. ASCII ESC v n Hexadecimal 1B 76 n Decimal 27 118 n 50 ≤ n ≤ 250 Activate drawer #1 pin for n milliseconds (50ms ≤ n ≤ 200ms). ESC 80h n [Function] [Format] [Range] [Description] Activate drawer #2 for n milliseconds. ASCII ESC 80h n Hexadecimal 1B 80 n Decimal 27 128 n 50 ≤ n ≤ 250 Activate drawer #2 pin for n milliseconds (50ms ≤ n ≤ 200ms).
MP-4200 TH Programmer’s Manual - Revision 1.0 [Note] sent to the printer. The only way to exit the dump mode is turning off the printer" ESC z n [Function] [Format] [Range] [Default] [Description] [Notes] Enable/disable automatic line feed. ASCII ESC z n Hexadecimal 1B 7A n Decimal 27 122 n n = 0, 1 n=0 Enable or disable line feeding. If n is 0 (00h or 30h), automatic line feed is disabled. If n is 1 (01h or 31h), automatic line feed is enabled.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Notes] n Paper width (mm) Printing width (mm) 00h 58 48 01h 76 72 02h 80 72 03h 80 76 04h 82.5 72 05h 82.5 76 06h 82.5 80 This command has effect only when printer is in ESC/Bema operating mode. For ESC/POS mode paper width is always set to 80mm/73.5mm. GS F9h , n [Function] [Format] [Default] [Description] Enable/disable paper near-end sensor.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F9h ‘ n [Function] [Format] Get printer information.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F7h BS NUL “ i1 ...i4 s1 ...s 4 [Function] [Format] [Description] [Example] [Notes] Set IP address and subnet mask. ASCII GS F7h BS NUL “ i1...i4 s1...s 4 Hexadecimal 1D F7 08 00 22 i1...i4 s 4...s 4 Decimal 29 247 8 0 34 i1...i4 s 4...s 4 Program a fixed IP address and subnet mask to the printer. To define an IP address of 10.10.1.2 and a subnet mask of 255.255.0.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F9h E n [Function] [Format] [Range] [Default] [Description] [Notes] Set DHCP usage ASCII GS F9h E n Hexadecimal 1D F9 45 n Decimal 29 249 69 n 0 ≤ n ≤ 255 n=0 This command enables or disables the DHCP client of the printer. • When the LSB of n is 0, the DHCP client is disabled. • When the LSB of n is 1, the DHCP client is enabled. Valid only when ethernet or wi-fi interface is being used. GS F9h S m ip1 ..ip 4 n c1 ..
MP-4200 TH Programmer’s Manual - Revision 1.0 • s defines the security mode as follow: [Notes] s Security mode 0 No security 1 WEP 64-bit 2 WEP 128-bit 3 WPA-TKIP personal 4 WPA2-AES personal • c defines the channel to use. Use c = 0 when a = 0. • m defines the size of the ESSID. • n defines the size of the passphrase. • e1..em define the ESSID. • p1..pn define the passphrase. Valid only when wi-fi interface is being used.
MP-4200 TH Programmer’s Manual - Revision 1.0 FF [Function] [Format] [Description] [Notes] Feed one page. ASCII FF Hexadecimal 0C Decimal 12 Performs a form feed, moving from current position to the top of next page. This command can be disabled by setting page size to zero. LF [Function] [Format] [Description] [Notes] Feed one line.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC A n [Function] [Format] [Range] [Description] [Notes] Feed paper by [n x 0,375]mm. ASCII ESC A n Hexadecimal 1B 41 n Decimal 27 65 n 0 ≤ n ≤ 255 Perform paper feed of n x 0,375mm. If n < 17, the line feed will be equal to zero. For n > 85, the line feed will be equal to 32mm. For other values, the line feed is equal to n x 0,375mm. ESC f 0 n [Function] [Format] Horizontal skipping.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC Q n [Function] [Format] [Range] [Description] [Notes] Set right margin. ASCII E SC Q n Hexadecimal 1B 51 n Decimal 27 81 n 0 ≤ n ≤ 255 Set right margin in number of characters, starting from default left margin. If requested right margin is on the left side of current horizontal position, the new margin will become valid only in the next line. ESC l n [Function] [Format] [Range] [Description] [Notes] Set left margin.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Format] [Description] ASCII ESC 4 Hexadecimal 1B 34 Decimal 27 52 Enable italic print mode. [Notes] Italic is available in all other print modes. ESC 5 [Function] [Format] Disable italic print mode. ASCII ESC 5 Hexadecimal 1B 35 Decimal 27 53 [Description] Disable italic print mode. ESC E [Function] [Format] Enable emphasized print mode. ASCII ESC E Hexadecimal 1B 45 Decimal 27 69 [Description] Enable emphasized print mode.
MP-4200 TH Programmer’s Manual - Revision 1.0 If n is 14 (0Eh or 3Eh), EUC-CN is selected. If n is 21 (15h or 45h), CODEPAGE 862 is selected. [Notes] CODEPAGE 850 is the default. ESC R n [Function] [Format] [Range] [Default] Select an international character set. ASCII ESC R n Hexadecimal 1B 52 n Decimal 27 82 n 0 ≤ n ≤ 12 n = 12 [Description] This command selects the code page to be used, according to the following options. If 1 ≤ n ≤ 11, CODEPAGE 858 is selected.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC ! n [Function] [Format] [Description] Select print mode.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC [ n [Function] [Format] [Range] [Description] Print a specific Unicode set. ASCII ESC [ n Hexadecimal 1B 5B n Decimal 27 91 n 0 ≤ n ≤ 255 Print selected Unicode character set. DC2 [Function] [Format] [Description] Disable condensed mode. ASCII DC2 Hexadecimal 12 Decimal 18 Disable condensed mode, if previously set by ESC SI or SI command. DC4 [Function] [Format] [Description] Disable on-line expanded print.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC SI [Function] [Format] [Description] Enable condensed mode. ASCII ESC SI Hexadecimal 1B 0F Decimal 27 15 Turn on condensed mode. ESC SO [Function] [Format] [Description] Enable on-line expanded mode. ASCII ESC SO Hexadecimal 1B 0E Decimal 27 14 If this command is received at the beginning of a line, expanded is valid for the whole line. Otherwise, condensed will be valid only for next incoming characters.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC $ n1 n2 [Function] [Format] [Description] Fill in blank bit columns. ASCII ESC $ n1 n2 Hexadecimal 1B 24 n1 n2 Decimal 27 36 n1 n2 This command fills in blank bit columns, from current column until column number (n1+n2*256), where n1+n2*256 should be less than or equal to N. ‘N’ is the printing width, depending on the print mode. ESC * ! n1 n2 b1 ... bn [Function] [Format] [Description] 24-bit graphics. ASCII ESC * ! n1 n2 b1 ..
MP-4200 TH Programmer’s Manual - Revision 1.0 1st bit-column 1 byte { 8th bit-column MSB (bit 7) LSB (bit 0) If the image to print has less than ‘N’ graphic columns, a LF must be sent to perform line printing. Text and graphic may be mixed in the same line. FS p n m [Function] [Format] [Description] Print non-volatile (NV) bit image. ASCII FS p n m Hexadecimal 1C 70 n m Decimal 28 112 n m Print the n-th NV bit image using m print mode.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS / m [Function] [Format] [Description] Print downloaded bit image. ASCII GS / m Hexadecimal 1D 2F m Decimal 29 47 m Print a downloaded bit image using the mode specified by m. m Mode Vertical Dot Density Horizontal Dot Density 0, 48 Normal 203 dpi 203 dpi 1, 49 Double-width 203 dpi 101 dpi 2, 50 Double-height 101 dpi 203 dpi 3, 51 Quadruple 101 dpi 101 dpi m is bit image print mode.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS v 0 m xL xH yL yH d1 ... dk [Function] [Format] [Range] [Description] Print raster bitmap. 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-4200 TH Programmer’s Manual - Revision 1.0 (XL+XHx256)x8 dots = 640 dots d1 d2 d3 ... d78 d79 d80 d81 d82 d83 ... d158 d159 d160 .. . .. . .. . ... .. . .. . .. . dK-79 dK-78 dK-77 ... dK-2 dK-1 dK 7 MSB 6 5 4 3 2 1 (YL+YHx256) dots 0 LSB ENQ [Function] [Format] [Description] Printer status enquiry.
MP-4200 TH Programmer’s Manual - Revision 1.0 1 – Printer is in overrun condition. If more data is received, it will be lost. Bit 3: Offline. 0 – Printer is on-line. 1 – Printer is off-line. Bit 4: Wait. 0 – Printer is printing (busy condition). 1 – Printer buffer is empty, waiting for more data or commands. Bit 6 & 5: BufStat - Buffer status. 00 – Printer buffer empty. 01 – Printer buffer is under 1/3 of its capacity. 10 – Printer buffer is above 1/3 of its capacity.
MP-4200 TH Programmer’s Manual - Revision 1.0 Bit 3: CE – Cutter Error 0 – No error condition detected in the cutter. 1 – Cutter error condition detected. Bit 5: NRE – Non-recoverable Error 0 – NRE condition not detected. 1 – NRE condition detected. Bit 6: RE – Recoverable Error 0 – RE condition not present. 1 – RE condition present.
MP-4200 TH Programmer’s Manual - Revision 1.0 DEL [Function] [Format] [Description] Cancel last character. ASCII DEL Hexadecimal 7F Decimal 127 This command clears the last character sent to the printer. If the last character has been already dispatched to print head, no action is taken. GS h n [Function] [Format] [Range] [Default] [Description] Set barcode height. ASCII GS h n Hexadecimal 1D 68 n Decimal 29 104 n 1 ≤ n ≤ 255 n = 162 Barcode height is set to n x 0.125 mm.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS k NUL d1 ... d11 NUL [Function] [Format] [Range] [Description] Print an UPC-A barcode. ASCII GS k NUL d1 ... d11 NUL Hexadecimal 1D 6B 00 d1 ... d11 00 Decimal 29 107 0 d1 ... d11 0 48 ≤ dn ≤ 57 d1…d11 is a sequence of 11 bytes containing barcode information. The checksum digit is added automatically by the printer. GS k A VT d1 ... d11 [Function] [Format] [Range] [Description] Print an UPC-A barcode. ASCII GS k A VT d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 [Range] [Description] 48 ≤ dn ≤ 57 This command is a copy of GS k STX d1…d12 NUL. GS k ETX d1 ... d7 NUL [Function] [Format] [Range] [Description] Print an EAN-8 barcode. ASCII GS k ETX d1 ... d7 NUL Hexadecimal 1D 6B 03 d1 ... d7 00 Decimal 29 107 3 d1 ... d7 0 48 ≤ dn ≤ 57 d1…d7 is a sequence of 7 bytes containing barcode information. Printer generates the 8 th digit automatically. GS k D BEL d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 GS k F n d1 ... dn [Function] [Format] [Range] [Description] Print an ITF barcode. ASCII GS k F n d1 ... dn Hexadecimal 1D 6B 46 n d1 ... dn Decimal 29 107 70 n d1 ... dn 48 ≤ dn ≤ 57 This command is a copy of GS k ENQ d1…dn NUL. GS k ACK d1 ... dn NUL [Function] [Format] [Range] [Description] Print a CODABAR barcode. ASCII GS k ACK d1 ... dn NUL Hexadecimal 1D 6B 06 d1 ... dn 00 Decimal 29 107 6 d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 GS k 80h n1 n2 n 3 n4 n5 n6 d1 ... dn [Function] [Format] [Range] [Description] Print a PDF-417 barcode. ASCII GS k 80h 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 0 ≤ n1 ≤ 8 1 ≤ n2 ≤ 8 1 ≤ n3 ≤ 4 0 ≤ n4 ≤ 255 n1 is the ECC level. n2 is the pitch height, with height = n2 x 0.125mm. n3 is the pitch width, with width = n 3 x 0.125mm.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS k 82h n d1 ... dn [Function] [Format] [Description] Print a MSI barcode. ASCII GS k 82h n d1 ... dn Hexadecimal 1D 6B 82 n d1 ... dn Decimal 29 107 130 n d1 ... dn This command is a copy of GS k SYN d1…dn NUL. GS k ETB d1 ... dn NUL [Function] [Format] [Range] [Description] Print a PLESSEY barcode. ASCII GS k ETB d1 ... dn NUL Hexadecimal 1D 6B 17 d1 ... dn 00 Decimal 29 107 23 d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 Chapter 4 ESC/POS® Command Set This chapter presents detailed information about each ESC/POS® command implemented by the MP-4200 TH printer. Some terms used in the description of ESC/POS command set need further explanation, as described below. • Print buffer: a buffer that stores the image data to be printed. • Print buffer full: the state where the print buffer is full.
MP-4200 TH Programmer’s Manual - Revision 1.0 CR [Function] [Format] [Description] [Details] [Reference] Print and carriage return. ASCII CR Hexadecimal 0D Decimal 13 When automatic line feed is enabled, this command functions the same as LF; when automatic line feed is disabled this command is ignored. • Set print position to the beginning of the line. • Automatic line feed is ignored with a serial interface model.
MP-4200 TH Programmer’s Manual - Revision 1.0 n = 2: Offline status Bit Off/On Hex Decimal Function 0 Off 00 0 Not used. Fixed to Off. 1 On 02 2 Not used. Fixed to On. 2 Off 00 0 Cover is closed. On 04 4 Cover is open. Off 00 0 Paper is not being fed by using the FEED button. 3 On 08 8 Paper is being fed by the FEED button. 4 On 10 16 Not used. Fixed to On. 5 Off 00 0 No paper-end stop. On 20 32 Printing is being stopped. Off 00 0 No error.
MP-4200 TH Programmer’s Manual - Revision 1.0 n = 4: Continuous paper sensor status Continuous paper sensor status Bit 0 Hex Decimal Function Off 00 0 Not used. Fixed to Off. 1 On 02 2 Not used. Fixed to On. 2, 3 Off 00 0 Paper roll near-end sensor: paper adequate. On 0C 12 Paper near-end is detected by the paper roll near-end sensor. 4 On 10 16 Not used. Fixed to On. 5, 6 Off 00 0 Paper roll sensor: Paper present. On 60 96 Paper roll end detected by paper roll sensor.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Notes] [Reference] • The printer executes this command upon receiving it. • This command is executed even when the printer is offline. • This command is effective even when the printer is disabled with ESC = (Select peripheral device). • This can be enabled or disabled by GS ( D command. ESC p, GS ( D DLE DC4 fn a b (fn = 2) [Function] [Format] [Visibility] [Range] [Details] Execute power-off sequence.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC ! n [Function] [Format] [Range] [Default] [Description] Select print mode(s). ASCII ESC ! n Hexadecimal 1B 21 n Decimal 27 33 n 0 ≤ n ≤ 255 n=0 Select print mode(s) using n as follows: Bit 0 Decimal 00 0 Character font C (14 × 24). Function On 01 1 Character font D (10.5 × 24). - - - Undefined. 2 - - - Undefined. Off 00 0 Emphasized mode not selected.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] [References] • The distance from the beginning of the line to the print position is (nL + nH × 256). • Setting a value outside printable area is ignored. • The horizontal motion unit is specified by GS P. • The GS P command can change horizontal motion unit. However, the value cannot be less than minimum horizontal movement amount, and it must be in even units of minimum horizontal movement amount.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC - n [Function] [Format] [Range] [Default] [Description] [Details] [Reference] Turn underline mode on/off. ASCII ESC - n Hexadecimal 1B 2D n Decimal 27 45 n 0 ≤ n ≤2, 48 ≤ n ≤ 50 n=0 Turn underline mode on or off, based on the following values of n: n Function 0, 48 Turn off underline mode. 1, 49 Turn on underline mode (1-dot thick). 2, 50 Turn on underline mode (2-dot thick).
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] When printer is disabled, it ignores all data except those commands used for error-recovery commands (DLE EOT, DLE ENQ, DLE DC4). ESC @ [Function] [Format] [Description] [Details] Initialize printer. ASCII ESC @ Hexadecimal 1B 40 Decimal 27 64 Clear data in the print buffer and reset printer mode to that was in effect when power was turned on. • DIP switch settings are not checked again. • Data in the receive buffer is not cleared.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] [Reference] • When the LSB of n is 1, emphasized mode is turned on. • Only the least significant bit of n is used. • This command and ESC ! turn on and off emphasized mode in the same way. ESC ! ESC G n [Function] [Format] [Range] [Default] [Description] [Details] [Reference] Turn on/off double-strike mode. ASCII ESC G n Hexadecimal 1B 47 n Decimal 27 71 n 0 ≤ n ≤ 255 n=0 Turn double-strike mode on or off.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC R n [Function] [Format] [Range] [Default] [Description] Select an international character set. ASCII ESC R n Hexadecimal 1B 52 n Decimal 27 82 n 0 ≤ n ≤ 12 n≤0 Selects an international character set n from the following table. n Character Set 0 U.S.A.
MP-4200 TH Programmer’s Manual - Revision 1.0 [References] • The print starting position moves from current position to [N × horizontal motion unit]. • The horizontal motion unit can be specified by GS P. • The GS P command can change the horizontal motion unit. However, the value cannot be less than the minimum horizontal movement amount, and it must set be in even units of the minimum horizontal movement amount.
MP-4200 TH Programmer’s Manual - Revision 1.0 interfaces. • Sensor is switched during command execution. The paper end signal switching may be delayed depending on the receive buffer state. • If either bit 0 or bit 1 is on, the paper roll near-end sensor is selected as the paper sensor outputting paper-end signals. • If either bit 2 or bit 3 is on, the paper roll end sensor is selected as the paper sensor outputting paper-end signals.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC c 5 n [Function] [Format] [Range] [Default] [Description] [Details] Enable/disable panel buttons. ASCII ESC c 5 n Hexadecimal 1B 63 35 n Decimal 27 99 53 n 0 ≤ n ≤ 255 n=0 Enable or disable panel buttons. • When the LSB of n is 0, panel buttons are enabled. • When the LSB of n is 1, panel buttons are disabled. • Only the least significant bit of n is used. • When panel buttons are disabled, none of them are usable when the printer cover is closed.
MP-4200 TH Programmer’s Manual - Revision 1.0 ESC p m t1 t 2 [Function] [Format] [Range] [Description] [Details] [Reference] Generate pulse. ASCII ESC p m t1 t 2 Hexadecimal 1B 70 m t1 t 2 Decimal 27 112 m t1 t 2 m = 0, 1, 48, 49 0 ≤ t1 ≤ 255 0 ≤ t 2 ≤ 255 Outputs the pulse specified by t1 and t 2 to connector pin m as follows: m Connector pin 0 Drawer kick-out connector pin 2. 1 Drawer kick-out connector pin 5. • The pulse ON time is [t1 × 2 ms] and the OFF time is [t2 × 2 ms].
MP-4200 TH Programmer’s Manual - Revision 1.0 Bit Bin Hex Dec Status 0 0 00 0 Drawer kick-out connector pin 3 is LOW. 1 01 1 Drawer kick-out connector pin 3 is HIGH. 1-3 - - - Undefined. 4 0 00 0 Not used. Fixed to Off. 5,6 - - - Undefined. 7 0 00 0 Not used. Fixed to Off. ESC v [Function] [Format] Transmit paper sensor status ASCII ESC v Hexadecimal 1B 76 Decimal 27 118 Transmits the status of paper sensor(s) as 1 byte of data.
MP-4200 TH Programmer’s Manual - Revision 1.0 FS p n m [Function] [Format] [Range] [Description] [Details] [References] Print NV bit image. ASCII FS p n m Hexadecimal 1C 70 n m Decimal 28 112 n m 1 ≤ n ≤ 255; 0 ≤ m ≤ 3, 48 ≤ m ≤ 51 Print n-th NV bit image using mode specified by m.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] [Reference] • xL, xH specifies (xL + xH × 256) × 8 dots in the horizontal direction. • yL, yH specifies (xL + xH × 256) × 8 dots in the vertical direction. • This command cancels all NV bit images that have already been defined. • The printer cannot redefine only one of several data definitions previously defined. In this case, all data needs to be sent again.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] [Reference] Hex Decimal Width 00 0 1 (normal) 10 16 2 (double-width) 20 32 3 30 48 4 40 64 5 50 80 6 60 96 7 70 112 8 Hex Decimal Height 00 0 1 (normal) 01 1 2 (double-height) 02 2 3 03 3 4 04 4 5 05 5 6 06 6 7 07 7 8 • This command is effective on all characters (alphanumeric and ideograms), except on HRI characters. • If n is out of range, command is ignored.
MP-4200 TH Programmer’s Manual - Revision 1.0 • The downloaded bit image definition is cleared when: o ESC @ is executed. o FS q is executed. o Printer is reset or the power is turned off. • The following figure shows the relationship between downloaded bit image and print data: Reference] GS / GS / m [Function] [Format] [Range] [Description] [Details] [Reference] 58 Print downloaded bit image.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( A pL pH n m [Function] [Format] [Range] [Description] Execute test print. ASCII GS ( A pL pH n m Hexadecimal 1D 28 41 pL pH n m Decimal 29 40 65 pL pH n m (pL+(pH×256)) = 2 (pL=2, pH=0) 0 ≤ n ≤ 2, 48 ≤ n ≤ 50 1 ≤ m ≤ 3, 49 ≤ m ≤ 51 • Executes a test print with a specified test pattern on a specified paper. • pL and pH specifies the number of the parameter such as n, m to (pL + (pH × 256)) bytes. n specifies the paper to be tested.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Description] Enable or disable real-time commands, as described below: a b Function 1 0, 48 Disable DLE DC4 ƒn m t (ƒn = 1) processing. 1, 49 Enable DLE DC4 ƒn m t (ƒn = 1) processing. 0, 48 Disable DLE DC4 ƒn a b (ƒn = 2) processing. 1, 49 Enable DLE DC4 ƒn a b (ƒn = 2) processing 2 • pL, pH specifies (pL + pH × 256) as the number of bytes after pH (m and [a1 b1]...[ak bk ]). • a specifies the type of real-time command.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Notes] • [parameters] is described in each function. • ƒn defines the function code for the command. • Function codes (ƒn) are identical for both GS ( L and GS 8 L commands. The only difference between them is the parameters (pL, pH, p1, p2, p3, and p 4), used to specify the number of bytes after m. Because of that, GS ( L can handle up to 65,535 bytes, while GS 8 L can handle up to 4,294,967,296 bytes.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( L pL pH m fn [Function] [Format] [Range] [Description] Transmit NV graphics memory capacity.
MP-4200 TH Programmer’s Manual - Revision 1.0 • The decimal value for the unused capacity is converted to text data and sent, starting from the high order end. • This function cannot be used together with NV bit images (FS q). GS ( L pL pH m fn [Function] [Format] [Range] [Description] Transmit the remaining capacity of downloaded graphics memory.
MP-4200 TH Programmer’s Manual - Revision 1.0 (*1) When the number of NV graphics data group exceeds 40, the groups are divided into blocks in compliance with the following conditions: o When unsent data is present, the Identification status byte (byte 3) is set to hexadecimal value 41h (decimal value 65). o When unsent data is not present, the Identification status byte (byte 3) is set to hexadecimal value 40h (decimal value 64).
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( L pL pH m fn a kc1 kc2 b xL xH yL yH [c d1 ... dk]1 ... [c d1 ... dk]b GS 8 L p1 p2 p 3 p 4 m fn a kc1 kc2 b xL xH yL yH [c d1 ... dk]1 ... [c d1 ... dk] b [Function] [Format] [Range] [Description] [Notes] Define a raster NV graphics data. ASCII GS ( L pL pH m f n kc1 kc2 b xL xH yL yH [c d1 ... dk ]1 ... [c d1 ... dk ]b Hexadecimal 1D 28 4C pL pH m f n kc1 kc2 b xL xH yL yH [c d1 ... dk ]1 ... [c d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( L pL pH m fn kc1 kc2 x y [Function] [Format] [Range] [Description] [Notes] Print specified NV graphics data. ASCII GS ( L pL pH m f n kc1 kc2 x y Hexadecimal 1D 28 4C pL pH m f n kc1 kc2 x y Decimal 29 40 76 pL pH m f n kc1 kc2 x y (pL + pH×256) = 6 (pL=6; pH=0) m = 48 ƒn = 69 32 ≤ kc1 ≤ 126 32 ≤ kc2 ≤ 126 x = 1, 2 y = 1, 2 • Prints the NV graphics data defined by the key codes kc1 and kc2.
MP-4200 TH Programmer’s Manual - Revision 1.0 • When no key codes are present, printer response looks like: Hex Dec Data bytes Header Transmit data 37 55 1 Identifier 73 114 1 Identification status 40 64 1 NUL 00 0 1 • This function cannot be used together with downloaded bit images (GS *). GS ( L pL pH m fn d1 d2 d 3 [Function] [Format] [Range] [Description] Delete all downloaded graphics data.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Range] [Description] [Notes] 12 ≤ (pL + pH×256) ≤ 65,535 12 ≤ (p1 + p2×256 + p3×65536 + p 4×16777216) ≤ 4,718,604 m = 48 ƒn = 83 a = 48 32 ≤ kc1 ≤ 126 32 ≤ kc2 ≤ 126 b = 1, 2 1 ≤ (xL + xH×256) ≤ 8,192 (0 ≤ xL ≤ 255, 0 ≤ xH ≤ 32) 1 ≤ (yL + yH×256) ≤ 2,304 (0 ≤ yL ≤ 255, 0 ≤ yH ≤ 9) c = 49, 50 0 ≤ d ≤ 255 Define a raster downloaded graphics data as a record specified by the key code kc1 and kc2 in the downloaded graphics area.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Description] [Notes] m = 48 ƒn = 85 32 ≤ kc1 ≤ 126 32 ≤ kc2 ≤ 126 x = 1, 2 y = 1, 2 • Prints the downloaded graphics data defined by the key codes kc1 and kc2. • x = 2 defines double height downloaded graphics print. • y = 2 defines double width downloaded graphics print. • This function is used to print downloaded graphics data defined using function 83. • The specified key code must exist for the printer to print downloaded graphics data.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( N pL pH fn [parameter] [Function] [Format] [Range] [Description] [Notes] Select character effects. ASCII GS ( N pL pH f n Hexadecimal 1D 28 4E pL pH f n Decimal 29 40 78 pL pH f n ƒn = 48 Selects character effects, according to fn value, as described in the table below. ƒn Function 48 Select character color. • pL, pH specifies (pL + pH × 256) as the number of bytes after pH (ƒn and [parameter]).
MP-4200 TH Programmer’s Manual - Revision 1.0 [Range] cn = 48 (PDF417 code). ƒn = 65, 66, 67, 68, 69, 70, 80, 81, 82. [Description] Process data for two-dimensional codes. • Symbol type is specified by cn. • Function code ƒn specifies the function. [Notes] cn ƒn Function 48 65 PDF417: Set number of columns in the data region. 66 PDF417: Set number of rows. 67 PDF417: Set the width of the module. 68 PDF417: Set the row height. 69 PDF417: Set the error correction level.
MP-4200 TH Programmer’s Manual - Revision 1.0 • The following data is not included in the number of columns: o Start pattern and stop pattern. o Indicator codeword of left and right. • When automatic processing (n = 0) is selected, the number of columns is calculated by the print area when processing functions 81, 82, module width (function 67), and option setting (function 70). • Settings of this function are effective until ESC @ is executed, the printer is reset, or the power is turned off.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( k pL pH cn fn m n [Function] [Format] [Range] [Default] [Description] [Notes] PDF417: Set the error correction level. ASCII GS ( k pL pH cn f n m n Hexadecimal 1D 28 6B pL pH cn f n m n Decimal 29 40 107 pL pH cn f n m n (pL + pH×256) = 4 (pL=4; pH=0) cn = 48 (PDF417 code) ƒn = 69 m = 48, 49 48 ≤ n ≤ 56 [m = 48] 1 ≤ n ≤ 40 [m = 49] m = 49, n = 1 Set error correction level for PDF417.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS ( k pL pH cn fn n [Function] [Format] [Range] [Description] PDF417: Select option. ASCII GS ( k pL pH cn f n n Hexadecimal 1D 28 6B pL pH cn f n n Decimal 29 40 107 pL pH cn f n n (pL + pH×256) = 3 (pL=3; pH=0) cn = 48 (PDF417 code) ƒn = 70 n = 0 (standard PDF417) Select option for PDF417. Only standard PDF417 is supported. GS ( k pL pH cn fn m d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 • The following data are added automatically by the encode process: o Start pattern and stop pattern. o Indicator codeword of left and right. o The descriptor of symbol length (the first codeword in the data area). o The error correction codeword calculated by modulus 929. o Pad codeword.
MP-4200 TH Programmer’s Manual - Revision 1.0 • The decimal value of the vertical size and horizontal size is converted to text data and sent starting from the high order end. • Size information indicates the size of symbol printed by function 81. • The quiet zone is not included in the size information. GS : [Function] [Format] [Description] [Details] [Reference] Start/end macro definition. ASCII GS : Hexadecimal 1D 3A Decimal 29 58 Start/end macro definition.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS H n [Function] [Format] [Range] [Default] [Description] [Details] [References] Select print position for HRI characters. ASCII GS H n Hexadecimal 1D 48 n Decimal 29 72 n 0 ≤ n ≤ 3, 48 ≤ n ≤ 51 n=0 Select print position for HRI in barcodes. n selects the print position as follows: n Print position 0, 48 Not printed. 1, 49 Above barcode. 2, 50 Below barcode. 3, 51 Both above and below barcode. • HRI stands for Human Readable Interpretation.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] Bit Off/On Hex Decimal 0 Off 00 0 Function Two-byte character code not supported. On 01 1 Two-byte character code supported. 1 On 02 2 Auto-cutter equipped. 2 Off 00 0 Not used. Fixed to off. 3 Off 00 0 Not used. Fixed to off. 4 Off 00 0 Not used. Fixed to off. 5 - - - Undefined. 6 - - - Undefined. 7 Off 00 0 Not used. Fixed to off.
MP-4200 TH Programmer’s Manual - Revision 1.0 [References] • The horizontal motion unit (x) is used for calculating left margin. The calculated result is truncated to the minimum value of the mechanical pitch. GS P, GS W GS P x y [Function] [Format] [Range] [Description] [Details] [References] Set horizontal and vertical motion units. ASCII GS P x y Hexadecimal 1D 50 x y Decimal 29 80 x y 0 ≤ x ≤ 255 0 ≤ y ≤ 255 Sets the horizontal and vertical motion units to approximately 25.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Function] [Format] [Range] [Default] [Description] 80 Set printing area width. ASCII GS W nL nH Hexadecimal 1D 57 nL nH Decimal 29 87 nL nH 0 ≤ nL ≤ 255 0 ≤ nH ≤ 255 nL = 0; nH = 2 Set printing area width to [(nL + nH × 256) × horizontal motion unit]. [Details] • This command is effective only when processed at the beginning of a line. • If settings exceed printable area, the maximum value of the printable area is used.
MP-4200 TH Programmer’s Manual - Revision 1.0 [References] • NV bit image (FS p): Double width mode or Quadruple mode = 2 dots Normal mode or Double-height mode = 1 dot • Raster bit image (GS v 0): Double width mode or Quadruple mode = 2 dots Normal mode or Double-height mode = 1 dot GS L, GS P GS ^ r t m [Function] [Format] [Range] [Description] [Details] [Reference] Execute macro.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] • If any status item is enabled, the printer transmits the status when this command is executed. The printer automatically transmits the status whenever an enabled status item changes. • If all status items are disabled, the ASB function is also disabled. • If ASB is enabled by default, as soon as printer is turned on and is able to transmit and receive data transmits, the status is send.
MP-4200 TH Programmer’s Manual - Revision 1.0 o Third byte (Paper sensor information) Bit Off/On Hex Dec 0, 1 Off 00 0 Paper roll near-end sensor: paper OK. On 03 3 Paper roll near-end sensor: paper near end. 2, 3 Function Off 00 0 Paper roll end sensor: paper present. On 0C 12 Paper roll end sensor: paper not present. 4 Off 10 16 Not used. Fixed to Off. 5, 6 - - - Undefined. 7 Off 00 0 Not used. Fixed to Off.
MP-4200 TH Programmer’s Manual - Revision 1.0 (1) GS k m d1 ... dk NUL (2) GS k m n d1 ... dn [Function] [Format] [Range] [Description] Print barcode. ASCII (1) GS k m d1 ... dk NUL (2) GS k m n d1 ... dn Hexadecimal (1) 1D 6B m d1 ... dk 00 (2) 1D 6B m n d1 ... dn Decimal (1) 29 107 m d1 ... dk 0 (2) 29 107 m n d1 ... dn (1) 0 ≤ m ≤ 6 (k and d depends on the barcode system used) (2) 65 ≤ m ≤ 73 (n and d depends on the barcode system used) Selects a bar code system and prints the bar code.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Details] [References] • If d is outside of the range, the printer only feeds paper and processes incoming data as normal data. • If the horizontal size exceeds 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 specified by ESC 2 or ESC 3. • This command is enabled only when no data exists in the print buffer.
MP-4200 TH Programmer’s Manual - Revision 1.0 [References] Bit On/Off Hex Dec 0 Off 00 0 Drawer kick-out connector pin 3 is LOW. Function On 01 1 Drawer kick-out connector pin 3 is HIGH. 1-3 - - - Undefined. 4 Off 00 0 Not used. Fixed to off. 5, 6 - - - Undefined 7 Off 00 0 Not used. Fixed to off. DLE EOT, GS a GS v 0 m xL xH yL yH d1 ... dk [Function] [Format] [Range] [Description] Print raster bit image. ASCII GS v 0 m xL xH yL yH d1 ...
MP-4200 TH Programmer’s Manual - Revision 1.0 GS w n [Function] [Format] [Range] [Default] [Description] Set barcode width. ASCII GS w n Hexadecimal 1D 77 n Decimal 29 119 n 2≤n≤6 n=3 Set barcode horizontal size. n specifies barcode width as follows: n [Reference] Module width (mm) for Multilevel Barcode Binary-level Barcode Thin element width (mm) Thick element width (mm) 2 0.250 0.250 0.625 3 0.375 0.375 1.000 4 0.500 0.500 1.250 5 0.625 0.625 1.625 6 0.750 0.750 2.
MP-4200 TH Programmer’s Manual - Revision 1.0 If n is 8 (08h or 38h), UTF8 (Unicode) is selected. If n is 9 (09h or 39h), Big-5E is selected. If n is 10 (0Ah or 3Ah), JIS is selected. If n is 11 (0Bh or 3Bh), SHIFT JIS is selected. If n is 12 (0Ch or 3Ch), GB2312 is selected. If n is 14 (0Eh or 3Eh), EUC-CN is selected. If n is 21 (15h or 45h), CODEPAGE 862 is selected. GS F9h 8 n [Function] [Format] [Visibility] [Range] [Default] [Description] Set and save ESC/POS ideogram mode.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F9h - n [Function] [Format] [Default] [Description] Set and save printer mode. ASCII GS F9h – n Hexadecimal 1D F9 2D n Decimal 29 249 45 n n=0 Set printer priority to high quality of high speed. n = 0 or 30h – normal. n = 1 or 31h – high quality. n = 2 or 32h – high speed. GS F9h ! n [Function] [Format] [Description] [Notes] Set and save paper width.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS FAh n [Function] [Format] [Description] Set and save printer language. ASCII GS FAh n Hexadecimal 1D FA n Decimal 29 250 n Set printer language. n = 0 or 30h – English n = 1 or 31h – Portuguese n = 2 or 32h – Spanish n = 3 or 33h – German n = 4 or 34h – Italian n = 5 or 35h – French n = 6 or 36h – Simplified Chinese n = 7 or 37h – Traditional Chinese n = 8 or 38h – Japanese GS F9h ‘ n [Function] [Format] [Description] Get printer information.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F8h 1 [Function] [Format] [Description] Printer extended status enquiry. ASCII GS F8h 1 Hexadecimal 1D F8 31 Decimal 29 248 49 Issuing this command makes the printer to return five status bytes. The first byte is the printer status: 7 6–5 4 3 2 1 0 1 BufStat Wait Offline OVR 0 0 Bit 2: OVR (Overrun Error) 0 – Printer is ready to receive data. 1 – Printer is in overrun condition. If more data is received, it will be lost. Bit 3: Offline.
MP-4200 TH Programmer’s Manual - Revision 1.0 Bit 6: Error 0 – No error condition exist in the printer. 1 – At least one error condition is being reported by the printer. Bit 7: Cover 0 – Printer cover is opened. 1 – Printer cover is closed. The third byte is printer error status: 7 6 5 4 3 2 1 0 1 RE NRE 1 CE CA 0 0 Bit 2: CA – Cutter Absence 0 – Cutter present. 1 – Cutter absent. Bit 3: CE – Cutter Error 0 – No error condition detected in the cutter.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F8h F [Function] [Format] [Description] Printer reset. ASCII GS F8h F Hexadecimal 1D F8 46 Decimal 29 248 70 Force a hardware reset on the printer. GS F9h D m n [Function] [Format] [Range] [Default] [Description] Activate buzzer on cut. ASCII GS F9h D m n Hexadecimal 1D F9 44 m n Decimal 29 249 68 m n m = 0, 1, 2 0 ≤ n ≤ 255 m = 0, n = 2 Set buzzer activation on paper cut.
MP-4200 TH Programmer’s Manual - Revision 1.0 Bit On/Off Hex Dec Function 0, 1 - - - Undefined. Off 00 0 Double-width mode is OFF. On 04 4 Double-width mode is ON. Off 00 0 Double-height mode is OFF. On 08 8 Double-height mode is ON. - - - Undefined. Off 00 0 Underline mode is OFF. On 80 128 Underline mode is ON.
MP-4200 TH Programmer’s Manual - Revision 1.0 [Notes] [Reference] n Function 0, 48 Turn off underline mode for ideograms. 1, 49 Turn on underline mode for ideograms (1-dot thick). 2, 50 Turn on underline mode for ideograms (2-dot thick). • The printer can underline all characters (including right- and left-side character spacing), but cannot underline the space set by HT and 90° clockwise-rotated characters.
MP-4200 TH Programmer’s Manual - Revision 1.0 FS S n1 n2 [Function] [Format] [Range] [Default] [Description] [Notes] [Reference] Set left- and right-side ideogram spacing. ASCII FS S n1 n2 Hexadecimal 1C 53 n1 n2 Decimal 28 83 n1 n2 0 ≤ n1 ≤ 255 0 ≤ n2 ≤ 255 n1 = 0, n2 = 0 Set left- and right-side ideogram spacing using n1 and n2, respectively.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F9h D m n [Function] [Format] Decimal [Range] [Default] [Description] Activate buzzer on cut ASCII GS F9h D m n Hexadecimal 1D F9 44 m n 29 249 68 m n 0≤m≤2 0 ≤ n ≤ 255 m=0 n = 200 • This command tells the printer to active the buzzer at the same time of a cut is being performed.
MP-4200 TH Programmer’s Manual - Revision 1.0 GS F9h W a s c m n e1 ..em p1 ..pn [Function] [Format] [Range] [Default] [Description] Set Wi-Fi settings ASCII GS F9h W a s c m n e1..em p1..pn Hexadecimal 1D F9 57 a s c m n e1..em p1..pn Decimal 29 249 87 a s c m n e1..em p1..pn a = 0, 1 s = 0, 1, 2, 3, 4 0 ≤ c ≤ 13 0 ≤ m ≤ 32 0 ≤ n ≤ 63 a=0 s=0 c=0 m=0 n=0 This command sets Wi-Fi communication settings.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.0 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.
MP-4200 TH Programmer’s Manual - Revision 1.
MP-4200 TH Programmer’s Manual - Revision 1.0 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.).
MP-4200 TH Programmer’s Manual - Revision 1.0 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.