Manual de Programacao MP-4200-TH[1]

Embed Size (px)

Citation preview

  • MP-4200 TH Programmers Manual - Revision 1.0

    i

    POS Printer MP-4200 TH Programmers ManualP/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.

    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 web site:

    www.bematech.com

    Not withstanding 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. Corporations 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 Users Manual. 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.

  • MP-4200 TH Programmers Manual - Revision 1.0

    ii

    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. Please read this section carefully and store it in an accessible location.

    Electrical Safety Topreventelectricalshockhazard,disconnectthepowercablefromtheelectricaloutletbeforerelocatingthe system. Whenaddingorremovingdevicestoorfromthesystem,ensurethatthepowercablesforthedevicesare unplugged before the signal cables are connected. If possible, disconnect all power cables from the existing system before you add a device. Before connecting or removing signal cables from the product, ensure that all power cables are unplugged. Seekprofessionalassistancebeforeusinganadapterorextensioncord.Thesedevicescouldinterruptthe grounding circuit. Makesurethatyourpowersupplyissettothecorrectvoltageinyourarea.Ifyouarenotesureaboutthe voltage of the electrical outlet you are using, contact your local power company. Ifthepowersupplyisbroken,donottrytofixitbyyourself.Contactaqualifiedservicetechnicianoryour retailer.

    Operation Safety Before installingtheproductandaddingdeviceson it,carefullyreadall themanuals thatcamewiththe package. Beforeusingtheproduct,makesureallcablesarecorrectlyconnectedandthepowercablesarenotdamaged. If you detect any damage, contact you retailer immediately. To avoid short circuits, keep paper clips, screws, and staples away from connectors, slots, sockets and circuitry. Avoiddust,humidity,andtemperatureextremes.Donotplacetheproductinanyareawhereitmaybecome wet. Placetheproductonastablesurface. If you encounter technical problems with the product, contact a qualified service technician or you retailer.

  • MP-4200 TH Programmers Manual - Revision 1.0

    iii

    Summary

    List of Tables iv

    Acronyms and Abbreviations v

    Revision History vi

    Chapter 1: Introduction 1

    1.1 Objective 11.2 Structure 1

    Chapter 2: Quick Reference Guide 2

    2.1 ESC/Bema Quick Reference Guide 22.2 ESC/POS Quick Reference Guide 6

    Chapter 3: ESC/Bematech Command Set 9

    ESC/Bematech Command Set 9

    Chapter 4: ESC/POS Command Set 39

    ESC/POS Command Set 39

    Appendix I Tables 99

    Table 1 - Characters Per Line 99

    Appendix II Character Tables 100

    ASCII 100Code Page 437 100Code Page 850 101Code Page 858 101Code Page 860 102Code Page 866 103

    Appendix III - Transmission Status Identification 104

  • MP-4200 TH Programmers Manual - Revision 1.0

    iv

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

    Table 6: Print width, character width and height commands for ESC/Bema mode ..11

    Table 7: Bitmap and graphic commands for ESC/Bema mode ......................11

    Table 8: Communication related commands for ESC/Bema mode .................12

    Table 9: Data control related commands for ESC/Bema mode......................12

    Table 10: Barcode commands for ESB/Bema mode....................................12

    Table 11: Standard commands for ESC/POS mode..................................13

    Table 12: Ideograms control commands for ESC/POS mode......................15

    Table 13: Miscellaneous commands for ESC/POS mode...........................15

  • MP-4200 TH Programmers Manual - Revision 1.0

    v

    Acronyms and Abbreviations

    Abreviation Significance

    bit Binary digit

    dpi Dotsperinch

    JIS Japanese Industrial Standards

    TCP/IP Suite of protocols used for Internet communication

    USB Universal Serial Bus

    UTF-8 8-bit Unicode Transformation Format

  • MP-4200 TH Programmers Manual - Revision 1.0

    vi

    Revision History

    Date Version DescriptionApril 2010 1.0 Initial release.

  • 1MP-4200 TH Programmers 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:

    Printingspeedsofupto250mm/sinbothtextandgraphicmodes.Fourpaperwidths:58mm,76mm,80mmor82.5mm.Twocommandssets:ESC/BematechorESC/POS.OneUSBdeviceinterfacealwaysavailabletoconnectwithhostcomputers.TwodifferentmodelsofoptionalserialRS-232interfacescards,oneusingaDB-9connectorandanotherusingDB-25connector,toallowserialcommunicationwithlegacyandembeddedhosts.Oneoptional10/100MbitEthernetinterfacecardwithintegratedTCP/IPstackforwiredremoteprintingthrough local area networks. One optional IEEE 802.11b/gWi-Fi interface card with integrated TCP/IP stack for wireless remoteprinting through local area networks.Sevencodepagesavailable:437 (USAandStandardEurope),850 (MultilingualLatin-1WesternEuropeanLanguages),858(MultilingualwithEurosymbol),860(Portuguese),862(Hebrew),864(Arabic)and866(Cyrillic).SupportsTraditionalChinese(Big5E)andSimplifiedChinese(GB2312orEUC-CN).SupportsJapanese(JISandShiftJIS).SupportsUTF-8characters.Cangeneratefourteendifferenttypesofunidimensionalbarcodes(EAN-8,EAN-13,Code39,Code93,Code128(A,BandC),ITF,Codabar,UPC-A,UPC-E,ISBN,MSIorPlessey).CangeneratePDF-417bidimensionalbarcode.Maybeusedtocontroluptotwoexternalcashdrawers.Dotdensityof203x203dpi.

    1.1 Objective The purpose of this manual is to provide to developers and programmers detailed information about MP-4200 TH operation. All available commands are described to allow the use of MP-4200 TH to print receipts for any kind of application.

    1.2 Structure This manual is organized in four chapters. This first chapter provides some highlights about MP-4200 TH thermal printer and also some information on how to use this manual. The second chapter presents a summary of all the commands supported by the MP-4200 TH in a form of a quick reference guide. The third chapter providesindepthinformationabouteverycommandavailableintheESC/Bematechmodeofoperation.ThefourthchapterprovidesindepthinformationabouteveryESC/POScommandsupportedbyMP-4200THprinterwhenoperatingintheESC/POSmodeofoperation. Chapters three and four describe commands using up to nine arguments, as described in Table 1.

    Arguments used to describe MP-4200 TH commands. Table 1

    Argument Significance

    [Function] Short description of the command functionality.

    [Format] Command code sequence.

    [Range] Shows command arguments ranges, if applicable.

    [Default] Givesdefaultvaluesforparameters,ifapplicable.

    [Description] Describeswhatthecommanddoes.

    [Details] Describestheusageofthecommandindetailandalsoitslimitations.

    [Notes] Provides important information on setting and using the printer command, if necessary.

    [References] Listsrelatedcommands,ifapplicable.

    [Example] Provides a short example on how to use the command.

  • 2MP-4200 TH Programmers 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-4200THareESC/Bematech(orESC/Bemaforshort)andESC/POS,butonlyoneofthemisactiveata given time. There are commands specifically designed to switch from current command set to the other.

    2.1 ESC/Bema Quick Reference Guide ESC/BemaisastandarddevelopedbyBematech,itspartnersandcustomersduringseveral years of operation in the South America retail and bank automation markets.ThesyntaxusedtosummarizeESC/Bemacommandsinthetablesthroughout this section is described in the bullets below:

    ESCPmeansacommandwithnoparameters.ESCQnmeansacommandwithoneparameter.ESCKn1n2meansacommandwithtwoparameters.ESCDn1...nkmeansacommandwithvariablenumberofparameters.

    InthebulletsabovetheESCsymbolrepresentsthehexadecimalnumber1B,accordingtoASCIItable.Thecharacter P represents the hexadecimal number 50, as defined in the ASCII table too. In some circumstances hexadecimalnumbersbetween7FandFFcanalsobeusedasapartofacommand.Asthesevaluescannotbe represented using ASCII table, they will be represented with the value followed by the h character. InthenexttablesESC/Bemacommandsaresummarized.

    Printer settings commands for ESC/Bema mode Table 2

    Command Description Hexadecimal Format

    GSF9h5n Select printer operating mode and save selected option to configuration memory.

    1DF935n

    GSF9h7n Set and save printer default code page for ESC/Bemacommandset.

    1DF937n

    GSF9h8n SetandsaveESC/POSideogrammode. 1DF938n

    GSF9hC00h Getprintercurrentcommandset. 1DF94300

    GSF9hSPn Select printer operating mode without saving selected option to printer configuration memory.

    1DF920n

    GSF9h1Fh1 Return tomode in use prior to sending GSF9hSPncommand.

    1DF91F31

    ESC@ Initialize printer to its default settings. 1B 40

    ESCbn Select paper sensor to output paper-end signal.

    1b62n

    ESCvn Activate drawer #1 for n milliseconds 1B76n

    ESC80hn Activate drawer #2 for n milliseconds 1B 80 n

    ESCi Perform full paper cut 1B69

    ESCw Perform full paper cut 1B77

    ESCm Perform partial paper cut 1B6D

    ESCyn Enable/disablepanelkeys 1B79n

    ESCx Enabledumpmode 1B78

    ESCzn Enable/disableautomaticlinefeed 1B7An

  • 3MP-4200 TH Programmers Manual - Revision 1.0

    ESC(ApL pH fn n1 n2 vol Activate/deactivate buzzer 1B 28 41 pL pH fn n1 n2 vol

    GSF9hn Set and save printer mode 1DF92Dn

    GSF9h!n Set and save paper width 1DF921n

    GSF9h,n Enable/disablepapernear-endsensor 1DF92Cn

    GSF9h+n Set and save printing intensity 1DF92Bn

    GSFAhn Set and save printer language 1DFAn

    GSF9hn Getprinterinformation 1DF927n

    GSF9h(0 Loaddefaultuserconfiguration 1DF92830

    GSF9h)0 Print user configuration 1DF92930

    GSF8hF Printer reset 1DF846

    GSF7hBSNULi1i4 s1s4 Set IP address and subnet mask 1DF7080022i1i4 s1s4

    GSF7hEOTNULg1g4 Set default gateway IP address 1DF7040027g1g4

    GSF9hDmn Activate buzzer on cut 1DF944mn

    GSF9hEn SetDHCPusage 1DF945n

    GSF9hSmip1..ip4 n c1..cn Set SNMP settings 1DF953mip1..ip4 n c1..cn

    GSF9hWascmne1..em p1..pn Set Wi-Fi settings 1DF957ascmne1..em p1..pn

    Vertical positioning commands Table 3

    Command Description Hexadecimal Format

    ESCCn Set page size in lines 1B43n

    ESCcn1n2 Set page size in millimeters 1B63n1n2

    ESCJn Performs a fine line feed 1B 4A n

    FF Feed one page 0C

    LF Feed one line 0A

    ESC2 Settextlineheightto1/6inches 1B32

    ESC3n Set line feed to n/144 inches 1B33n

    ESCf1n Vertical skipping 1B6631n

    ESCAn Feedpaperby[nx0,375]mm 1B 41 n

    Horizontal positioning commands Table 4

    Command Description Hexadecimal Format

    ESCf0n Horizontal skipping 1B6630n

    HT Horizontal tab 09

    ESCDn1nkNUL Set horizontal tab marks 1B 44 n1nk 00

    ESCQn Set right margin 1B 51 n

    ESCln Set left margin 1B6Cn

    ESCan Character alignment 1B61n

  • 4MP-4200 TH Programmers Manual - Revision 1.0

    Character formatting commands Table 5

    Command Description Hexadecimal Format

    ESCn Enable/disableunderlineprintmode 1B2Dn

    ESC4 Enableitalicprintmode 1B34

    ESC5 Disableitalicprintmode 1B35

    ESCE Enableemphasizedprintmode 1B 45

    ESCF Disableemphasizedprintmode 1B46

    ESCtn Codepage selection 1B74n

    ESCRn Select an international character set 1B 52 n

    ESCSn Enable superscript and/or subscript printmodes

    1B53n

    ESCT Disablesuperscriptandsubscriptprintmodes 1B 54

    ESCNn Select printing intensity 1B4En

    ESC!n Select print mode 1B 21 n

    ESC}n Turn upside-down printing mode on/off 1B7Dn

    ESCZ Print supported Unicode sets 1B 5A

    ESC[n Print a specific Unicode set 1B 5B n

    Print width, character width and height commands Table 6

    Command Description Hexadecimal Format

    DC2 Disablecondensedmode 12

    DC4 Disableon-lineexpandedprint 14

    ESCdn Enable/disabledoubleheightprintmode 1B64n

    ESCH Disablecondensedmode 1B 48

    ESCP Disablecondensedmode 1B 50

    ESCSI Enablecondensedmode 1B 0F

    ESCSO Enableon-lineexpandedmode 1B0E

    ESCV Enableon-linedoubleheightmode 1B56

    ESCWn Enable/disableexpandedmode 1B57n

    SI Enablecondensedmode 0F

    SO Enableon-lineexpandedmode 0E

    Bitmap and graphic Table 7

    Command Description Hexadecimal Format

    ESC$n1n2 Fill in blank bit columns 1B 24 n1 n2

    ESC*!n1n2b1...bn 24-bit graphics 1B 2A 21 n1 n2 b1 ... bn

    ESCKn1n2b1...bn 8-bit graphics 1B 4B n1 n2 b1 ... bn

    FS p n m Print NV bit image 1C70nm

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

    DefineNVbitimage 1C71 n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n

    GS/m Print downloaded bit image 1D2Fm

    GS*xyd1...d(x y 8) Definedownloadedbitimage 1D2Axyd1...d(x y 8)

    GSv0mxL xH yL yH d1...dk Print raster bitmap 1D7630mxL xH yL yH d1...dk

  • 5MP-4200 TH Programmers Manual - Revision 1.0

    Communication related Table 8

    Command Description Hexadecimal Format

    ENQ Printer status enquiry 05

    GSF8h1 Printer extended status enquiry 1DF831

    ETX Endbuffer 03

    STX Clear buffer 02

    Data control related Table 9

    Command Description Hexadecimal Format

    CAN Cancel last line 18

    DEL Cancel last character 7F

    Barcode commands Table 10

    Command Description Hexadecimal Format

    GShn Set barcode height 1D68n

    GSwn Set barcode width 1D77n

    GSHn Choose the position of human readable information (HRI) in the barcode

    1D48n

    GSfn Set the font to be used for human readable information (HRI)

    1D66n

    GSkNULd1d11NUL Print an UPC-A barcode 1D6B00d1d11 00

    GSkAVTd1...d11 Print an UPC-A barcode 1D6B410Bd1d11

    GSkSOHd1d6NUL PrintanUPC-Ebarcode 1D6B01d1d6 00

    GSkBACKd1d6 PrintanUPC-Ebarcode 1D6B4206d1d6

    GSkSTXd1d12NUL PrintanEAN-13barcode 1D6B02d1d12 00

    GSkCFFd1d12 PrintanEAN-13barcode 1D6B430Cd1d12

    GSkETXd1d7NUL PrintanEAN-8barcode 1D6B03d1d7 00

    GSkDBELd1d7 PrintanEAN-8barcode 1D6B4407d1d7

    GSkEOTd1dnNUL PrintaCODE39barcode 1D6B04d1dn 00

    GSkEnd1dn PrintaCODE39barcode 1D6B45nd1dn

    GSkENQd1dnNUL Print an ITF barcode 1D6B05d1dn 00

    GSkFnd1...dn Print an ITF barcode 1D6B46nd1dn

    GSkACKd1dnNUL PrintaCODABARbarcode 1D6B06d1dn 00

    GSkGnd1dn PrintaCODABARbarcode 1D6B47nd1dn

    GSkHnd1dn PrintaCODE93barcode 1D6B48nd1dn

    GSkInd1dn PrintaCODE128barcode 1D6B49nd1dn

    GSk80hn1 n2 n3 n4 n5 n6 d1dn PrintaPDF-417barcode 1D6B80n1 n2 n3 n4 n5 n6 d1dn

    GSkNAKd1d9NUL Print an ISBN barcode 1D6B15d1d9 00

    GSkSYNd1dnNUL Print a MSI barcode 1D6B16d1dn 00

    GSk82hnd1dn Print a MSI barcode 1D6B82nd1dn

    GSkETBd1dnNUL PrintaPLESSEYbarcode 1D6B17d1dn 00

    GSk83hnd1dn PrintaPLESSEYbarcode 1D6B83nd1dn

    GSk84hn1 n2 Program barcode left margin 1D6B84n1 n2

  • 6MP-4200 TH Programmers Manual - Revision 1.0

    2.2 ESC/POS Quick Reference Guide

    ESC/POSisastandarddefinedbySeikoEpsonCorporation.ESC/POScommandscanbeclassifiedasexecuting 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/POScommandssupportedbyMP-4200THaresummarizedinTable11,Table12andTable13.

    Standard commands for ESC/POS mode Table 11

    Command NameCommand Classification GS P

    functionExecuting Setting

    HT Horizontal tab x

    LF Print and line feed x

    CR Print and carriage return x

    DLEEOT Real-time status transmission x

    DLEENQ Real-time request to printer x

    DLEDC4

    Generatepulseatreal-time x

    Executepower-offsequence x

    Clear buffer x

    ESCSP Set right-side character spacing x x

    ESC! Select print mode(s) x

    ESC$ Set absolute print position x x

    ESC(A Control beeper tones x x

    ESC* Select bit-image mode x

    ESC- Turn underline mode on/off x

    ESC2 Select default line spacing x

    ESC= Select peripheral device x

    ESC@ Initialize printer x x

    ESCD Set horizontal tab marks x

    ESCE Turn emphasized mode on/off x

    ESCG Turn double-strike mode on/off x

    ESCJ Print and paper feed x x

    ESCM Select character font

    ESCR Select an international character set x

    ESCV Turn90clockwiserotationmodeon/off x

    ESC\ Set relative print position x x

    ESCa Select justification x

    ESCc3 Select paper sensor(s) to output paper-end signals x

    ESCc4 Select paper sensor(s) to stop printing x

    ESCc5 Enable/disablepanelbuttons x

    ESCd Print and feed n lines x

    ESCi Perform a partial cut x

  • 7MP-4200 TH Programmers Manual - Revision 1.0

    ESCm Partial paper cut x

    ESCp Generatepulse x

    ESCt Select character code table x

    ESCun Transmit peripheral device status x

    ESCv Transmit paper sensor status x

    ESC{ Turn upside-down printing mode on/off x

    FS p Print NV bit image x

    FS q DefineNVbitimage x

    GS! Select character size x

    GS* Definedownloadedbitimage x

    GS/ Print downloaded bit image x

    GS(A Executetestprint x

    GS(D Enable/disablereal-timecommand x

    GS8LGS(L

    Process graphics datax

    GS(N Select character effects x

    GS(k Specify and print symbol x x

    GS: Start/end macro definition x x

    GSB Turn white/black reverse printing mode on/off x

    GSH Select printing position of HRI characters x

    GSI TransmitprinterID x

    GSL Set left margin x x

    GSP Set horizontal and vertical motion units x

    GSV Select cut mode and cut paper x x

    GSW Set printing area width x x

    GS^ Executemacro x

    GSa Enable/disableAutomaticStatusBack(ASB) x x

    GSf Select font for HRI characters x

    GSh Set bar code height x

    GSk Print bar code x

    GSr Transmit status x

    GSv0 Print raster bit image x

    GSw Set bar code width x

    Notes:- x means command enabled.

  • 8MP-4200 TH Programmers Manual - Revision 1.0

    MP-4200THalsosupportsideogramsforTraditionalChinese(Big-5E),SimplifiedChinese(EUC-CN)andJapanese(JISorShiftJIS).Table12showsMP-4200THESC/POScommandsdedicatedtoideogramscontrol.

    Ideograms control Table 12

    Command NameCommand Classification GS P

    functionExecuting Setting

    FS! Set print mode(s) for ideograms x

    FS & Select ideogram mode x

    FS - Turn underline mode on/off for ideograms x

    FS . Cancel ideogram mode x

    FS C Select ideogram code system x

    FS S Set ideogram spacing x x

    FS W Turn quadruple-size mode on/off for ideograms x

    BeyondESC/POSstandard,MP-4200THalsosupportssomemiscellaneouscommandsinESC/POSmodetoallowprintertobeconfiguredindependentofcurrentcommandset(ESC/BemaorESC/POS).ThemiscellaneouscommandssupportedbyMP-4200THinESC/POSmodearelistedinTable13.

    Special miscellaneous Table 13

    Command Description Hexadecimal Format

    GSF9h5n Select printer operating mode and save selected option to configuration memory.

    1DF935n

    GSF9h7n SetandsaveprinterdefaultcodepageforESC/Bemacommandset. 1DF937n

    GSF9h8n SetandsaveESC/POSideogrammode. 1DF938n

    GSF9hC00h Getprintercurrentcommandset. 1DF94300

    GSF9hSPn Select printer operating mode without saving selected option to printer configuration memory.

    1DF920n

    GSF9h1Fh1 ReturntomodeinusepriortosendingGSF9hSPncommand. 1DF91F31

    GSF9hn Set and save printer mode 1DF92Dn

    GSF9h!n Set and save paper width 1DF921n

    GSF9h,n Enable/disablepapernear-endsensor 1DF92Cn

    GSF9h+n Set and save printing intensity 1DF92Bn

    GSFAhn Set and save printer language 1DFAn

    GSF9hn Getprinterinformation 1DF927n

    GSF9h(0 Loaddefaultuserconfiguration 1DF92830

    GSF9h)0 Print user configuration 1DF92930

    GSF8h1 Printer extended status enquiry 1DF831

    GSF8hF Printer reset 1DF846

    GSF7hBSNULi1i4 s1s4 Set IP address and subnet mask 1DF7080022i1i4 s1s4

    GSF7hEOTNULg1g4 Set default gateway IP address 1DF7040027g1g4

    GSF9hDmn Activate buzzer on cut 1DF944mn

    GSF9hEn SetDHCPusage 1DF945n

    GSF9hSmip1..ip4 n c1..cn Set SNMP settings 1DF953mip1..ip4 n c1..cn

    GS F9h W a s c m n e1..em p1..pn

    Set Wi-Fi settings 1DF957ascmne1..em p1..pn

  • 9MP-4200 TH Programmers 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] Select printer operating mode.[Format] ASCII GSF9h5n Hexadecimal 1DF935n Decimal 2924953n[Range] n=0;n=1;n=48;n=49;[Description] Ifnis0(00hor30h),ESC/Bemaisselected. Ifnis1(01hor31h),ESC/POSisselected.[Notes] This command modifies printer flags and save the new values to printer configuration memory.

    GS F9h 7 n

    [Function] SetandsaveprinterdefaultcodepageforESC/Bematechcommandset.[Format] ASCII GSF9h7n Hexadecimal 1DF937n Decimal 2924955n[Range] 2n12;n=14;n=21[Default] n=2[Description] Thiscommandselectsthecodepagetobeused,accordingtothefollowingoptions.

    Ifnis2(02hor32h),CODEPAGE850isselected. Ifnis3(03hor33h),CODEPAGE437isselected. Ifnis4(04hor34h),CODEPAGE860isselected. Ifnis5(05hor35h),CODEPAGE858isselected. Ifnis6(06hor36h),CODEPAGE866isselected. Ifnis7(07hor37h),CODEPAGE864isselected. Ifnis8(08hor38h),UTF8(Unicode)isselected. Ifnis9(09hor39h),Big-5Eisselected. Ifnis10(0Ahor3Ah),JISisselected. Ifnis11(0Bhor3Bh),SHIFTJISisselected. Ifnis12(0Chor3Ch),GB2312isselected. Ifnis14(0Ehor3Eh),EUC-CNisselected. Ifnis21(15hor45h),CODEPAGE862isselected.

    GS F9h 8 n

    [Function] SetandsaveESC/POSideogrammode.[Format] ASCII GSF9h8n Hexadecimal 1DF938n Decimal 2924956n[Range] 0n3[Default] n=0[Description] Ifnis0(00hor30h),UTF8(Unicode)ideogrammodeisselected. Ifnis1(01hor31h),ESC/POSJapaneseideogrammodeisselected. Ifnis2(02hor32h),ESC/POSSimplifiedChineseideogrammodeisselected. Ifnis3(03hor33h),ESC/POSTraditionalChineseideogrammodeisselected.

  • 10

    MP-4200 TH Programmers Manual - Revision 1.0

    GS F9h C 00h

    [Function] Getprintercurrentcommandset.[Format] ASCII GSF9hC00h Hexadecimal 1DF94300 Decimal 29249670[Description] Returnonebytewithcurrentcommandset.Ifreturnedbyteis0(00h),printerisoperatingin ESC/Bemamode.Ifreturnedbyteis1(01h),printerisoperatinginESC/POSmode.

    GS F9h SP n

    [Function] Select printer operating mode of operation temporarily.[Format] ASCII GSF9hSPn Hexadecimal 1DF920n Decimal 2924932n[Range] n=0;n=1;n=48;n=49;[Description] Ifnis0(00hor30h),ESC/Bemaisselected. Ifnis1(01hor31h),ESC/POSisselected.[Notes] This command modifies printer flags but does not save the new values to the printer configuration memory. The new mode starts as the printer has been just initialized (ESC @ has beenexecuted).

    GS F9h 1Fh 1

    [Function] Return to previously set mode of operation.[Format] ASCII GSF9h1Fh1 Hexadecimal 1DF91F31 Decimal 292493149[Description] ConfigurationcommandusedtoputprintermodebacktothatusedbeforeissuingGSF9hSPn command.Thepreviousmodere-startsastheprinterhasbeenjustinitialized(ESC@hasbeen executed).

    ESC @

    [Function] Initialize printer to its default settings.[Format] ASCII ESC@ Hexadecimal 1B 40 Decimal 2764[Description] Allprintersettings,includingcharacterfont,linespacing,leftmargin,rightmarginandinvertedmode are canceled and the printer returns to its initial state.

    ESC b n

    [Function] Select paper sensor to output paper-end signal.[Format] ASCII ESCbn Hexadecimal 1B62n Decimal 2798n[Range] n=0,1,48,49[Default] n=0[Description] Ifnis0(00hor30h),paper-endsignal(PE)reflectspapersensoronparallelprinters. Ifnis1(01hor31h),paper-endsignal(PE)reflectsdrawersensoronparallelprinters.[Notes] ThiscommandalsoaffectsthebehaviorofENQonallprintermodels.

  • 11

    MP-4200 TH Programmers Manual - Revision 1.0

    ESC v n

    [Function] Activate drawer #1 for n milliseconds.[Format] ASCII ESCvn Hexadecimal 1B76n Decimal 27118n[Range] 50n250[Description] Activatedrawer#1pinfornmilliseconds(50msn200ms).

    ESC 80h n

    [Function] Activate drawer #2 for n milliseconds.[Format] ASCII ESC80hn Hexadecimal 1B 80 n Decimal 27128n[Range] 50n250[Description] Activatedrawer#2pinfornmilliseconds(50msn200ms).

    ESC i

    [Function] Perform full paper cut.[Format] ASCII ESCi Hexadecimal 1B69 Decimal 27105[Description] Thiscommandoperatestheauto-cutter,performingafullcutinthepaper.

    ESC w

    [Function] Perform full paper cut.[Format] ASCII ESCw Hexadecimal 1B77 Decimal 27119[Description] Thiscommandoperatestheauto-cutter,performingafullcutinthepaper.

    ESC y n

    [Function] Enable/disablepanelkeys.[Format] ASCII ESCyn Hexadecimal 1B79n Decimal 27121n[Range] n=0,1[Default] n=1[Description] Enableordisablepanelkeys. Ifnis0(00hor30h),panelkeysaredisabled. Ifnis1(01hor31h),panelkeysareenabled.

    ESC x

    [Function] Enabledumpmode.[Format] ASCII ESCx Hexadecimal 1B78 Decimal 27120[Description] Dumpmodeisafunctionusedtoprintdatatransmittedfromhostcomputerinhexadecimal numbers. This function is to be used by advanced users and programmers in checking commands

  • 12

    MP-4200 TH Programmers Manual - Revision 1.0

    sent to the printer.[Note] The only way to exit the dump mode is turning off the printer"

    ESC z n

    [Function] Enable/disableautomaticlinefeed.[Format] ASCII ESCzn Hexadecimal 1B7An Decimal 27122n[Range] n=0,1[Default] n=0[Description] Enableordisablelinefeeding. Ifnis0(00hor30h),automaticlinefeedisdisabled. Ifnis1(01hor31h),automaticlinefeedisenabled.[Notes] Whenautomaticlinefeedisenabled,theprinterwillperformaLFifaCRisreceived.

    ESC ( A pL pH fn n1 n2 vol

    [Function] Activate/deactivate buzzer.[Format] ASCII ESC(ApL pH fn n1 n2 vol Hexadecimal 1B 28 41 pL pH fn n1 n2 vol Decimal 274065pL pH fn n1 n2 vol[Description] Activateordeactivateprinterbuzzer. (pL+pH256)=4,i.e.,pL must be 4 and pH must be 0. n=1or31hactivatebuzzer. n=0or30hdeactivatebuzzer(deprecated). n=(n1+n2256)timeinmilliseconds. vol=0,1,48or49volume(unused).

    GS F9h - n

    [Function] Set and save printer mode.[Format] ASCII GSF9hn Hexadecimal 1DF92Dn Decimal 2924945n[Default] n=0[Description] Setprinterprioritytohighqualityofhighspeed. n=0or30hnormal. n=1or31hhighquality. n=2or32hhighspeed.

    GS F9h ! n

    [Function] Set and save paper width.[Format] ASCII GSF9h!n Hexadecimal 1DF921n Decimal 2924933n[Description] Setpaperwidthasdescribedinthetablebelow:

  • 13

    MP-4200 TH Programmers Manual - Revision 1.0

    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

    [Notes] This command has effect only when printer is in ESC/Bema operating mode. For ESC/POSmodepaperwidthisalwayssetto80mm/73.5mm.

    GS F9h , n

    [Function] Enable/disablepapernear-endsensor.[Format] ASCII GSF9h,n Hexadecimal 1DF92Cn

    Decimal 2924944n[Default] n=1[Description] Enableordisablepapernear-endsensor(PNES).Thissettingissavedto configuration (non-volatile) memory. n=1or31henablePNES. n=0or30hdisablePNES.

    GS F9h + n

    [Function] Set and save printing intensity.[Format] ASCII GSF9h+n Hexadecimal 1DF92Bn Decimal 2924943n

    [Description] Obsoleteandignored.KeptheretomaintaincompatibilitywithearlierBematechproducts.

    GS FAh n

    [Function] Set and save printer language.[Format] ASCII GSFAhn Hexadecimal 1DFAn Decimal 29250n[Description] Setprinterlanguage. n=0or30hEnglish n=1or31hPortuguese n=2or32hSpanish n=3or33hGerman

  • 14

    MP-4200 TH Programmers Manual - Revision 1.0

    GS F9h n

    [Function] Getprinterinformation.[Format] ASCII GSF9hn Hexadecimal 1DF927n Decimal 2924939n[Description]Retrieveprinterinformationaccordingtovaluesdescribedinthefollowingtable:

    n Information Data type Return size

    0,30h Productcode(MP-4200TH) ASCII string 10 bytes

    1,31h Serial number ASCII string 20 bytes

    2,32h Manufacturing date ASCII string 4 bytes

    3,33h Firmware version ASCII string 3bytes

    4,34h Reserved

    5,35h Manufacturing timestamp (dd/mm/yyhh:mm:ssformat)

    ASCII string 17bytes

    6,36h Reserved

    7,37h Reserved

    8,38h Interface type (0 = None; 1 = SerialDB-9;2=SerialDB-25;3=Ethernet,-1=Unknown)

    Integer 1 byte

    GS F9h ( 0

    [Function] Loaddefaultuserconfiguration.[Format] ASCII GSF9h(0 Hexadecimal 1DF92830 Decimal 292494048[Description] Reloadallconfigurationsfromnon-volatilememoryanddipswitches.

    GS F9h ) 0

    [Function] Print user configuration.[Format] ASCII GSF9h)0 Hexadecimal 1DF92930 Decimal 292494148[Description] Printonpaperthecurrentuserconfiguration.

    GS F8h F

    [Function] Printer reset.[Format] ASCII GSF8hF Hexadecimal 1DF846 Decimal 2924870[Description] Forceahardwareresetontheprinter.

  • 15

    MP-4200 TH Programmers Manual - Revision 1.0

    GS F7h BS NUL i1...i4 s1...s4

    [Function] Set IP address and subnet mask.[Format] ASCII GSF7hBSNULi1...i4 s1...s4 Hexadecimal 1DF7080022i1...i4 s4...s4 Decimal 292478034i1...i4 s4...s4[Description] ProgramafixedIPaddressandsubnetmasktotheprinter.[Example] TodefineanIPaddressof10.10.1.2andasubnetmaskof255.255.0.0,thefollowingcommand should be sent: 1DF70800220A0A0102FFFF0000[Notes] Valid only when ethernet or wi-fi interface is being used.

    GS F7h EOT NUL g1g4

    [Function] Set default gateway IP address[Format] ASCII GSF7hEOTNULg1g4 Hexadecimal 1DF7040027g1g4 Decimal 292474039g1g4[Default] 0.0.0.0[Description] ThiscommandsetsthedefaultgatewayIPaddress,whereg1..g4aretheIPaddressoctets.[Notes] Valid only when ethernet or wi-fi interface is being used.[Example] Ifyouwanttosetthegatewayaddressto192.168.1.2thecommandmustbesentas1DF704 0027C0A80102

    GS F9h D m n

    [Function] Activate buzzer on cut[Format] ASCII GSF9hDmn Hexadecimal 1DF944mn Decimal 2924968mn[Range] 0m2 0n255[Default] m=0 n=200[Description] Thiscommandtellstheprintertoactivethebuzzeratthesametimeofacutisbeing performed. Thebuzzertobeactivatedisdefinedbymasfollow:

    m buzzer

    0 none (deactivate previous settings)

    1 internal

    2 external

    (n100ms)definestheactivationtime

  • 16

    MP-4200 TH Programmers Manual - Revision 1.0

    GS F9h E n

    [Function] SetDHCPusage[Format] ASCII GSF9hEn Hexadecimal 1DF945n Decimal 2924969n[Range] 0n255[Default] n=0[Description] ThiscommandenablesordisablestheDHCPclientoftheprinter. WhentheLSBofnis0,theDHCPclientisdisabled. WhentheLSBofnis1,theDHCPclientisenabled.

    [Notes] Valid only when ethernet or wi-fi interface is being used.

    GS F9h S m ip1..ip4 n c1..cn

    [Function] Set SNMP settings[Format] ASCII GSF9hSmip1..ip4nc1..cn Hexadecimal 1DF953mip1..ip4nc1..cn Decimal 2924983mip1..ip4nc1..cn[Range] 0n64[Default] m=0 n=0[Description] ThiscommandsetsSNMPtrapparameters. Whenm=0,SNMPtrapsaredisabled. Whenm0,SNMPtrapsareenabled. ndefinestheSNMPcommunityandislimitedto64bytes. c1..cndefinethecommunityname.[Notes] Valid only when ethernet or wi-fi interface is being used.

    GS F9h W a s c m n e1..em p1..pn

    [Function] Set Wi-Fi settings[Format] ASCII GSF9hWascmne1..emp1..pn Hexadecimal 1DF957ascmne1..emp1..pn Decimal 2924987ascmne1..emp1..pn[Range] a=0,1

    s=0,1,2,3,40c130m320n63[Default] a=0s=0c=0m=0n=0

    [Description] ThiscommandsetsWi-Ficommunicationsettings.adefinestheaccessmodeasfollow:

    a Access mode

    0 Access Point

    1 Ad-hoc

  • 17

    MP-4200 TH Programmers Manual - Revision 1.0

    sdefinesthesecuritymodeasfollow:

    s Security mode

    0 No security

    1 WEP64-bit

    2 WEP128-bit

    3 WPA-TKIPpersonal

    4 WPA2-AESpersonal

    cdefinesthechanneltouse.Usec=0whena=0.mdefinesthesizeoftheESSID.ndefinesthesizeofthepassphrase.e1..emdefinetheESSID.p1..pndefinethepassphrase.

    [Notes] Valid only when wi-fi interface is being used.

    ESC C n

    [Function] Set page size in lines.[Format] ASCII ESCCn Hexadecimal 1B43n Decimal 2767n[Range] 0