7A300007 Rev.
Copyrights Datamax-O’Neil is a registered trademark of Datamax-O’Neil Bluetooth is registered trademark of Bluetooth SIG, Inc. Wi-Fi is a registered trademark of the Wi-Fi Alliance Windows is a registered trademark of Microsoft Corporation Zebra and Comtec are registered trademarks of Zebra Technologies All other trademarks are the property of their respective owners. Specifications subject to change without notice. Copyright © 2013, Datamax-O’Neil. All rights reserved. www.datamax-oneil.
Document Revision History Document Title: APEX and ANDES Series Printer Command Language Developer’s Manual Revision Date Revision History Revisions Since Last Issue 7/25/2008 Revision 1 Original Release 01/08/2013 Revision 2 Added QR Code and GS1 DataBar Barcode Symbologies
CONTENTS Introduction..............................................................................................................................1 Datamax-O’Neil Printer Command Language (ExPCL).....................................................1 Communications ......................................................................................................................2 Character Sets ...............................................................................................................
Download – Logo....................................................................................................................43 Download – Fonts...................................................................................................................44 Important Font Downloading Notes: ...................................................................................47 Bluetooth™ & WiFi Setup Command .................................................................................
Introduction This manual is intended to be used by software developers and system integrators with the purpose of developing applications that can print output results using Datamax-O’Neil wide range of mobile thermal printers. This section of the manual describes the various printer models, their main technical specifications and the communication interfaces available for each model. For specific information about the operation of each printer refer to the User’s Guide.
Parenthesis is not part of the command unless specified otherwise: For example Esc K n CR Escape Sequence: Hexadecimal: Decimal: ESC K 1B 4B 27 75 1 31 49 CR 0D 13 Note that CR means Carriage Return control character. The following pages describe Datamax-O’Neil Command Language (ExPCL) components in more details. The commands have been grouped based on major functions. Communications This section describes various methods of controlling the flow of data to and from the printer.
Character Sets Select Character Set Esc F n This command will select the character set that will be used when printing extended characters (Hexadecimal: 80 to FF; Decimal: 128 to 255). n 1 2 A Character Set International Character Set PC Line Drawing Character Set 16 bit font (Asian tables) Example1: The following escape sequence will select the International character set.
This command (ESC K n CR) must be sent prior to any printable characters on the line in order to take effect.
Character Size and Line Spacing – Width and Height Double Wide ON SO This command sets any printed characters to double wide. Control Code: Hexadecimal: Decimal: SO 0E 14 Double Wide OFF SI This command disables the double wide feature. Control Code: Hexadecimal: Decimal: SI 0F 15 Double High ON FS This command enables double high printing. The characters printed after this control character will be printed as double height and also the interline spacing is doubled in height.
Character Attributes Emphasized Printing Mode ESC U n The Emphasized printing mode command will cause the printer to print text with bold appearance. n 0 1 Selection Emphasized Mode Off Emphasized Mode On Note that on power up the printer defaults to emphasized mode off. Example1: The following escape sequence will enable the Emphasized printing mode. Escape Sequence: Hexadecimal: Decimal: ESC U 1B 55 27 85 1 31 49 All characters following this command will be emphasized.
Reverse Print ESC U n The reverse print command enables the user to print white letters on a black background .Reverse printing begins with the characters following the command. n R n Selection Reverse printing ON Reverse printing OFF Note that on power up the printer defaults to reverse printing off. Example1: The following escape sequence will enable the reverse printing mode.
Horizontal Position Carriage Return CR This command prints the input buffer information and advances the paper to the next line. If the printer buffer is empty a line is advanced. Control Code: Hexadecimal: Decimal CR 0D 13 Backspace BS This command removes the previous character from the print buffer.
Vertical Position Line Feed LF This command prints the input buffer information and advances the paper to the next line. Total Feed Length = Vertical size of the current font + Text Line Spacing A Carriage Return (CR) is also performed to place the current print position at the beginning of the next line. Control Code: Hexadecimal: Decimal : LF 0A 10 Variable Size Line Feed ESC J n This command moves the paper forward as per the distance specified by the parameter n x 0.125mm. 0 ≤ n ≤ 255.
Set Vertical Tab Height ESC T V n This command sets the vertical tab length in dot lines. 0 ≤ n ≤ 255. The default value of the vertical tab is 203 dot lines. Example: The following escape sequence sets the vertical tab to ten millimeters. Each dot is 0.125mm so to fixed the vertical distance of 10mm, the n parameter is 80 (10 / 0.125).
z bar code is non-human readable t barcode type. n number of character bytes in data array. 1 ≤ n ≤ 255 h height of bar code printed in increments of 0.125mm data n characters to be encoded in the barcode. *The parameters for the PDF417 barcode differ from the Linear Barcodes. See PDF-417 specifications for more detail. Note that all barcodes are printed with the minimum bar width (“x-dimension”) of 0.250mm, in compliance with the respective official specification.
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 Support for full 256 ASCII set among three subsets Elements per symbol 6 (3 bars, 3 spaces) Character density 9.1 CPI Bar width 0.
Example 1: The following escape sequence prints alphanumeric bar code "A2a", 12.5mm high, with human readable text: n = 3 printed characters + 1 start character = 4 L = 12.5mm / 0.
Interleaved 2 of 5 Specifications Description Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with Stop Symbol and Trailing Quiet Zone numeric pairs Character set Elements per symbol 10 (5 bars, 5 spaces) Character density 1.
Example 2: The following escape sequence will print a UPC-E bar code with the following: human readable, 30 mm high, containing “1234565” where 5 is the check digit. Escape Sequence: Hexadecimal: Decimal: ESC Z 1B 5A 27 90 4 34 52 7 240 1 07 F0 31 7 240 49 2 32 50 3 33 51 4 34 52 5 35 53 6 36 54 CR 0D 13 LF 0A 10 Example 3: The following escape sequence will print an EAN/JAN-8 bar code with the following: human readable, 30 mm high, containing “12345670” where 0 is the check digit.
GS1 DataBar Specifications Description GS1 DataBar symbols can carry more information and identify small items than the current EAN/UPC bar code. GS1 DataBar enables GTIN identification for hard-to-mark products like fresh foods, jewelry and do-it-yourself hardware products and can carry GS1 Application Identifiers such as serial numbers, lot numbers, and expiration dates. Character set numeric, alphanumeric, byte / binary, Kanji QR Code Models Model 1 is the original specification.
6) 1(SOH)-12(FF) - pixels per X 7) 0(NULL)-3(ETX) - X pixels to undercut 8) 0(NULL)-3(ETX) - Y pixels to undercut 9) 1(SOH)-12(FF) * 2 - separator row height 10) 2(STX)-22(SYN) - maximum segments per row (22 default). Note this entry is only applicable for RSS Expanded symbology 11) Data string Example: The following escape commands encode the data “1234567890123” in RSS14 Linear type.
27 90 54 3 13 1 0 0 1 22 49 50 51 52 53 54 55 56 57 48 49 50 51 Expected Result (not to scale): Example: The following escape commands encode the data “1234567890123” in RSS14 Stacked Omnidirectional Linear type.
Expected Result (not to scale): Example: The following escape commands encode the data “12345678901” in UPC-A type.
Decimal: 27 90 54 9 12 1 0 0 1 22 49 50 51 52 53 54 55 56 57 48 49 50 Expected Result (not to scale): Example: The following escape commands encode the data “1234567” in EAN-8 type.
Decimal: 27 90 54 12 12 1 0 0 1 22 49 50 51 52 53 54 55 56 57 48 49 50 Expected Result (not to scale): QR CODE Specifications Description The code consists of black modules (square dots) arranged in a square pattern on a white background. The information encoded may be made up of four standardized types ("modes") of data (numeric, alphanumeric, byte / binary, Kanji), or through supported extensions, virtually any type of data.
'M' --- MANUAL If you specify AUTO you do not need to specify the character mode. If you specify MANUAL you will need to specify the character mode. 7) 0x00(NULL)-0xFF - MSB for a message length parameter 8) 0x00(NULL)-0xFF - LSB for a message length parameter Total Message Length = (MSB * 256) + LSB 9) '0'(0x30) - '4'(0x34) - Pixel multiplier. '2' - (default) Multiplication factor = 2^provided value.
Compaction Mode Description Encoding Capability ‘0’ (Future Use) Byte Compaction Mode (BC) All characters, (0-255) ‘1’ (Recommended) Text Compaction Mode (TC) ASCII only, (0-127) + Shift to BC Mode is implemented. ‘2’ (Future Use) Numeric Compaction Mode (NC) Digits Only, (‘0’-‘9’) A’ (Future Use) AUTO (combinations of all modes) Mix of three compaction modes SL: Security Level byte. This can be any digit from ‘0’ to ‘8’.
Example: The following escape commands encode the data “12345678”.
The following 8-bit graphic command is used to print a single line of graphic Escape Sequence: Hexadecimal: Decimal: ESC 1B 27 V SOH NUL 72 bytes of data 56 86 72 bytes of data 72 bytes of data 01 1 00 0 8 Bit Compressed Graphics ESC v height width counter data [c data] [c data] … This command differs from the 8 Bit Graphics command described above by reducing the number of bits (bytes) that have to be sent to the printer.
This data may be represented in hexadecimal: 0x55 0x55 0x00 0x00 0xAA 0x11 0x55 0x00 0x55 0x55 0x55 0x55 The RLE compressed graphics command: DEC HEX width counter data… ESC ‘v’ height 27 118 2 6 255 85 0x02 0x06 0xFF 0x55 0x1B 0x76 255 0 3 170 17 85 0 253 0xFF 0x00 0x03 0xAA 0x11 0x55 0x00 0xFD 85 0x55 Printer Controls – Data Processing The printer can be operated in two modes, Online and Buffer mode. In online mode, the characters are printed as they are received.
Print Buffer Contents (Buffer Mode) EOT This command allows the printer to process all of the commands stored in the printer buffer. This command is valid only when the printer is in the buffer mode. Control Code: Hexadecimal: Decimal EOT 04 04 Enable EOT Control Character Transmission (Currently Not Available) ESC P + When enabled, the printer transmits the EOT command character when the print buffer is empty.
Printer Controls - Reset Cancel CAN This command deletes the entire printer buffer and resets the printer to the power-up default values. Control Code: Hexadecimal: Decimal: CAN 18 24 Reset printer and load default setup ESC @ This command initializes all programmable attributes to factory default values. Custom programming, present in flash memory, will be restored as well, overriding the factory defaults.
Example 1: The command Esc M 0 0 0 CR Disables the power out timer Example 2: The command Esc M 9 9 0 CR Sets the timer to 99 seconds Note that spaces are not part of the command Extended Auto Power Down Command ESC M HH MM SS 0 CR The ‘Set Auto Power Down’ command allows the user to program the printer to automatically shut down after a certain length of inactivity. This command accepts the following formats: (1) seconds, (2) minutes and seconds, or (3) hours, minutes and seconds.
Printer Status Commands Query Print Buffer & Timer-MCR Status STX This command will cause the printer to print the battery status Print Buffer Status Timer-MCR Status Printer Response ESC B <4 ASCII digits> CR LF ESC M <4 ASCII digits> CR LF Note that the first three digits of the Timer-MCR field correspond to the printer times. The last byte indicates that the MRC track is currently activated in the printer.
Query Printer Model and Hardware Revision Level ESC P ) This command will cause the printer to send the hardware model to the host. Escape Sequence: Hexadecimal: Decimal: ESC P 1B 50 27 80 ) 29 41 After sending the previous command, the printer will respond with the ASCII sequence: ASCII Sequence: CR LF The field represents the hardware model. Magnetic Card Reader A three track Magnetic Card Reader is an option available on the Datamax-O’Neil printers.
Example: The following escape sequence sets the timer to 99 seconds and activates the MRC to read the track #1. Escape Sequence: Hexadecimal: Decimal: ESC M 1B 4D 27 77 9 39 57 9 39 57 1 31 49 CR 0C 13 ESC m 9 1B 6D 39 27 109 57 9 39 57 1 31 49 CR 0C 13 or Escape Sequence: Hexadecimal: Decimal: Magnetic Card Data Output Format The track data retrieved from a magnetic card is transmitted to the host in ISO7811 ASCII format as summarized in the table below.
Cancel Magnetic Card Data Read Command ESC C This command cancels the MCR read process. The printer returns to online operation mode. Escape Sequence: Hexadecimal: Decimal: ESC C 1B 43 27 67 Note that after executing this command the printer will send the message “, 09, Cancel Request” to the host. Black Mark Sensing Control Commands Set Paper-Out Sensitivity ESC Q Q n CR This command sets the paper-out sensor sensitivity level. 0 ≤ n ≤ 255. This command sets the number of 0.
Black Mark Sensing Command Mode Forward Seek Black Mark ESC Q F n CR This command sets the printer to black mark seek mode using a forward feed operation. The value of forward feed is determined by the user in dot lines (n) where 0 ≤ n ≤ 255 dots. Each dot line corresponds to 0.250mm. If the black mark is found, the printer responds with the command “Black Mark Found”, otherwise the printer responds with the command “Black Mark not Found”. Both escape sequence responses are described below.
Enable Back Black Mark Sensor ESC Q b e CR This command will cause the printer to enable the back black mark sensor and automatically disables the front side sensor. Escape Sequence: Hexadecimal: Decimal: ESC Q 1B 51 27 81 b e CR 62 65 0D 98 101 13 Disable Back Black Mark Sensor ESC Q b d CR This command will disable the printer’s back black mark sensor.
Printed Receipt/Label Presenter Negative Adjust (*) ESC Q D – n This command will cause the printer to move the paper backwards to a distance specified by n dots after a form or label has been printed. Example: The following escape sequence will move the paper backwards 112 dots Escape Sequence: Hexadecimal: Decimal: ESC Q 1B 51 27 81 D 44 68 - 112 2D 70 45 112 Note: In Auto Q-Mark Mode Form Feed length is limited to the following range: 609 – 3654 print dots. Default value is set to 1218 dots.
Mark Beginning of a Page BeginPage(); This command follows Esc P P command and is used to indicate the beginning of a form in page printing mode. Define the Page Size SetPageSize (width, height); This command is used to define the valid drawing area for a label or form. Two parameters are required: width and height of the form, measured in dots. Set Margins SetMargin (lm, tm); This command sets the left margin to lm and the top margin to tm.
Command , , \n \<, \>, \”, \\ Name Bold Underline Text Height Text Width Font New Line Literals Description Text enclosed by and appear in bold. Text enclosed by and are underlined. Text height is magnified by the given numeric value. Use to return to original size. Text width is magnified by the given numeric value. Use to return to original size. Sets the font. value = {0 .. 9}.
Type Value 1 2 3 4 5 height Barcode type Code 39 Code 128 Code 2 of 5 UPC Codabar Sets the height of barcode in units of dots data Specifies the content of the barcode. It is the user’s responsibility to supply data that is appropriate for the chosen code. For example, Code 39 will not accept lower case letters.
Form FiestaTM Form Fiesta is a Form and Label Generating Software that can be used to automate the label design process. It is provided to Datamax-O’Neil partners and customers at no charge. All supported commands are implemented in Form Fiesta and are automatically generated when an element is drawn onto the canvas on the screen.
Download - Printer Default Setup Select Setup Download mode ESC D S This command puts the printer into the Download mode. The printer will response with a ’?’ character. Escape Sequence: Hexadecimal: Decimal: ESC D 1B 44 27 68 S 53 83 Start Default download process ESC S L This command alerts the printer that a file will now be downloaded. Escape Sequence: Hexadecimal: Decimal: ESC S 1B 53 27 83 L 4C 76 Stop Download Process ESC S T 0xFF CR This command stops the downloading process.
Download – Self test Message Hardware Information Select Setup Download mode ESC D S This command puts the printer into the Download mode. The printer will response with a ’?’ character. Escape Sequence: Hexadecimal: Decimal: ESC D 1B 44 27 68 S 53 83 Start Hardware Information download process ESC S I This command alerts the printer that a file will now be downloaded.
Download – Logo The Graphic Logo feature allows the storage of a formatted Bitmap file in nonvolatile memory. Up to eight memory sectors, of up to 64,000 bytes each, are reserved to store a Graphic Logo in the printer. Upon receipt of a Graphic Logo print command, the Graphic Logo data is sent to the printer. This feature allows printing of a stored graphic image as part of a receipt. Logo images must be modified and saved to a .prn file prior to logo download.
Escape Sequence: Hexadecimal: Decimal: ESC L g 1 1B 4C 67 31 27 76 103 49 Example 2: The following example replaces logo location 1 with the logo image contained in logo.prn file. The following escape commands must be sent sequentially and are necessary to complete logo download. Escape sequence 1: Escape sequence 2: ESC D ESC L L G CR LF 1 CR LF Escape sequence 3:logo.
Display Tables Information ESC D I CR Same description as the command directly above. This command is for Legacy printer’s compatibility. Escape Sequence: Hexadecimal: Decimal: ESC D 1B 44 27 68 I 49 73 CR 0D 13 Disable Font Download Mode ESC F X This command will disable the font download mode and put the printer in ready print mode.
Select Load Operating Mode ESC F M m CR This command selects the load operating mode. Possible values for parameter m are ‘0’: Standard response or ‘1’ : Response with diagnostics message (default).
Select Font Row ESC F F f CR This command selects the row value for the font tables. The parameter f can be set in the range of ‘0’ to ‘9’ Select Font Column ESC F K k CR This command selects the column value for the font tables. The parameter k can be set in the range of ‘0’ to ‘9’ Select File Type ESC F L t CR This command selects the file type to be uploaded. The parameter t has a range of values between ‘0’ to ‘9’. The default value is ‘0’ which means “BDF” format.
Example 1: BBX 08 23 0 0 BITMAP 0008 000F 0002 0003 INCORRECT Example 2: BBX 08 23 0 0 BITMAP 08 0F 02 03 CORRECT The name of the font is indicated at the beginning of the .BDF file, therefore: FONT Font12C.BDF. If only the file is renamed, the firmware will not recognize it; in this case, the .BDF file must be opened and the file name must be changed as in the format shown previously in this paragraph. The following section shows the steps required to upload a new font into the printer memory.
Bluetooth™ & WiFi Setup Command Datamax-O’Neil printers can be placed in pass-thru mode. In pass-thru mode, data communication will only occur between the two selected UARTS. This mode of operation is used to setup the Bluetooth™ or 802.11b/g interface parameters. While in this mode, printing is disabled. Select Pass-Thru Command Mode ESC P U n1 U n2 T t0 t1 t2 (CR) This command sets the printer in pass-thru mode. In most serial applications the command can be sent manually or as a file.
Emulation The printer’s default mode of operation of Datamax-O’Neil Printers is the Datamax-O’Neil Printer Command Language (ExPCL). The emulations offered by Datamax-O’Neil Printers allow compatibility with printing systems and software created for printers offered by other mobile printer’s manufacturers. The Datamax-O’Neil printers offer the following emulations: O’Neil: Line Print Mode and Easy Print Mode Zebra: CPCL Line Print Mode.
Esc C n This command is ignored by the Datamax-O’Neil printer. It is recognized but no action is taken Esc A n This command sets the number of blank dot lines that are fed between character lines. “n” is the number of interline spacing Originally n = (0x01..0x9B) in our version however n = (0x01..0x0A). CAN (^X) Esc V n1 n2 104*number of lines bytes of data Esc B/Esc E Cancels the unprinted characters on the forming line. Prints the next (n1*256 + n2) dot-lines as bit mapped graphics.
Communications Settings Dip Switch Settings The Datamax-O’Neil printers support Serial RS232, IrDA compatible infrared communication interfaces and USB*1.Bluetooth™ and Wi-Fi communication are also available as an optional feature. Serial/USB IrDA, Wi-Fi and Bluetooth™ communication settings can be changed via a DIP switch located on the control card. In the following sections each setting is discussed in more detail.
Serial Communication (RS232C) The RS232C Interface signals for the Datamax-O’Neil printers are terminated on a 6 PIN RJ type data connector located on the side of the printer. Six connections are provided from the Serial Interface to the host computer. A minimum of two connections are required for operation, RXD – pin 3 and Common – pin 1.The proper baud rate and protocol settings are required to communicate with the host device. The printer defaults to 115.
RS232C Technical Specifications Name Value Data Transfer Rate 1200 – 115200 Baud Word Length 10 or 11 bits Start Bit 1 Data Bits 8 Parity Bit None, Odd or Even Stop Bits Auto Select 1 or 2 Signal Levels RS232C Mark or Logical 1 -3 to -15 VDC Space or Logical 0 + 3 to + 15 VDC Handshaking Two modes are supported (Software and Hardware) Hardware RTS/CTS Software XON/XOFF Auto Power Up Positive Signal on RTS input switches the printer ON USB Communication (USB) Overview Apex printe
Software Driver Installation You must install the USB driver before you can use USB communication on the printer. Turn on the printer and connect it to the PC with a USB cable. If the driver has never been installed before, a dialog box will appear. Reply by selecting "Install from a list or specific location" and indicating the location of the file usbprintercdc.inf supplied with the CD. The usbprintercdc.inf file points to the actual driver called msports.
Settings Value Name APEX#, where # matches the printer model Serial Settings 115200,8,n,2,n USB Settings 57600, 8, n, 2, n Discoverability mode Generally Discoverable Connectivity mode GAP Connectable Security mode Security Disabled Fixed PIN 0 (Zero) Set Master/Slave Policy Always let the connecting device select the master/slave role on incoming connections Client Profile Disable Client Services Server Profile Serial Port Profile Server enabled Wireless Multi-drop mode disabled, for
Wi-Fi Communication (Option) The printer control card communicates with the Wi-Fi interface at 115.2 K Baud/sec for serial interface printers and 57.6 K for USB interface printers. To select the WiFi interface, Dip Switch # 1 or Dip Switch # 2 (See Dip Switch Settings table above) must be ON and all other Dip Switches must be OFF. Below are the factory default settings of the Wi-Fi module. For more information please refer to the 802.11g kit available on the Developer’s CD.
Error/ Warning LED Panel LED # LED Color/ Status Description Action Required LED # 1 Communication RED/ Steady Low power indication: Charge battery (#1) GREEN/ Flashing (#3) RED/ Flashing Printer is in RS232 or USB mode and Printer Buffer is not empty. LED # 1 & LED # 3 LED # 3 Magnetic Card Reader & Printer Error (#1) BLUE-GREEN Flashing* (#3) RED/ Flashing Printer is in Bluetooth mode and Printer Buffer is not empty. Press Feed to clear error.
Appendix A: Flash Font Tables The tables below show the Font Table organization in the Datamax-O’Neil Printers. There are two classes of font tables: Replaceable and Factory Fonts. Please note each font table represents either the first or the second half of a font, not the complete 255 character set. Replaceable Fonts Tables The fonts in Red correspond to the replaceable fonts that can be modified via the font downloading commands. Replaceable Fonts k-0 F0 F1 F2 Courier Mode 0(Rotated) I 0x20..
Courier International Font Table Courier PC Line Graphic Table 60
Monospace Font Table Rotated Font Table 61