MtP Series Programmer’s Manual Printek, Inc. 1517 Townline Road Benton Harbor, MI 49022 269-925-3200 www.printek.
Manual Revision Notes: Released as Part Number 5886 in October, 2004 • Original release for the MtP400 Series printers. • Based on MtP Series firmware version 1.7. Released as Part Number 6035 in March, 2005 • Added support for the MtP300 Series printers. • Based on MtP Series firmware version 2.0. Acknowledgements Printek is a registered trademark of Printek, Inc. Bluetooth is registered trademark of Bluetooth SIG, Inc. O’Neil is a trademark of O’Neil Product Development, Inc.
TABLE OF CONTENTS Acknowledgements...............................................................................................................................................ii Introduction ..........................................................................................................................................................1 Printer Models and Key Features ....................................................................................................................
Introduction This manual is intended to be used by software developers for the purpose of creating and/or modifying applications to make use of the special features offered by the Printek MtP Series of mobile thermal printers. This section of the manual describes the various models of printers and the features supported by this manual and the information contained in other sections.
Introduction O’Neil Emulation provides a summary of the commands that are supported when emulating an O’Neil microFlash4t printer. ZPL-II Emulation provides a summary of the commands that are supported when emulating a Zebra ZPL-II compatible printer. CPCL Emulation provides a summary of the commands that are supported when emulating a Comtec CPCL compatible printer. Hex Dump describes the printer’s output while in Hex Dump mode, and how it may be used to debug software problems.
Selecting Emulations The emulations offered by Printer Mobile Thermal Printers allow for a great deal of language commonality between the various series of Printek printers as well as compatibility with systems and software that have been created for printers offered by other manufacturers. The Printek MtP Series printers offer Printek, O’Neil, ZPL-II and CPCL emulations plus a Printek Mt3 emulation to allow the printers to work with existing three inch applications.
Printek Emulation Introduction This section describes the control codes and escape sequences comprising Printek emulation. This emulation may be selected by setting “Emulation” to “Printek” in the appropriate interface setup menu, or via software with the ESC ESC 1 sequence. While this emulation is selected, control codes and escape sequences from other emulations are not available. Control codes and escape sequences are used to control printer operation.
Printek Emulation Control Codes and Escape Sequences Grouped by Function Communications This section describes various methods of controlling the flow of data to and from the printer. Unlike other sections describing printer commands, the descriptions in this section indicate whether the command is one that is “received” by the printer, or “transmitted” by the printer.
Printek Emulation Transmitter Off (Transmitted by Printer, Serial Only) XOFF (DC3) When enabled for the Serial Interface (refer to the Operator’s Manual), this character is transmitted by the printer to indicate that the printer’s input buffer is nearly full and that the host computer should stop sending data. When the printer is able to accept data again, it will transmit DC1/XON.
Printek Emulation Set Printer to 22.6 cpi SI Sets the character size to 22.6 cpi. This is equivalent to sending ESC k 4. This command must be sent prior to any printable characters on the line. If sent after printable characters are received, a Carriage Return and Line Feed will be inserted and a new line started before the command takes effect. Control Code: Hexadecimal: SI 0F Set Printer to 22. 6 cpi DC4 Sets the character size to 22.6 cpi. This is equivalent to sending ESC k 4.
Printek Emulation Character Attributes Select Emphasized Mode ESC U n Selects emphasized printing mode. Emphasized mode may be used to highlight text by giving it a more bold appearance. n 0 1 Selection Emphasized Mode Off Emphasized Mode On This command must be sent prior to any printable characters on the line. If sent after printable characters are received, a Carriage Return and Line Feed will be inserted and a new line started before the command takes effect.
Printek Emulation Horizontal Position Carriage Return CR Causes the current line to be printed and the paper to advance to the next line. The current print position is set to the beginning of the next line. Note that either a Carriage Return (CR) or a Line Feed (LF) will cause both functions to be performed. However, a Carriage Return and Line Feed “pair” (CRLF) will only perform a single line feed. Control code: Hexadecimal: CR 0D Backspace BS Removes the previous character from the print buffer.
Printek Emulation Note that either a Carriage Return (CR) or a Line Feed (LF) will cause both functions to be performed. However, a Carriage Return and Line Feed “pair” (CRLF) will only perform a single line feed. Control code: Hexadecimal: LF 0A Variable Size Line Feed ESC J n Causes paper to be moved forward n x 0.125mm. 0 ≤ n ≤ 255. A Carriage Return is also performed which places the current print position at the beginning of the next line.
Printek Emulation Bar Codes The MtP Series printers will automatically print several types barcode symbols using the following command. The specification for each bar code type is also described. Print Bar Code ESC a t n h data Printek printers support several bar code symbologies including Code 39, Code 128, UCC/EAN-128, Interleaved 2 of 5, UPC/EAC/JAN, and Codabar. The following table describes the Bar Code command. Details for each specific bar code type, including examples, are found below.
Printek Emulation Code 128 Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone. Character set: 256 ASCII via three Code Sets and an “Extend” function. Elements per symbol: 6 (3 bars, 3 spaces) Character density: 9.1 CPI Bar width: 0.25mm The first character position in the data portion of the escape sequence must contain a “Start Character”, as defined below.
Printek Emulation Example 2: The following escape sequence will print a bar code using numeric pairs of numeric characters containing “123456” that is 10mm high without human readable text. Escape Sequence: ESC z Hexadecimal: 1b 7A 2 32 7 07 80 Start C 1 50 89 31 2 32 3 33 4 34 5 35 6 36 Example 3: The following escape sequence will print the same data as in Example 1, “ABC123”, using Code Sets that allow a mixture of alphanumeric character and numeric pairs.
Printek Emulation Elements per symbol: 4 (2 bars, 2 spaces) Character density: 14.5 CPI Bar width: 0.25mm Characters Note: When specifying the bar code height that h represents the total height including a 1.25mm drop bar pattern printed after the barcode pattern. Example 1: The following escape sequence will print a UPC-A bar code containing “12345678901” that is 30mm high followed by human readable text. Note that a check digit “9” is also sent, but will be ignored and recalculated by the printer.
Printek Emulation Example: The following escape sequence will print a bar code containing “123456” that is 10mm high followed by human readable text. Escape Sequence: ESC Z Hexadecimal: 1B 5A 3 33 6 06 80 50 1 31 2 32 3 33 4 34 5 35 6 36 Codabar Specifications Description: Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone. Character set: 0-9, $, -, :, /, ., + and the start/stop pairs of A/T, B/N, C/*, and D/E.
Printek Emulation Variable h w data Value 1 ≤ h ≤ 255 MtP300: 0 ≤ w ≤ 72 MtP400: 0 ≤ w ≤ 104 A line of graphic data bytes where the value of each byte is 0-255 Description Number of graphic lines in the data to follow. Number of bytes per graphic line in the data to follow. Each byte contains 8 bits. h x w bytes per line are required. Example 1: The following escape sequence will print a horizontal line 2mm long starting 2mm from the left margin.
Printek Emulation 0-255 Multiple “sets” of counters and data may be sent to the printer as necessary to describe the graphic pattern to be printed. The values specified by the counter(s) are interpreted as follows. The counter may be considered as either a signed 7 bit value or an unsigned 8 bit value. For signed 7 bit values: 0 ≤ c ≤ 127 -128 ≤ c ≤ –1 For unsigned 8 bit values: 0 ≤ c ≤ 127 128 ≤ c ≤ 255 Process the next (c + 1) bytes as simple 8 bit graphic patterns. Repeat the next byte (-c + 1) times.
Printek Emulation Load Graphic Image ESC L G n This command indicates that graphic commands describing an image to be stored is to follow. The value of n is used to identify this particular graphic image and may be any printable ASCII character (21 ≤ n ≤ 7E). This same value is then used to print the graphic The graphic data is sent using Graphic commands as described on page 16. The image may consist of up to 2,436 graphic lines.
Printek Emulation Black Mark Requirements The position described below is designed to be used when seeking a Black Mark at the beginning of a print job. This position and will require little or no reverse paper motion resulting in the fastest throughput and best printing alignment, and reduces the potential for paper jams. However, the vertical position of the Black Mark is entirely dependant on the application program that is controlling the printer.
Printek Emulation Tear edge. Black Mark should span width of paper for best results. 0.9” 0.15” Front (thermal printed) side of form. Optimum Black Mark Position Black Mark Sensing Commands Set Paper Out Sensitivity ESC Q Q n This command sets the number of 0.125mm dot rows of paper motion that can occur after the paper out sensor detects the lack of paper before a paper out condition is displayed and the printer stops printing.
Printek Emulation Command sent to printer: Escape Sequence: ESC Hexadecimal: 1B Q 51 F 46 200 C8 Q 51 ? 3F ? 3F Response from printer: Escape Sequence: ESC Hexadecimal: 1B ; 3B 7 37 Note that the values for n1 n2, or in this example “;” “7” in the response from the printer, represent the upper and lower nibbles, respectively, of the number of dot rows the paper was moved before detecting the beginning of the black mark.
Printek Emulation Printer Controls Bell BEL Causes the printer's bell to sound. Control code: Hexadecimal: BEL 07 CANCEL CAN Deletes all data in the printer’s input buffer and resets the printer to power up default values. Refer to “Printer Reset Conditions” on page 49 for more information. Control Code: Hexadecimal: CAN 18 Reset ESC c Deletes all data in the printer’s input buffer and resets the printer to power up default values.
Printek Emulation Buffer Mode ESC P # ESC P $ Buffer Mode may be used to force the printer to “hold” data until the entire print job is received. If Buffer Mode has been enabled, the printer continues to hold data in its input buffer until an EOT character (Hexadecimal 04) has been received. Once the EOT is received, the printer will print the data in the input buffer up to the EOT character. When Buffer Mode is not enabled (default) data are printed as received.
Printek Emulation Query Printer Status STX SYN Each of these commands returns character strings which provide information regarding the current print buffer status and the magnetic card reader status. Additionally, SYN will return the current battery voltage. Each status is returned as an escape sequence and four ASCII hexadecimal digits followed by a Carriage Return and Line Feed. The hexadecimal digits are nibbles that have been “OR’ed” with 0x30.
Printek Emulation Example: The following control code will return the status of the print buffer, the magnetic card reader, and the battery voltage. Control Code: Hexadecimal: SYN 16 The three sample status strings that would be returned in response to this command are as follows. Print Buffer Status: ESC Hexadecimal: 1B B 42 0 30 0 30 4 34 2 32 CR 0D LF 0A 1,344 bytes in input buffer.
Printek Emulation Example: This escape sequence requests the printer’s model and revision level. Escape Sequence: Hexadecimal: 1B ESC 50 P 29 ) A sample string returned in response to this command is shown below and indicates that the printer is a model is an MtP400 SL with a Magnetic Card Reader, and is at hardware revision level “A”.
Printek Emulation in either direction. If the read is successful, the MCR indicator will stay lit momentarily (not flashing) and the printer will transmit the data read and/or the status of the requested read operation. If a swipe does not result in a successful read, the Error Indicator will also begin to flash and an error message as described below will be transmitted. The card may be swiped multiple times until a successful read occurs or until the specified timeout expires.
Printek Emulation Control Code and Escape Sequence Summary Communications (RS-232C Serial Interface Only) End of Text ETX Acknowledge (Transmitted by Printer) ACK Printer Idle (Transmitted by Printer) EOT Transmitter On (Transmitted by Printer) XON (DC1) Transmitter Off (Transmitted by Printer) XOFF (DC3) Character Size and Line Spacing Select Character Pitch Set Printer to 12.7 cpi Set Printer to 22.6 cpi Set Printer to 22.
Printek Emulation Black Mark Sensing Set Paper Out Sensitivity Forward Seek Black Mark Reverse Seek Black Mark ESC Q Q n ESC Q F n ESC Q B n Printer Controls Sound Bell Cancel Reset Printer Print Contrast Enable Buffer Mode Disable Buffer Mode Print Buffer Contents (Buffer Mode) Select Format Select Emulation BEL CAN ESC c ESC P n ESC P # ESC P $ EOT ESC l n ESC ESC n Printer Status Commands Print Battery Status Query Print Buffer & MCR Status Query Print Buffer, MCR, & Battery Voltage Status Query Prin
Mt3 Emulation Selecting Mt3 Emulation allows applications written for the Printek Mt3 series printers to operate properly. When using this emulation in an MtP400, the printer matches the print width of the Printek Mt3 by only allowing printing to occur on the leftmost 2.83 inches (576 dots) of the print line. For information on selecting emulations using Escape Sequences, please refer to “Selecting Emulations” on page 3.
Mt3 Emulation Bar Codes Print Bar Code Print Bar Code With Human Readable Text ESC z t n h data ESC Z t n h data Graphics 8-Bit Graphics 8 Bit Compressed Graphics ESC V n1 n2 data ESC v h w c data [c data] [c data] … Storing and Printing Graphic Logos Enter Flash Logo Mode Load Graphic Logo Store Graphic Logo Print Graphic Logo ESC D L ESC L G 0 ESC L G DEL ESC L g 0 Black Mark Sensing Set Paper Out Sensitivity Forward Seek Black Mark Reverse Seek Black Mark ESC Q Q n ESC Q F n ESC Q B n Printer Con
O’Neil Emulation O’Neil Emulation allows the Printek MtP Series printers to respond to commands designed to operate an O’Neil microFlash printer. The commands that are supported are listed below.
O’Neil Emulation Easy Print Mode Move Paper Forward Move Paper Backward Select Line Printer Mode Print Test Page Save Graphic {AHEAD:n} {BACK:n} {LP} {TP} {SAVE:n} This command has been added to provide a mechanism for storing graphic images. The image defined in the PRINT command that immediately follows will be stored as a graphic named “n”, where n is a string of up to five characters in length.
O’Neil Emulation Font Mapping Line Printer Mode Easy Print Mode 0x20 MF102 0x21 MF204 0x22 MF072 0x23 MF055 0x24 MF185 0x25 MF226 0x26 MF107 * * * All other font specifications. Font Used 10.2 cpi Sans Serif A 20.3 cpi Courier 10.2 cpi Sans Serif A 5.5 cpi Sans Serif A 18.5 cpi Courier 22.6 cpi Courier 10.7 cpi Sans Serif A 15.
ZPL-II Emulation ZPL-II Emulation supports a subset of the Zebra ZPL-II command set and allows the Printek MtP Series printers to respond to commands designed to control a ZPL-II compatible printer. The commands that are supported are listed below.
ZPL-II Emulation Bar Code and Font Indices Bar Code Interleaved 2 of 5 Code 39 PDF417 EAN-8 UPC-E Code 128 EAN-13 Codabar (ANSI) UPC-A Index 2 3 7 8 9 C E K U Font Requested Zebra Font A Zebra Font B Zebra Font C Zebra Font D Zebra Font E Zebra Font F Zebra Font G Index A B C D E F G 38 Font Used 25.4 cpi Courier 22.6 cpi Courier 18.5 cpi Courier 18.5 cpi Courier 10.2 cpi Sans Serif A 5.5 cpi Sans Serif A 10.
CPCL Emulation CPCL Emulation supports a subset of the Comtec CPCL command set and allows the Printek MtP Series printers to respond to commands designed to control a CPCL compatible printer. The commands that are supported are listed below. Note: This emulation is only available in units with firmware version 2.0 or later.
CPCL Emulation Utility Commands Set Line Printer Font Set Line Feed Height Set Horizontal Position Set Horizontal and Vertical Position Set Vertical Position Move Horiz.
Hex Dump Mode Hex Dump provides a way to print, in a readable form, all the data received by the printer. This tool is useful to programmers for debugging programs when sending control codes and escape sequences to the printer. Hex Dump mode may also be used to detect what commands are being sent by a particular software application to help determine which emulation mode is needed for that application.
Print & Font Samples These print samples were produced on an MtP400.
Print & Font Samples Courier Font With International Extended Character Set Courier Font PC Line Drawing Extended Character Set 44
Print & Font Samples Sans Serif Font 45
ASCII Character Tables ASCII Control Code Definitions The following table is provided as a reference to the control character descriptions as provided by the ASCII definition. Not all of these definitions are supported by the Printek MtP Series printers and some are emulation dependent. For more information consult the appropriate chapter for the emulation being used.
ASCII Character Tables Decimal to Hexadecimal TO ASCII Conversion Table Dec 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 48 Hex 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F ASCII NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT F
Printer Reset Conditions The following list describes what conditions are assumed whenever the printer is powered on, the Setup Menus are exited, or a reset escape sequence is received when the printer is operating in an emulation mode which supports such a sequence. This list includes all variables which may be modified by the user for all emulations even though some emulations cannot modify all the variables shown. Refer to the appropriate section for the emulation being used.
Glossary 802.11 Wireless networking communication standards created by IEEE. access point An interface between a wireless network and a wired network. Ad-Hoc A Wi-Fi network consisting of only stations (no access point). Same as Peerto-Peer. ASCII American Standard Code for Information Interchange. authentication The process a Wi-Fi station uses to identify itself to another station. bandwidth The amount of data that be transferred in a given period of time.
Glossary IP Internet Protocol. A specification for packets, or datagrams, of data and an addressing method to allow the exchange of data with another system. Must be combined with another protocol such as TCP to create a complete connection with the other system. LAN Local Area Network. LCD Liquid crystal display. LED Light emitting diode. line pitch The vertical spacing of rows of characters. Measured in lpi. lpi Lines per inch.