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.
Wi-Fi Communication (Option)...........................................................................................57
Printer Status Indicator LED Panel.....................................................................................57
Appendix A: Flash Font Tables............................................................................................59
ii
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.
Printer Models and Supported Features
The Datamax-O’Neil series of thermal printers offer a wide variety of solutions for printing applications. Communication
interfaces and supporting flexible paper widths are shown in the table below. For additional information, please refer to the
printer’s User Guide.
Model
APEX2
APEX3
ANDES3
APEX4
Max Paper
Width
2.28”/58m
m
3.15”/80m
m
3.15”/80m
m
4.35”/110.6
mm
Max. Print
Width
1.89”/48mm 384
2.83”/72mm 576
2.83”/72mm 576
4.09”/104m
m
Max Print
Dots
832
Sensors
Front Black
Mark
Front Black
Mark
Front & Back
Black Mark
Front Black
Mark
RS-232 USB BT IrDA WiFi MCR SCR
Std NA Std Opt Opt Opt Opt
Std NA Std Opt Opt Opt Opt
Std Std Opt* Std Opt* Opt* Opt*
Opt Std Std Opt Opt Opt Opt
Communication Interfaces
Std = Standard
NA = Not Available
Opt = Optional
Datamax-O’Neil Printer Command Language (ExPCL)
This section describes the control codes and escape sequences comprising Datamax-O’Neil Printer Command Language
(ExPCL).
Control characters defined as the set of characters encoding from 0x00 to .0x1F (ASCII values between 0 to 31)
The ExPCL defines commands that start with the ESC (Hexadecimal 1B or Decimal 27) character and then are followed for the
command and the parameters. The general structure of the commands can be defined as follows:
ESC <Command> <Param1, Param2, ....,Param n>
Where:
Character Hexadecimal 1B or Decimal 27
ESC
Command One or more ASCII characters that define a unique Datamax-O’Neil
Param1 Input parameters for the command. The commands that accept just one
Note that spaces are not part of the commands and the parameters are indicated as items typed in italics. For instance, the
command ESC k n is used to select the character size of the resident fonts in the printers. The parameter n indicates the font
type to choose with possible values between o and 9.
Printer Command Language
parameter will be defined as “n” while commands with more than one
parameter will be defined as “n1”, “n2”, etc.
1
Parenthesis is not part of the command unless specified otherwise:
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. The set of control characters
described below are used by the printer and the host while a communicating process is in place. Note that some handshaking
methods are only supported by the RS-232C Serial interface and are not supported for the USB, IrDA, Bluetooth, or Wi-Fi
interfaces.
End of Transmission EOT
The printer sends an EOT character each time the printer’s input buffer becomes empty (indicating that the printer is idle).
Control Code: EOT
Hexadecimal: 04
Decimal: 4
Note that this control character can be enabled and disabled using the command ESC P n. See detailed description of the
command in Section: “Printer Control: Data Processing”.
Transmitter On XON
When selected XON/XOFF as flow control method of serial communication, this character is transmitted by the printer to indicate
that the printer is on line and ready to receive data. After receiving this character the host computer will start sending data to the
printer.
Control Code: XON
Hexadecimal: 11
Decimal: 17
Transmitter Off XOFF
When selected XON/XOFF as flow control method of serial communication, this character is transmitted by the printer to indicate
that the printer’s buffer is nearly full and that the host computer should stop sending data. The communication process is
reestablished after the printer transmits XON character to the host.
Control Code: XOFF
Hexadecimal: 13
Decimal: 19
2
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 Character Set
1 International Character Set
2 PC Line Drawing Character Set
A 16 bit font (Asian tables)
Example1: The following escape sequence will select the International character set.
Refer toAppendices Section for complete list of characters contained in each character set.
Note that printers are set to International Character Set by default. When using the PC Line Drawing Character Set, the text line
spacing should be set to zero in order to create continuous vertical lines.
This command is used in conjunction with the command ESC k n (or Esc K n, refer to Character Size and Line Spacing).
Character Size and Line Spacing
Select Character Pitch: Mode 1 ESC K n CR
This command sets the font size based on the number of character per inch. The parameter n can have the following values:
Character Pitch/Font Character size Columns Per Line
n
APEX2 APEX3 / Andes3 APEX4
0 ~13 cpi Rotated / Courier mode 0 16 x 14 24 (rows/line) 36 (rows/line) 52 (rows/line)
1 ~12 cpi Normal / Courier mode 1 16 x 23 24 36 52
2 ~16 cpi Normal / Courier mode 2 12 x 23 32 48 69
3 ~19 cpi Normal / Courier mode 3 10 x 23 38 57 83
4 ~21 cpi Normal / Courier mode 4 09 x 23 42 64 92
5 ~24 cpi Normal / Courier mode 5 08 x 23 48 72 104
6 ~10 cpi Normal / Monospace 821BT 20 x 23 19 28 40
7 ~20 cpi Normal / Monospace 821BT 10 x 23 38 57 80
8 ~20 cpi Bold / Monospace 821BT 10 x 23 38 57 80
9 ~20 cpi Short / Monospace 821BT 10 x 18 38 57 80
10 ~4 cpi Bold 48 x 80 8 12 17
11 ~25 cpi Verin 08 x 23 48 72 104
12 ~22 cpi Verin 09 x 23 42 64 92
13 ~20 cpi Verin 10 x 23 38 57 83
14 ~16 cpi Verin 12 x 23 32 48 69
15 ~12 cpi Verin 16 x 23 24 36 52
3
This command (ESC K n CR) must be sent prior to any printable characters on the line in order to take effect.
Example 1: The following escape sequence set the pitch to 12 CPI (Courier Font):
Character Size and Line Spacing – Width and Height
Double Wide ON SO
This command sets any printed characters to double wide.
Control Code: SO
Hexadecimal: 0E
Decimal: 14
Double Wide OFF SI
This command disables the double wide feature.
Control Code: SI
Hexadecimal: 0F
Decimal: 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. This feature will be disabled using the control character GS. Refer to the
“Double High OFF” control character for more details.
Control Code: FS
Hexadecimal: 1C
Decimal: 28
Double High OFF GS
This command disables double high printing.
Control Code: GS
Hexadecimal: 1D
Decimal: 29
Set Text Line Spacing ESC a n
This command sets the line spacing between successive printed text lines (dot row). Each dot row is 0.125mm.
0 ≤ n ≤ 40 ) decimal= . If n value is greater than 0x28 or Decimal 40, then n will be set to 0x28 )Decimal 40).
Example: The following escape sequence sets the line spacing to zero (as needed when printing line drawing characters when
the PC Line Drawing character set is selected).
Escape Sequence: ESC a NUL
Hexadecimal: 1B 61 00
Decimal: 27 97 0
Example 2: The following escape sequence sets the line spacing to 40 dot lines (0x28 and Decimal 40)
Escape Sequence: ESC a (
Hexadecimal: 1B 61 28
Decimal: 27 97 40
Note 1: Printer’s default settings are set to 3-dot line after each text line.
Note 2: Line spacing must be set to zero when printing PC Line-Draw characters, the, thus allowing graphic characters on
successive lines to be connected.
5
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 Emphasized Mode Off
1
Note that on power up the printer defaults to emphasized mode off.
Example1: The following escape sequence will enable the Emphasized printing mode.
All characters following this command will be emphasized. The emphasized command is terminated either by the Esc U
0 command or by cycling the printer power.
Example 2: The following escape sequence will disable the emphasized printing mode.
Underline printing mode may be used to underline text.
n
U Underline Mode ON
u Underline Mode OFF
Note that on power up the printer defaults to underline mode off.
Example1: The following escape sequence will enable the underline printing mode.
Escape Sequence: ESC U U
Hexadecimal: 1B 55 55
Decimal: 27 85 85
All characters following this command will be underlined. The underline command is terminated either by the Esc U u
command or by cycling the printer power.
Example 2: The following escape sequence will disable the underline printing mode.
Escape Sequence: ESC U u
Hexadecimal: 1B 55 75
Decimal: 27 85 117
Selection
6
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 Reverse printing ON
n 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.
Escape Sequence: ESC U R
Hexadecimal: 1B 55 52
Decimal: 27 85 82
All characters following this command will be reverse printed. The reverse printing command is terminated either by the Esc U n
command or by cycling the printer power.
Example 2: The following escape sequence will disable the reverse printing mode.
Escape Sequence: ESC U n
Hexadecimal: 1B 55 6E
Decimal: 27 85 110
Selection
Right to Left and Left to Right Printing ESC F n
This command causes the printer to change the direction in which characters are printed. The printer direction default mode is
set to Left to Right.
n
R Right to Left
L Left to Right
Selection
Note that on power up the printer defaults to left to right printing mode.
Example1: The following escape sequence will enable the right to left printing mode.
Escape Sequence: ESC F R
Hexadecimal: 1B 46 52
Decimal: 27 70 82
All characters following this command will be printing right to left printed. The right to left printing command is
terminated either by the Esc F L command or by cycling the printer power.
Example 2: The following escape sequence will disable the left to right printing mode.
Escape Sequence: ESC F L
Hexadecimal: 1B 46 4C
Decimal: 27 70 76
7
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: CR
Hexadecimal: 0D
Decimal 13
Backspace BS
This command removes the previous character from the print buffer.
Control Code: BS
Hexadecimal: 08
Decimal: 8
Horizontal Tab HT
This command advances the cursor by the number of dots specified in the Horizontal Margins command
Control Code: HT
Hexadecimal: 09
Decimal: 9
Set Horizontal Tab Width ESC T H n
This command sets the Horizontal Tab (HT) value. The parameter n has values between 0 and 255 with a default value of 100
dots..
Example: The following escape sequence sets the horizontal tab width to 50 dots.
Escape Sequence: ESC T H 2
Hexadecimal: 1B 54 48 32
Decimal: 27 84 72 50
8
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: LF
Hexadecimal: 0A
Decimal : 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.
A Carriage Return (CR) is also performed to place the current print position at the beginning of the next line.
Example: The following escape sequence advances the paper ten millimeters. Each dot is 0.125mm so to advance the paper
10mm, the n parameter is 80 (10 / 0.125).
This command moves the paper in reverse direction as per the distance specified by the parameter n x 0.125mm. 0 ≤ n ≤ 255.
A Carriage Return (CR) is also performed to place the current print position at the beginning of the next line.
Example: The following escape sequence moves the paper in the reverse direction ten millimeters. Each dot is 0.125mm so to
reverse the paper 10mm, the n parameter is 80 (10 / 0.125).
This command advances the cursor the number of dot lines specified in the Vertical Margin command (below).
A Carriage Return (CR) is also performed to place the current print position at the beginning of the next line.
Control Code: VT
Hexadecimal: 0B
9
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).
Escape Sequence: ESC T V P
Hexadecimal: 1B 54 56 50
Decimal: 27 84 86 80
Form Feed FF
This command advances the paper by the number of lines specified in the Set Form Feed length in dot lines (below).
A Carriage Return (CR) is also performed to place the current print position at the beginning of the next line.
Control Code: FF
Hexadecimal: 0C
Decimal 12
Set Form Feed Length in Dot Lines ESC T F n1 n2
This command sets the Form Feed Length in Dot Lines. The total Form Feed distance is computed using the following formula:
(n2 * 256 + n1). 0 ≤ n1 ≤ 255. 0 ≤ n2 ≤ 255. The default value is 1030 dot lines.
Note that the height of the font in dot lines will be subtracted from the total dot lines specified in the command.
Example: For a font 23 dot lines high and with an Esc T V 200 (0xC8) command sent, the actual VT value will be 200 – 23 = 177
dots.
Bar Codes
The Datamax-O’Neil printer series print several barcode symbologies including Linear and 2D barcodes. The following
commands are used to print barcodes.
Print Bar Code ESC z t n h data CR LF
This command will print a barcode without human readable text. The following table describes the Bar Code command
structure.
Parameters:
t Barcode
1 Code 39
2 Code 128,UCC/EAN-128
3 Interleaved 2 of 5
4 UPC/EAN/JAN
5 Codabar
9 PDF417 *
10
z bar code is non-human readable
t barcode type. nnumber of character bytes in data array. 1 ≤n≤ 255
h height of bar code printed in increments of 0.125mm
datan 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.
Print Bar Code with Human Readable Text ESC Z t n h data CR LF
This command prints a barcode with Human Readable Text below the barcode. Refer to the parameters of the prior command.
Z Indicates human readable
Code 39 Specifications
Description
Character set
Elements per symbol:
Character density
Bar width
Characters per line
Example: The following command will print human readable barcode “CODE 39” of 1mm high (0.125*8= 1mm).
Escape Sequence: Esc Z 1 7 8 C O D E - 3 9 CR LF
Hexadecimal: 1B 5A 31 07 08 43 4F 44 45 2D 33 39 0D 0A
Decimal: 27 90 49 7 8 67 79 68 69 45 51 57 13 10
Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with
Stop Symbol and Trailing Quiet Zone
36 alphanumeric (0-9, A-Z) and '-' 'space' '$' '/' '+' '%'
Note: Only capital letters are supported.
9 (5 bars, 4 spaces)
6.25 CPI
0.25mm (narrow to wide ratio of 1:3).
2 Inch printer
3 Inch printer
4 Inch printer
: 9 alphanumeric with auto center (maximum)
: 12 alphanumeric with auto center (maximum)
: 22 alphanumeric with auto center (maximum)
11
Code 128 Specifications
Description
Character set
Elements per
Each symbol starts with Leading Quiet Zone, followed with Start Symbol, Data Symbols, ending with
Stop Symbol and Trailing Quiet Zone
Support for full 256 ASCII set among three subsets
6 (3 bars, 3 spaces)
symbol
Character density
Bar width
Characters per line
9.1 CPI
0.25mm
2 Inch printer
3 Inch printer
4 Inch printer
: 13 alphanumeric characters or 26 numeric only (maximum) - automatically centered
: 18 alphanumeric characters or 36 numeric only (maximum) - automatically centered
: 32 alphanumeric characters or 36 numeric only (maximum) - automatically centered
Code 128 Start Character:
<start character> = {0x87, 0x88, 0x89} determines the character set to be printed
Start Character Characters Sent to Printer Characters Read by Bar Code Reader
IF <start character> is 0x87 CODE A
IF <start character> is 0x88 CODE B 0x020 through 0x07F ASCII
IF <start character> is 0x89 CODE C
(Each number must be paired with another)
The data bytes are defined by which character set is defined. The printer accepts all characters 0x20h - 0x7Fh with the
translations defined above.
Also, characters 0x080 - 0x86 may be used as Code 128 control characters:
HEX DEC CODE A CODE B CODE C
0x080 128 FNC 3 FNC 3
0x081 129 FNC 2 FNC 2
0x082 130 SHIFT SHIFT
0x083 131 change to C change to C
0x084 132 change to B FNC 4 change to B
0x085 133 FNC 4 change to A change to A
0x086 134 FNC 1 FNC 1 FNC 1
FNC 1: Reserved CODE 128 character (used for UCC/EAN128)
FNC 2: Message append (not supported by all bar code readers)
For example: 'a' is changed from #97 to #97+128 = #225
Note that it is possible to switch code sets in the middle of the bar code. This is useful with heavily numeric alphanumeric bar
codes (see example below).
12
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.125mm = #100
start character = START B (full ASCII alpha numeric) = #136
Escape Sequence: Esc Z 2 4 d 88 A 2 a CR LF
Hexadecimal: 1B 5A 32 04 64 88 41 32 60 0D 0A
Decimal: 27 90 50 4 100 136 65 50 97 13 10
Example 2: The following escape sequence print all-numeric bar code "1234", 5mm high, non-human readable text:
The UCC/EAN-128 specification is an internationally recognized format for application identifiers in
code 128 bar codes. The bar code symbology is identical to Code 128. These identifiers are not
intended for point-of-sale applications. Only recognized bodies of the UCC or EAN may assign
application identifiers. More information may be found at:
http://www.ean.be/ for the EAN and
http://www.uc-council.org/ for the UCC
13
Interleaved 2 of 5 Specifications
Description
Character set
Elements per
symbol
Character density
Bar width
Characters per line
Example: The following escape sequence prints an Interleaved 2 of 5 barcode, encoding “12345678” with 10 mm high,
human readable.
Character set
Elements per symbol
Character density
Bar width
Characters per line
Example 1: The following escape sequence will print a UPC-A bar code with the following: human readable, 30 mm high,
containing “123456789012” where 2 is the check digit. Due to limited spacing CR LF are not shown at the end of this command.
Each symbol starts with Leading Quiet Zone, followed with Left Guard Bars, Left Data Symbols,
Center Bar Pattern, Right Data Symbols, Check Character, ending with Right Guard Bars and
Trailing Quiet Zone.
The UPC, EAN/JAN-8, EAN/JAN-13 specifications comprise an internationally recognized format for
application identifiers. Unlike the UCC/EAN-128 specification, these identifiers are intended for pointof-sale applications. Only recognized bodies of the UCC and EAN may assign application identifiers.
More information may be found at:
http://www.ean.be/ for the EAN and
http://www.uc-council.org/ for the UCC
Numeric - fixed length
4 (2 bars, 2 spaces)
14.5 CPI
0.25mm
UPC-A: 11 - plus check digit (automatically centered)
UPC-E: 6 - plus check digit (automatically centered)
EAN/JAN-8: 7 - plus check digit (automatically centered)
EAN/JAN-13: 12 - plus check digit (automatically centered)
14
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.
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.
Example 4: The following escape sequence will print an EAN/JAN-13 bar code with the following: human readable, 30 mm high,
containing “1234567890128” where 8 is the check digit. Due to limited spacing CR LF are not shown at the end of this
command.
Note that all heights are total height, including a 1.23mm drop bar pattern printed after the bar code pattern.
Codabar Specifications
Description
Character set
Elements per
symbol
Character density
Bar width
Characters per line
Example 1: The following escape command prints a Codabar barcode with the following: Encoding “123456”, human readable,
20 mm high, start character A and stop character T
Escape Sequence: ESC Z 5 8 160 A 1 2 3 4 5 6 T CR LF
Hexadecimal: 1B 5A 35 08 A0 41 31 32 33 34 35 36 54 0D 0A
Decimal: 27 90 53 8 160 65 49 50 51 52 53 54 84 13 10
Example 2: The following escape command prints Codabar barcode with the following: Encoding “2468”, human readable, 10
mm high, start character C and stop character *. .
: 15 (maximum) plus start/stop, automatically centered
: 20 (maximum) plus start/stop, automatically centered
: 35 (maximum) plus start/stop, automatically centered
15
GS1 DataBar Specifications
GS1 DataBar symbols can carry more information and identify small items than the current
Description
Character set
QR Code Models
Error Correction
Levels
Data Modes
Elements per
symbol
Max. Characters
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.
numeric, alphanumeric, byte / binary, Kanji
Model 1 is the original specification.
Model 2 is an enhanced form of the symbology.
Ultra High Reliability Level (30% of codewords can be restored)
High Reliability Level (25% of codewords can be restored)
Standard Level (15% of codewords can be restored)
High Density Level (7% of codewords can be restored)
AUTO (do not need to specify the character mode)
MANUAL (need to specify the character mode.)
Square dot/element with the following pixel multipliers: 1(none), 2, 4(default), 8, 16
7366
QR Code Command Structure:
<ESC> – ‘z’ or ‘Z’ – ‘6’ – TYPE – DATA SIZE – ELEMENT SIZE – X UNDERCUT – Y UNDERCUT – SEP ROW HEIGHT – MAX
SEG PER ROW - [User’s Data]
Parameters:
1) ESC(0x1B)
2) "Z"(0x5A) or "z"(0x7A) - Enables\disables annotation
3) "6"(0x36) - Selects GS1 DataBar barcode family
4) 1(SOH) through 12(FF) - selects symbology type, where:
Example: The following escape commands encode the data “1234567890123” in RSS14 Stacked Omnidirectional Linear type.
Due to space limitation CR LF are not shown
The code consists of black modules (square dots) arranged in a square pattern on a white
Description
Character set
QR Code Models
Error Correction
Levels
Data Modes
Elements per
symbol
Max. Characters
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.
numeric, alphanumeric, byte / binary, Kanji
Model 1 is the original specification.
Model 2 is an enhanced form of the symbology.
Ultra High Reliability Level (30% of codewords can be restored)
High Reliability Level (25% of codewords can be restored)
Standard Level (15% of codewords can be restored)
High Density Level (7% of codewords can be restored)
AUTO (do not need to specify the character mode)
MANUAL (need to specify the character mode.)
Square dot/element with the following pixel multipliers: 1(none), 2, 4(default), 8, 16
7366
QR Code Command Structure:
<ESC> – ‘z’ or ‘Z’ – ‘7’ – QR MODEL – ERROR CORRECTION – DATA MODE – MSB – LSB – PIXEL MULT - [User’s Data]
or
<ESC> – ‘z’ or ‘Z’ – ‘7’ – ‘1’ or ‘2’ – ‘H’, ‘Q’, ‘M’ or ‘L’ – ‘A’ or ‘M’ – MSB – LSB – PM - [User’s Data]
Parameters
1) ESC(0x1B)
2) 'Z'(0x5A) or 'z'(0x7A) - Enables\disables annotation
3) '7'(0x37) - Selects QR Code barcode symbology
4) '1'(0x31) or '2'(0x32) - selects model, where:
'1'(0x31) --- QR Code model 1 is the original specification while
'2'(0x32) --- QR Code model 2 is an enhanced form of the symbology (default and recommended)
5) 'L', 'M', 'Q' or 'H' - QR Code Error correction level, where:
'H' --- Ultra High Reliability Level
'Q' --- High Reliability Level
'M' --- Standard Level (default)
'L' --- High Density Level
6) 'A' or 'M' - QR Code Data Input Modes <AUTO, MANUAL>, where:
'A' --- AUTO (default)
21
'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
<ESC> – ‘z’ – ‘9’ – CM – SL – SW – SH – EW – EH – MSB – LSB – [User’s Data]
Parameters
CM:Compaction Mode. Select a mode to encode the user’s data
Each PDF 417 symbol character consists of a stack of vertically aligned rows between 3 and 90. Each
row includes a start and a stop pattern, left and right row indicators and a maximum of 30 symbol
characters. The symbol shall include a quite zone on all four sides
All ASCII and extended characters, 8-Bit binary data and up to 811,800 different character sets
Height: Variable (3 to 90 rows) and Width: Variable (90X to 583X)
1850 text characters
2 to 512
1
0
997
1
2
045
1
1
1
1
1
0
1
0
1
1
0
5
1
0
84699
1
1
1
0
1
9
22
Compaction Mode DescriptionEncoding 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’. Set the value of the Security Level based on
the number of user’s data to be encoded
Security Level # Error-Check Code Words
‘0’ 2
‘1’ 4
‘2’ (recommended)
‘3’ 16
‘4’ 32
‘5’ 64
‘6’ 128
‘7’ 256
‘8’ 512
8
SW:Symbol Width byte. This is the total width length of the printed PDF417 symbol. The user may specify any value here,
and the printer will calculate the actual width of the symbol & it will update this value again (Future Use).
Recommended Value: ‘0’ or 0x30
SH:Symbol Height byte. This is the total height length of the printed PDF417 symbol. The user may specify any value
here, and the printer will calculate the actual width of the symbol & it will update this value again (Future Use).
Recommended Value: ‘0’ or 0x30
EW:Element Width byte. This is the width length of a single element in the PDF417 symbol, that is, bar/space width. Can
be set to ‘1’ or ‘2’
Element Width Value Length in mil
‘1’ 4.9 mil
‘2’ (recommended)
9.8 mil
EH:Element Height byte. This is the height length of a single element in the PDf417 symbol, that is, bar/space
height. A value between 0x03 to 0x0A can be used. Recommended Value: 0x06
MSB: Most Significant Byte: This byte represents the most significant byte of how many bytes to encode of User’s
Data. Maximum is 06 in hex, that is, MSB = 06h (max).
LSB: Least Significant Byte: This byte represents the least significant byte of how many bytes to encode of user’s
Data.
User’s data: Data to be encoded in the barcode
Total number of user’s data that can be encode is [MSB][LSB] = 0x06B8 = 1720 bytes, that is, only alphanumeric with
security level set to its minimum value.
Setting the security level to a higher value, will result in less user data to be encoded, since the total number of code
words that can fit in a PDF417 symbol are 929, and if security level is set to ‘8’, then already 512 error code words are
occupied in the symbol, and (929-512 = 417), so only about (417*2) alphanumeric data can be encoded with security
level ‘8’.
If any parameter in the command line does not match the spec in this document, then an error message “Invalid
Barcode” will be sent out from the printer’s serial port.
23
Example: The following escape commands encode the data “12345678”. Due to space limitation CR LF are not shown
This command allows the user to change the height of a selected barcode using a multiplier with values 1 < n < 18
(HEX values). The multiplier command can be sent prior to or after the Print Barcode sequence (ESC z t n h data CR LF)
Example:
The sequence below prints CODE39 barcode first of a height of 50 dots and then sets the new height to 3 x 50 dots.
To print CODE-39 of height 150 dots using the multiplier command send steps 1, 2, in the order below.
Barcode Height Multiplier
Escape Sequence: ESC z h 3
Hexadecimal: 1B 7A 68 03
Decimal: 27 122 104 3
Printing Barcode:
Escape Sequence: Esc Z 1 7 2 C O D E - 3 9 CR LF
Hexadecimal: 1B 5A 31 07 32 43 4F 44 45 2D 33 39 0D 0A
Decimal: 27 90 49 7 50 67 79 68 69 45 51 57 13 10
Graphics
The printer uses a single line thermal print head with elements spaced at 0.125mm. The 8-bit graphic commands
enable control of each heating element of the print head. The commands also advance the paper in increments of
0.125mm. The number of heating elements can vary according to your printer model. Refer to the printer’s User’s Guide
for specific information.
To select the 8-bit graphic mode, the user application must issue the ESC V command. After that, the user application
must send two bytes to indicate the number of the graphic lines desired, followed with a packet of 72 bytes for each
graphic line. The printer prints the graphic line and advances to the next line automatically.
8-Bit Graphics ESC V n1 n2 data
8-bit Graphic mode is selected using the ESC V command. <n1> and <n2> is a 16 bit integer indicating the number of
graphic lines of 72 characters each to be received. Valid Graphic character sets range from 0x00 to 0xFF Hex using bits
0-7
To achieve optimized smooth printing and to extend battery life when printing graphics, a print buffer is employed. The
printer buffer accumulates a specific amount of data before actually printing the graphic data.
24
The following 8-bit graphic command is used to print a single line of graphic
Escape Sequence: ESC V SOH NUL 72 bytes of data
Hexadecimal: 1B 56 01 00 72 bytes of data
Decimal: 27 86 1 0 72 bytes of data
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 allows for faster data transfer between the host computer and the printer.
Graphic String Component Function
height
(# of lines)
width
(# of bytes in each line)
counter
r (# of lines)
An eight bit value representing the number of dot-lines contained in the following data set
An eight bit value representing the number of bytes to be contained in each dot-line of the following
data set
An eight bit value which describes how the following data will be processed
For Signed
Values
For Unsigned
Values
{127 ≥ Counter ≥ 0} Process the next (Counter + 1) bytes of data as 8 bit
graphics.
{0 > Counter ≥ -128} Repeat the next single byte of data ((-Counter) + 1) times.
{127 ≥ Counter ≥ 0} Process the next (Counter+1) bytes of data as 8 bit graphics
{128 ≥ Counter ≤ 255} Repeat the next Singe byte of data, (( 256 – Counter)+1)
The printer can be operated in two modes, Online and Buffer mode. In online mode, the characters are printed as they are
received. In buffer mode, the characters received are stored in the print buffer and printed upon receipt of the EOT character
(^D). Also if the printer is in Buffer Mode and the print buffer is full, the printer will start printing but will remain in the Buffer Mode
until the Online Mode command is sent to the printer.
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: EOT
Hexadecimal: 04
Decimal 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. The End Of Text (EOT) control
character is transmitted once when the printer buffer is empty.
This command sets the printer level of contrast or darkness of the printer.
The parameter n is the level of contrast. 1 ≤ n ≤ 9.
The printed text or graphics contrast depends on the type of thermal paper used, the printer battery voltage and the
printer contrast setting (selected by the host application).
The table below specifies recommended n values according to the media used.
This command deletes the entire printer buffer and resets the printer to the power-up default values.
Control Code: CAN
Hexadecimal: 18
Decimal: 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.
Note: This command does not clear the print buffer! Use the Cancel (CAN) command to clear the buffer.
This command will not restore any changes that were burned into the flash memory such as: fonts, logos, default power up
message or hardware information message. User programmable printer attributes and their factory defaults are shown in the
table below:
Attribute Factory Default
Font Courier 3
Character set International
Underline Disabled
Bold Disabled
Reverse Printing (White on Black) Disabled
Double Width Disabled
Double Height Disabled
Line spacing 3 dots
Form Feed Length 2030 dots
Vertical Tab distance 203 dots
Horizontal Tab distance 100 dots
Printing direction Left-to-right
Contrast 2
Sensor Sensitivity 255
Auto Power Down time 99 seconds
Printer Controls – Power
Auto Power Down Command ESC M n m 0 CR
This command configures the printer Auto power-down timer.
In order to conserve battery life, the printer features an auto power down timer. If the printer is in the AUTO POWER
DOWN MODE, the power down timer defaults to 99 secondson initial power up. Refer to the printer User Manual for
appropriate dip-switch positions.
The auto power down timer may be set or disabled by sending recognized command strings. The auto power down is
re-started upon every character received.
The auto power down timer may be disabled by activating the <RTS> input line, or setting the auto power down timer to
zero, the printer lowers the CTS output line and transmits AUXOFF followed by XOFF before power down. On power
down the timer reverts to its default settings.
The parameters n1 and n2 may be set to ‘0’ through ‘9’.
28
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. When used in conjunction with the Default Power-Up Setup command, this command will allow
for the power down timer value to be saved permanently in Flash.
The following table details the available formats for this command:
Command String Printer Response
Esc–‘M’–‘S1’ –‘S2’–‘0’–CR Sets the printer Auto power down timer to S1S2
seconds
Esc–‘M’–‘M1’–‘M2’–‘S1’ –‘S2’–‘0’–CR Sets the printer Auto power down timer to M1M2
minutes S
Esc–‘M’–‘H1’–‘H2’–‘M1’–‘M2’–‘S1’ –‘S2’–‘0’–CR Sets the printer Auto power down timer to H1H2
hours M
Here, H
, M1M2 and S1S2 are two decimal characters that denote hours, minutes and seconds respectively. Values
1H2
range from ‘00’ to ‘99’ with values over 59 being carried over. Up to 18 hours may be specified. The CR character at the
end of the command is mandatory.
Example 1: This escape sequence sets the Auto power down timer to 54 seconds
Example 2: This escape sequence sets the Auto power down timer to 1 hour 16 minutes 54 seconds. Note that 76
minutes was converted to 1 hour 16 minutes.
This command will cause the printer to print the battery status
Printer Response
Print Buffer Status ESC B <4 ASCII digits> CR LF
Timer-MCR Status 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 Print Buffer, Battery Voltage, Timer-MCR & Print Head Temperature SYN
This command will cause the printer to send the following information to the host:
Printer Response
Print Buffer Status ESC B <4 ASCII digits> CR LF
Battery Voltage Status ESC V <4 ASCII digits> CR LF
Timer-MCR Status ESC M <4 ASCII digits> CR LF
Print Head Temperature ESC T <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.
Print Battery Voltage ESC P ^
This command will enable the printer to output the battery voltage reading.
Escape Sequence: ESC P ^
Hexadecimal: 1B 50 5E
Decimal: 27 80 94
Query Printer Firmware Version ESC P (
This command will cause the printer to send the Firmware Version to the host.
After sending the previous command, the printer will respond with the ASCII sequence:
ASCII Sequence:<string> CR LF
The <string> field represents the hardware model.
Magnetic Card Reader
A three track Magnetic Card Reader is an option available on the Datamax-O’Neil printers. The MCR reader is designed
to read magnetically encoded data from cards conforming to ANSI/ISO 7810, 7811 standards.
The MC reader converts the F2F encoded signals on the magnetic card, to ISO7811 compatible ASCII format and
transmits the information to the host computer or terminal. Also, the MCR can read one, two or three tracks
simultaneously and bi-directionally.
The table below summarizes the format of the data stored on each magnetic track.
Read Magnetic Card Data ESC M n1 n2 t (CR) or ESC m n1 n2 t (CR)
This command activates the MRC reader and waits until the user swipes a card (or until the timer times out). The
<n1><n2> parameters are used to set the MC reader’s timer. "01" through "99" are valid timer settings. “00” disables
the timer. The ‘t’ value indicates which MCR track number to read.
The printer aborts and transmits the time-out error message if the operator fails to swipe a card within the time period
set by the host application.
If the timer times out, the printer aborts the swipe process, transmits the timeout error message and switches off the
<READING> LED. A good magnetic card swipe automatically terminates the read process. The following table details
the possible combinations for this command:
Magnetic Card Command String Description
ESC M n1n2 1 CR (CR = Carriage Return) or
ESC m n1n2 1 CR (CR = Carriage Return)
ESC M n1n2 2 CR or ESC m n1n2 2 CR Read Track2 only
ESC M n1n2 3 CR or ESC m n1n2 3 CR Read Track3 only
ESC M n1n2 4 CR or ESC m n1n2 4 CR Read Track1 and Track2 simultaneously
ESC M n1n2 5 CR or ESC m n1n2 5 CR Read Track2 and Track3 simultaneously
ESC M n1n2 6 CR or ESC m n1n2 6 CR Read Tracks 1,2 and 3 simultaneously
Read Track1 only
31
Example: The following escape sequence sets the timer to 99 seconds and activates the MRC to read the track #1.
The track data retrieved from a magnetic card is transmitted to the host in ISO7811 ASCII format as summarized in the
table below. The first four characters (“%/1/”) flag the track number, the track data follows the flag string terminated with
‘?’-CR-LF.
‘%;+’ are the track start characters, While ‘?’ is the end of track character.
If no data is available for a track then that data field will be empty. If an Error is encountered on any track, a single ‘E’
will be the output for that track’s data field. The ISO 7811 ASCII Format is detailed below:
Track1 Track 2 Track 3
%/1/ Data ?CRLF ;/2/ Data ?CRLF +/3/ Data ?CRLF
Magnetic Card Read Error Messages
The characters <%> and <E> preface all error messages. Following these two characters is a comma, two ASCII digits
representing the error number (01 through 99), another comma, English description of the error encountered, and finally
a CR-LF which terminates the <Error Message> string. The syntax is as follows:
<%><E>, nn, Error text in ASCII, <CR> <LF>
Where nn is the error number encountered
The printer may transmit three (3) types of Read Error messages. Refer to the table below for detailed description of the
error messages.
Error # Error Message Transmitted
05 Time-out Expired
07 Invalid Track Number
09 Cancel Request
Interfacing to the Magnetic Card Reader
This section details the software steps required to access the MC reader from a computer or a terminal.
(1) The Host selects the printer by activating the RTS input line or sending wake-up characters to the printer.
(2) The Printer Sends the XON command to the host to indicate that it is ready to receive data from the host.
(3) Once XON is received the host sends an ASCII serial command string to enable the magnetic card reader (e.g. Escm004-cr). The printer switches on the GREEN <READY> LED.
(4) Once the operator swipes the magnetic card, the printer transmits, in ASCII format, the track information found on
the magnetic card.
A good read automatically switches off the MC reader and the <READY> LED.
(5) The <READY> LED illuminates RED if an error is encountered while reading the magnetic card.
The printer transmits a timeout error message if the operator fails to swipe a card in the time period set by the host
application.
32
Cancel Magnetic Card Data Read Command ESC C
This command cancels the MCR read process. The printer returns to online operation mode.
Escape Sequence: ESC C
Hexadecimal: 1B 43
Decimal: 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.125mm dot rows that the printer can advance paper before the sensor detects an
out of paper error. The length of the paper sensitivity must be larger than the length of the black mark on the media to
avoid paper out error.
The value selected for the sensitivity is dependent upon the height of the pre-printed black mark located on the label or
form stock. The default power-on value n is 255 (0xFF).
Example: The following escape sequence sets the paper sensitivity to 6.25mm (50*0.125)
This command enables the printer to send reporting messages to the host. Refer to “Black Mark Found” and “Black
Mark not found” commands for details of the messages that are activated.
Prevents the printer from sending report messages to the host. Refer to “Black Mark Found” and “Black Mark not found”
commands for details of the messages that are deactivated
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.
Example: The following escape sequence advances the paper 80 dot lines looking for a Black Mark.
Escape Sequence: ESC Q F P CR
Hexadecimal: 1B 51 46 50 0D
Decimal: 27 81 70 80 13
Reverse Seek Black Mark ESC Q B n CR
This command causes the printer to seek black mark using backward feed until n dot line feeds have been processed;
each dot line feed is 0.25mm.
Not the using this command can cause a paper jam since the paper is advanced in reverse mode. The results may vary
depending on the media used in the printer.
Black Mark Found (Response from printer) ESC Q ? ? n1, n2
This message is sent to the host and indicates that a black mark has been found. The numbers n1 and n2 are the high
and the low nibble, respectively, describing how many (0.25mm) dot lines were required to find black mark.
Black Mark Not Found (Response from Printer) ESC Q 0 0 n1 n2
This message is sent to the host and indicates that a black mark has not been found. The numbers n1 and n2 are the
high and the low nibble, respectively, describing how many (0.25mm) dot lines were processed before reporting black
mark not found.
Black Mark Sensing Auto Mode
Enable Front Black Mark Sensor ESC Q f e CR
This command will enable the printer’s front black mark sensor and automatically disable the BACK
side sensor.
Escape Sequence: ESC Q f e CR
Hexadecimal: 1B 51 66 65 0D
Decimal: 27 81 102 101 13
Disable Front Black Mark Sensor ESC Q f d CR
This command disables the printer’s front black mark sensor.
Escape Sequence: ESC Q f d CR
Hexadecimal: 1B 51 66 64 0D
Decimal: 27 81 102 100 13
34
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: ESC Q b e CR
Hexadecimal: 1B 51 62 65 0D
Decimal: 27 81 98 101 13
Disable Back Black Mark Sensor ESC Q b d CR
This command will disable the printer’s back black mark sensor.
Escape Sequence: ESC Q b d CR
Hexadecimal: 1B 51 62 64 0D
Decimal: 27 81 98 100 13
Disable Both Front and Back Black Mark Sensors ESC Q f x CR or ESC Q b x CR
This command disables the printer’s front and back black mark sensors.
Escape Sequence: ESC Q f x CR
Hexadecimal: 1B 51 66 78 0D
Decimal: 27 81 102 120 13
or
This command disables the printer’s front and back black mark sensors.
Escape Sequence: ESC Q b x CR
Hexadecimal: 1B 51 66 78 0D
Decimal: 27 81 102 120 13
Printed Receipt/Label Presenter Positive Adjust ESC Q D + n
This command will cause the printer to advance the paper to the distance specified by n dots after a form or label has
been printed.
Example: The following escape sequence will feed the paper 112 dots.
Printed Receipt/Label Presenter Positive Adjust ESC Q P n
This command is identical to Esc Q D + n command and will cause the printer to advance the paper to the distance
specified by n dots after a form or label has been printed.
Example: The following escape sequence will feed the paper 112 dots.
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.
Page Print Commands - Configuration
Datamax-O’Neil printers can operate in two separate modes: Line Print Mode and Page Print Mode.
On Power Up the printer defaults to Line Print Mode. In this mode, all data is printed from top to bottom as it is received. In Page
Print mode, the canvas is constructed in advance and the form is printed afterwards. This allows for positioning of text,
barcodes, lines and rectangles at specific X and Y coordinates and also at specific angles – 0, 90, 180 and 270 degrees. The
rendering process of the page is done in printer’s memory.
Page Print Mode can be used to design a certain template and replace only variable data during communication.
Line Printing vs. Page Printing
This section describes the commands which are supported in Page Print Mode.
Enter the Page Printing Mode ESC P P
This command is required to enter Page Print Mode. Esc P P also works in conjunction with the following commands:
Command Name Command String Command Description
Enter Buffer Mode Esc P $ Printer Enters Buffer Mode. All data is retained in the Buffer until ^ D ( 0x04) is
received.
Exit Buffer Mode Esc P # Exits Buffer Mode and puts the printer into the Line print Mode
Print Buffer Content ^ D Prints Buffer Content; Printer is ready to receive more data.
36
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. The margin is then used as a start point (0, 0) for the form or
label.
Mark Page End, Print and Exit EndPage();
This command is used to end a form or label while in the Page Printing mode. This command also forces the printer to print a
label or form.
Page Print Commands – Draw Commands
Draw Text DrawText (x,y,color,angle,"string");
Draws text at any coordinate on the canvas.
DrawText “data” prints the text enclosed in the double quotes at the current cursor location. x and y specify where the text is to
be printed (upper left corner of the first letter of the top line).
User may print white text on an existing black background by specifying color = 0.
Anglespecifies text direction
Angle Print angle Description
0 0 degrees Counter-clockwise Prints text horizontally from left to right.
1 90 degrees Counter-clockwise Prints text vertically in the upward direction
2 180 degrees Counter-clockwise Prints text horizontally from right to left
3 270 degrees Counter-clockwise Prints text vertically in the downward direction.
Stringspecifies the text to print
Multiple lines can be printed with a single ‘DrawText’ command by separating the lines with \n characters. Text formatting is
accomplished by tags inserted in the string argument. The formatting is effective only in the string in which it appears and does
not carry over to the subsequent DrawText commands. The text formatting commands are listed below.
37
Command Name Description
<b>, </b> Bold Text enclosed by <b> and </b> appear in bold.
<u>, </u> Underline Text enclosed by <u> and </u> are underlined.
<h = value> Text Height Text height is magnified by the given numeric value. Use <h = 1> to return to original size.
<w = value> Text Width Text width is magnified by the given numeric value. Use <w = 1> to return to original size.
<f = value> Font Sets the font. value = {0 .. 9}.
\n New Line Moves the cursor to the beginning of the next line.
\<, \>, \”, \\ Literals Use backslashes to print these special characters.
Example: The figure below shows the use of the “\n” command as well as the effect of the angle command in the text being
printed with the DrawText command
Draws a rectangle object at any coordinate on the canvas.
DrawRectangle command draws either a hollow or a filled rectangle. (x1, y1) and (x2, y2) specify the two diagonally opposing
corners. All measurements are in dots.
Parameters:
x1, y1Top left corner coordinates (x1, y1)
x2, y2Bottom right corner coordinates (x2, y2)
color Specifies the line or fill color: 0 = white, 1 = black
The user may draw a white rectangle on a black background only by specifying color
parameter = 0.
widthSpecifies the line width of a hollow rectangle. A zero-width results in a filled rectangle
Draw Bar Code DrawBarcode(x,y,angle,annotate,type,height, "data");
Draws a barcode object at any coordinate on the canvas.
Parameters:
X Indicates location on “x” axis of the left top corner
Yindicates location on “y” axis of the left top corner
angleValues 0, 1, 2, or 3 allow the barcode to be rotated 0, 90, 180, or 270 degrees respectively
annotate Setting annotate to 1 allows human-readable text to appear. ‘0’ disables this function. typeIndicates the barcode type to be printed. The barcodes supported are listed below:
heightSets 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. Refer to the Barcode Specification section for detailed
information of characters accepted by each barcode
Example: The following commands are used to create code 39 barcode inside an outline box.
DrawText(10,35,1,0,"This barcode 39 is printed in Page
Print Mode");
DrawText(10,110,1,0,"Exiting Page Print Mode");
EndPage();
Welcome to Line Print Mode
This text line is printed in Line Print Mode.
You are now out of Page Print Mode!!!
39
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. Developers can use Form Fiesta to generate
a label and then copy the commands generated in the yellow section of the screen (these are the commands which render the
image on the screen). The variable data can be acquired by the user’s application and replaced in the command string.
Example: The code below demonstrates how to implement this using a simple VB program. ‘CustomerName’ and ‘csCarModel’
are two variables which are substituted in the string.
MSComm1.Output = csTicket + vbCrLf
MSComm1.PortOpen = False
End Sub
The Form Fiesta installation program, as well as instructions for using the software, is available in the Developer’s CD.
40
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: ESC D S
Hexadecimal: 1B 44 53
Decimal: 27 68 83
Start Default download process ESC S L
This command alerts the printer that a file will now be downloaded.
Escape Sequence: ESC S L
Hexadecimal: 1B 53 4C
Decimal: 27 83 76
Stop Download Process ESC S T 0xFF CR
This command stops the downloading process.
Escape Sequence: ESC S T 0xFF CR
Hexadecimal: 1B 53 54 255 0D
Decimal: 27 83 84 255 13
Store In Flash Default setup data ESC S B CR
This command allows the printer to burn the command file in Flash memory. After finishing the process, the printer will
respond with the”D! X” characters.
Escape Sequence: ESC S B CR
Hexadecimal: 1B 53 42 0D
Decimal: 27 83 66 13
Example: The following escape commands will change the default font to “k2” (48 characters per line). The “k2” font will
be restored in place of the k3 value every time the printer is power cycle
The commands below must be sent sequentially:
Escape sequence 1: ESC D S
Escape sequence 2: ESC S L
Escape sequence 3: ESC k 2
(The previous command can be a binary file with a list of commands to initiate default start up)
Escape sequence 4: ESC S T 0xFF CR
Escape sequence 5: ESC S B CR
41
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: ESC D S
Hexadecimal: 1B 44 53
Decimal: 27 68 83
Start Hardware Information download process ESC S I
This command alerts the printer that a file will now be downloaded.
Escape Sequence: ESC S I
Hexadecimal: 1B 53 49
Decimal: 27 83 73
Stop Download Process ESC S T 0xFF CR
This command stops the downloading process.
Escape Sequence: ESC S T 0xFF CR
Hexadecimal: 1B 53 54 FF 0D
Decimal: 27 83 84 255 13
Store In Flash Default setup data ESC S B CR
This command allows the printer to burn the command file in Flash memory. After finishing the process, the printer will
respond with the ”D!X” characters.
Escape Sequence: ESC S B CR
Hexadecimal: 1B 53 42 0D
Decimal: 27 83 66 13
Print Hardware Information ESC L g 8
This command prints a hardware information message previously store in memory.
Escape Sequence: ESC L g 8
Hexadecimal: 1B 4C 67 38
Decimal: 27 76 103 56
Example: The following escape commands will burn “Hardware Information” string into the flash memory. The “Hardware
Information” string will be printed below battery voltage readings in the self test message.
The commands below must be sent sequentially:
Escape sequence 1: ESC D S
Escape sequence 2: ESC S I
Escape sequence 3: Hardware Information
Escape sequence 4: ESC S T 0xFF CR
Escape sequence 5: ESC S B CR
42
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.
The specifications for the logo memory are as follows:
Printer Number of Logos Bytes per logo Dot lines per logo Dots per line Logo Locations Available
2 inch 8 (FLASH) 0 ≤ n ≤ 7 64,000 1365 384 0 - 7
3 inch 8 (FLASH) 0 ≤ n ≤ 7 64,000 910 576 0 - 7
4 inch 8 (FLASH) 0 ≤ n ≤ 7 64,000 630 832 0 - 3
Select Logo Download mode ESC D L CR LF
This command places the printer in Flash Logo mode.
Escape Sequence: ESC D L CR LF
Hexadecimal: 1B 44 4C 0D 0A
Decimal: 27 68 76 13 10
Before executing this command, the printer power must be cycled, alternatively the command ESC X X can be sent.
The printer responds by sending a ‘?’ character to the host application indicating that the Flash Logo Mode is enabled.
Select logo Download Memory Location ESC L G n CR LF
This command selects the memory location in which to store the logo. The parameter n can take values between 0 – 7
(n varies with printer model. Please refer to the above table).
This command terminates the logo uploading process.
The printer saves the received Logo data in Flash and sends D!X characters to the host, indicating that the logo data
was saved successfully.
Escape Sequence: ESC L G 0xFF CR LF
Hexadecimal: 1B 4C 47 0xFF 0D 0A
Decimal: 27 76 71 255 13 10
Print Logo ESC L g n
This command prints a logo previously store in memory. The parameter n instructs the printer to print the graphic stored
in memory locations (refer to table above for logo location availability)
Example 1: The following escape sequence will print the logo at memory location one.
43
Escape Sequence: ESC L g 1
Hexadecimal: 1B 4C 67 31
Decimal: 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: ESC D L CR LF
Escape sequence 2: ESC L G 1 CR LF
Escape sequence 3:logo.prn file
Escape sequence 4: ESC L G 0xFF CR LF
Escape sequence 5: ESC L g 1
The following table represents the LED behavior for each Escape sequence during logo download.
Command Description Printer Response LED Status
ESC D L CR LF Select Logo Download Mode ? Power LED - Flashing Green
MRC & Error – Steady Red
ESC L G n CR LF Select Memory Location none Power LED - Flashing green
Send Graphic Logo File Send a Binary file with the Logo
image
ESC L G 0xFF CR LF Stop Loading Graphic Logo D!X
ESC L g nPrint Graphic Logo Printer Prints Logo n none
Note: The above logo download commands are intended for Developers only. Please contact Customer Support for any
Logo Download Utilities.
none Power LED - Flashing green
While the logo is being burned
Power LED – Steady Green
MRC & Error – Steady Red
When Burning complete
Power LED – Steady Green
Download – Fonts
Enable Font Downloading ESC D F CR
This command will enable the font download feature.
Escape Sequence: ESC D F CR
Hexadecimal: 1B 44 46 0D
Decimal: 27 68 70 13
Display Tables Information ESC F I CR
This command will instruct the printer to display the font table’s information at the host. The printer must be connected
to the host in order to receive the font table’s information.
Escape Sequence: ESC F I CR
Hexadecimal: 1B 46 49 0D
Decimal: 27 70 73 13
Command is valid after ESC, D, F, CR
44
Display Tables Information ESC D I CR
Same description as the command directly above. This command is for Legacy printer’s compatibility.
Escape Sequence: ESC D I CR
Hexadecimal: 1B 44 49 0D
Decimal: 27 68 73 13
Disable Font Download Mode ESC F X
This command will disable the font download mode and put the printer in ready print mode.
Escape Sequence: ESC F X
Hexadecimal: 1B 46 58
Decimal: 27 70 88
Display Font Download Current Settings ESC F S m t k f CR
This command will instruct the printer to display the current font download settings. The printer will send the following
string to the host:
Esc-‘F’-‘S’ m t k f
Parameters
m‘0’=standard response, ‘1’ =response with diagnostics message (default)
tFont File type. t = ‘0’. BDF formatted file (default). t= ‘1’ through ‘9’ reserved
kFont Table: column value. = ‘0’ through ‘9’
fFont Table: row value. f = ‘0’ through ‘9’
Set Font Download Parameter ESC F P m t k f CR
This command sets the font download parameters such as for the row and column of the font memory table. The
command structure is detailed below.
Parameters
m‘0’=standard response, ‘1’ =response with diagnostics message (default)
tFont File Type. t = ‘0’. BDF formatted file (default). t= ‘1’ through ‘9’ reserved
kFont Table: column value. = ‘0’ through ‘9’
fFont Table: row value. f = ‘0’ through ‘9’
45
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).
Command
String
Esc-‘D’-‘F’ Enable font
Esc-‘F’-‘I’ Display tables
Esc-‘F’-‘S’-
<CR> or <LF>
Esc-‘F’-‘P’ – m -
t - k - f - <CR>
or <LF>
Esc-‘F’-‘M’- m -
<CR> or <LF>
Esc-‘F’-‘K’- k <CR> or <LF>
Esc-‘F’-‘F’- f <CR> or <LF>
Command
Description
downloading
Information
Display font
download current
Settings
Set Font
Download
Parameter
To select Mode
To select font
column(K) value
To select font
row(F) value
Printer Response
m =1
? ? Communication LED – Flashing Green
Display installed
Font tables info
(refer to Table 5)
Esc-‘F’-‘S’ m t k f ‘1’: if command correct
Esc-‘F’-‘S’ m t k f ‘1’: if command correct
Esc-‘F’-‘S’ m t k f ‘1’: if command correct
Esc-‘F’-‘S’-m t k f ‘1’: if command correct
Esc-‘F’-‘S’ m t k f ‘1’: if command correct
Printer Response
m =0
‘1’: if command correct
‘0’: otherwise
‘0’: otherwise
‘0’: otherwise
‘0’: otherwise
‘0’: otherwise
‘0’: otherwise
LED Status
MCR/Printer Error LED –Steady Red
Communication LED – Flashing Green
MCR/Printer Error LED –Steady Red
Communication LED – Flashing Green
MCR/Printer Error LED –Steady Red
Communication LED – Flashing Green
MCR/Printer Error LED –Steady Red
Communication LED – Flashing Green
MCR/Printer Error LED –Steady Red
Communication LED - Flashing green
Communication LED - Flashing green
Esc-‘F’-‘L’ – t -
<CR> or <LF>
Send the .bdf file Send the File
Esc-‘F’- ‘B’
<CR> or <LF>
Select file type
**and start of font
download
To program or
burn font on flash
Esc-‘F’-‘S’ m t k f ‘1’: if command correct
‘0’: otherwise
On burn process
Complete:
D!X
On burn process
Complete:
D!X
Communication LED - Flashing green
While File is transferring:
Communication LED - Flashing Green
When transfer is complete:
Communication LED - Flashing Green
Total number of characters transferred is
displayed
While the font is being burned in
FLASH
Communication LED – Flashing Green
MCR/Printer Error LED - Flashing Red
When Burning complete
Communication LED – Steady Green
46
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.
Save Font File in Flash ESC F B CR
This command instructs the printer to program or burn font onto Flash memory.
The table below summarizes the font downloading commands supported by the Datamax-O’Neil printer along with the
printer’s expected LED status.
Escape Sequence: ESC F B CR
Hexadecimal: 1B 46 42 0D
Decimal: 27 70 66 13
Important Font Downloading Notes:
The file to be downloaded must be .BDF formatted.
When downloading, ensure that the metrics of the fonts to be downloaded are equal or smaller than the metrics of the
existing font in the location in question; otherwise the fonts will not be downloaded correctly.
The escape sequence ESC D F CR must be the first command after power up, otherwise the printer will print the
command instead of executing it. You can also use the commands ESC X X CR command to initialize the printer after
other escape commands have been used.
Once a font has been downloaded, press the FEED button twice to exit the downloading mode. Shut the printer OFF by
pressing the ON/OFF switch.
Each character’s header uses .DBF font and represents the true size of the font bitmap.
Example1: For a 16x23 font, the header at the beginning of each character must appear as follows:
BBX 16 23 0 0
Example 2: For a 10 x 23 font, the header at the beginning of each character must appear as:
BBX 10 23 0 0
If the font to be downloaded is one byte in size (8 x 23), the .BDF file must be one byte only in size. Otherwise the
firmware will not accept the font!
47
Example 1: BBX 08 23 0 0
BITMAP
0008
000F INCORRECT
0002
0003
Example 2: BBX 08 23 0 0
BITMAP
08
0F CORRECT
02
03
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.
1) Have the .BDF font file available and ready. The file should contain all of the characters which are to be downloaded. When
downloading, ensure that the Serial Port setting for the Terminal Program is configured for Hardware Handshaking. If the file
is in .ASM format rather than a .BDF format, use Datamax-O’Neil’s ‘asm2bdf’ utility to convert the file to .BDF format.
Instructions on how to use the utility are available in the USING THE ASM2BDF UTILITY document available in the FONT
section of the supplied Developer’s CD.
2) Cycle Printer Power or Send ESC X X command
3) Send Esc D F and wait for a question mark to return from the printer. The Ready and Status LED should each illuminate in
green.
4) Send Esc F I to view the current font table information
5) Send Esc F K 1 <CR> or <LF> – This will select the second column of the table – the Power LED will begin flashing Green
and the Status LED will illuminate a steady RED.
6) Send Esc F F 1 <CR>or <LF> – This will select the second row of the table - the Power LED will start flashing Green and
the Status LED will turn steady RED.
7) Send Esc F L 0 <CR>or <LF> which will signal that the file you are sending is .DBF format (this command is implemented
primarily for future releases when users will be able to download more than one font format) - the Power LED will start
flashing Green and the Status LED will illuminate a steady RED.
8) Send the .BDF file - While the File is transferring the Power LED is steady Green and the Status LED is steady RED – when
the transfer is complete the Status LED switches OFF and the Power LED flashes Green. The .BDF font metrics must be
equal or smaller than the metrics of the existing font.
9) Send Esc F B <CR>or <LF> - The Power (green) and Status (red) LEDs are steady while the font is burned in FLASH.
When burning has been completed, both the Power LED (green) and the Status LED (red) begin flashing.
10) The .BDF font in the example above has been stored in the International Section of the Courier Mode 1 font (F = 1, k = 1).
Unplug the Serial Cable, press the Feed button, and shut the printer OFF by pressing the ON/OFF button.
48
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. For
UART selection only use ECU application.
Note: Pass-thru command is not available when Source (n1) = Destination (n2)
The Pass-thru mode terminates under three conditions:
After pressing the FEED button
After TIMEOUT duration specified in the pass-thru command has EXPIRED
After receiving three consecutive “#” characters.
49
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.
To select a temporary emulation mode the user must use the following command:
Select Emulation ESC E n
This command selects emulation mode n by which future commands will be interpreted as described in the following table. The
selected mode will be in effect until another Select Emulation command is received or the printer is manually reset by cycling
power on the printer.
Once the emulation has been selected, please refer to the section of this manual that describes the commands
available for that emulation.
Example: The following escape sequence will set the printer to O’Neil Emulation.
Escape Sequence: ESC E O
Hexadecimal: 1B 45 4F
Decimal: 27 69 79
n Emulation Language
N Datamax-O’Neil Printer Command Language
O O’Neil Emulation Line Print Mode
Z O’Neil Emulation EZ Print Mode
C CPCL Emulation
The following table details the behavior of the printer to enter and exit the emulation mode.
Getting From ( Mode Name) Regular Mode(Datamax-O’Neil) Line Print Mode Easy Print Mode
Regular Mode ( Datamax-O’Neil ) Esc E O ESC E Z
O’Neil Easy Print Mode ESC E N {LP}
O’Neil Line Print Mode ESC E N ESC E Z
Note: O’Neil EZ Print Mode and CPCL emulation are not supported in version 1.0.1
O’Neil Line Print mode
O’Neil Printers can operate in one of two modes: Easy Print mode and Line Print Mode. Only two commands are implemented in the
Easy Print mode – {LP} which is the command which brings the printer from Easy Print Mode to Line Print Mode and the other
command is ESC E N (N for Normal Datamax-O’Neil Mode) which brings the Datamax-O’Neil printer out of the Emulation into its
regular Datamax-O’Neil command mode.
The table below details the list of supported commands of the O’Neil Line Print Mode emulation.
50
Esc C n
Esc A n
CAN (^X)
Esc V n1 n2
104*number of lines bytes of data
Esc B/Esc E
SO (^N)
SI (^O)
FF (^L)
LF (^J)
CR (^M)
Esc w n
Esc H n
This command is ignored by the Datamax-O’Neil printer. It is recognized but no action is taken
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).
Cancels the unprinted characters on the forming line.
Prints the next (n1*256 + n2) dot-lines as bit mapped graphics. The numbers n1n2 form a 16
bit set with the MSB first. The printer will remain in Graphic mode until the full number of bytes
has been received.
Accepts compressed graphics data
Set double wide print – with Datamax-O’Neil double wide does not mean burn the dot twice
but rather increase the space between the characters
Condensed printing – go back to normal mode
Feeds 10 lines and the information in the buffer
Line feed
Carriage Return
Font Select – the Datamax-O’Neil Fonts are matched as close as possible to the Line Print
fonts n (0x20..0x26)
Esc w 20 - 16w x 23h Font
Esc w 21 – 10w x 23h Font
Esc w 22 – 16w x 23h Font
Esc w 23 – 16w x 46h Font
Esc w 24 - 12w x 23h Font
Esc w 25 - 9w x 23h Font
Esc w 26 - 16w x 23h Font
Doubles the height – no matter what the n value is
Esc Q n1n2
Advance n1n2 from Q mark – Datamax-O’Neil Printer can advance only up to 255 graphic
lines from the Q Mark and the Q mark has to be within 255 lines from the beginning point.
Esc R n
This command switches between the two Character Tables in the Datamax-O’Neil Printer –
International Character Table and Line Drawn Character Table.
Esc ! n
Set double high and double wide n = 16d (0x10) – double high
n = 32d (0x20)– double wide
n = 48d (0x30)– double high and wide
Esc @
Reset the printer to defaults
Note: This command does not clear the print buffer! Use the Cancel (CAN) command to clear
the buffer.
This command will not restore any changes that were burned into the flash memory such as:
fonts, logos, default power up message or hardware information message.
Esc EZ
{LP}
Go to Easy Print Mode
From EZ Print mode go to Line Print Mode
51
Communications Settings
Dip Switch Settings
The Datamax-O’Neil printers support Serial RS232, IrDA compatible infrared communication interfaces and
1
USB*
.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.
Function (APEX2,3,4) Switch #
Communication Interface
RS232
1
IrDA
Bluetooth or 802.11g
N/A
2
USB
3
USB Bootloader
4
Baud Rate
115200
57600
38400
19200
14400
9600
2400
1200
Parity Bit
Parity Enabled (ODD)
Parity Enabled (EVEN)
Auto P ower Save
Power Save Enabled
Power Save Disabled
1
If IrDA is not installed, printer will default to RS232 mode with baud rate 115200
2
X stands for Don’t Care: Dip Switch 7 will override 1 and 2
3
Firmware Applies to Apex 4 - Version 1.10 or later, Check availability for other printer models
4
Baud Rate and Parity are applicable to RS232 and IrDA communication mode ONLY
SW 1 SW 2 SW 3 SW 4SW 5 SW 6SW 7 SW 8
OFF OFF
ON
OFF
ON ON
OFF
ON
Setting not supported
X X
X X
OFF OFF
ON
OFF
ON
ON
SW 3 SW 4SW 5 RS232 and IrDA only
OFF OFF OFF
OFF
OFF OFF
OFF
ON
ON ON
OFF OFF
ON
OFF
OFF
ON
ON
OFF
ON
ON ON
ON ON ON
Use for fixed IrDA
SW 6SW 7
ON ON
ON
OFF Does not apply for IrDA
Does not apply for IrDA
SW 8
ON
OFF Manual On/Off
Notes
Baud rate set by Dip switches 3,4
and 5
Baud Rate can be negotiated up to
the value specified through Dip
switches 3,4 and 5
Auto Power Down
52
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.2 K BAUD, 8 DATA BITS, NO PARITY BIT, and two STOP BITs on initial power up. Two communication handshaking protocols are
supported by the Datamax-O’Neil printers, Serial Busy protocol and XON/XOFF protocols.
Serial Busy Protocol
For the serial busy handshaking mode, request to send printer input (RTS) and clear to send printer output (CTS) are
used to control data flow to and from the printer.
The RTS and CTS are considered to be valid or active when the signal level is positive (3 to 12VDC). A positive RTS
signal from the host device enables the printer. The RTS signal is monitored during data transmission from the printer to
the host device, the printer transmits data to the host device only if RTS input is high. The printer raises CTS output
when it is ready to accept data. The printer lowers CTS line when the print buffer has less than 256 unused locations.
XON/XOFF Protocol
For the XON/XOFF handshaking mode, the printer transmits XON (0x11) when it is ready to accept data, and XOFF
(0x13) when the print buffer has fewer than 256 unused locations. Under XON/XOFF protocol, the data flow from the
printer's serial port is halted on receipt of an XOFF from the Host device and resumed on receipt of a XON.
RS232C Connections
The RS232C Interface signals for the Datamax-O’Neil printers are terminated on a 6 PIN RJ25 type data connector
located at the back of the printer.
Six connections are provided from the Serial Interface to the host computer. The table below lists the Serial Interface
signals and pin-outs for the RJ25 connector while pin locations are shown in Figure below.
A minimum of two signal connections are required for operation, RXD - pin3 and Common - pin1.
RJ25 Connector PIN # Functional Description Signal Name
3 RS232 from Host (INPUT) RXD
2 RS232 from Printer (OUTPUT) TXD
6 Request to send from Host (INPUT) RTS
4 Clear to send from Printer (OUTPUT) CTS
1, 5 Logic common COM
53
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 printer comes equipped with a USB 2.0 slave port. Everything that can be done through the RS-232 port can now
be done through the USB port, using A to B type USB cable. You may print to or send commands to the printer from a
PC or any equipment that can act as a USB master.
Dip switch setting
To enable USB, you must set the dipswitches on the printer as below:
SW 1 SW 2 SW 3 SW 4 SW 5 SW 6 SW 7 SW 8
Any
position
Any
position
Any
position
Compatible Software
The host and printer communicate through a method called the "Virtual Com Port", in which a software intermediary called the
"driver" makes the USB connection look like a com port to the end-application. Consequently, all software that communicates
through the com port is compatible. You may continue to use legacy software, such as the TeraTerm terminal emulation
software.
position
Any
54
Any
position
Off On Any
position
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.dll, which is a part of the Windows operating system.
Next, open the Windows Device Manager. (Control Panel > System > Hardware Tab > Device Manager) Under the Ports (COM
& LPT), you should see an entry named "Datamax-O’Neil USB CDC Communications Port”
If you ever needed to uninstall the driver, you may do so by right-clicking on the "Datamax-O’Neil USB CDC Communications
Port” from the Device Manager.
TeraTerm Example
TeraTerm is a free terminal emulator program. Make sure TeraTerm is not running when you connect the USB cable. Then run
TeraTerm, select (Setup > Serial Port...) to configure it and save the configuration. There are only three items that you need to
configure: Port, Data, and Flow control. All other parameters can be set to any value.
PORT
Data
Baud rate
Parity
Stop
Flow control
Note: Select ENTER key on the keyboard to advance paper in the printer and to verify communication.
COM<n> where <n> is the port number where USB driver was installed
8 bit
Any value
Any value
Any value
None
USB Technical Specifications
Pin Name Cable Color Description
1 VCC Red +5V
2 D- White Data 3 D+ Green Data +
4 GND Black Ground
A to B type USB cable
Bluetooth™ Communications
The printer control card communicates with the Bluetooth™ base band interface at 115.2 K Baud/sec for serial interface printers
and 57.6 K Baud/sec for USB interface printers, using no parity. To select the Bluetooth™ interface, Dip Switch # 2 must be ON
and all other Dip Switches must be OFF. If required by the host application to enter 0 (digit zero) for PIN number while
connecting to the BT module. Bluetooth settings can be changed via the AT command set (Refer to Developer’s CD for available
AT commands).
The table below details the Bluetooth Datamax-O’Neil default settings:
55
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, forward to host only
Set Serial Interface RS232
Configuration over Bluetooth Enabled
Power Save mode Allow Sleep mode only
ESC sequence timing 500ms before ESC command & 500ms thereafter
The Bluetooth™ Interface Power Modification
The Bluetooth™ interface increases the battery power consumption by 50mA. To compensate for the increased power
demand, the trickle charge rate is modified to help extend the life of the internal battery cartridge. The printer
modification is such that the printer can be set to operate in either the MANUAL POWER OFF or CONTINUOUS ON
mode. For Dip Switch settings on Power Save mode please refer to the Dip Switch Table above.
Manual Power OFF Mode
For the printer to be in Manual Power OFF mode Dip Switch # 8 must be OFF. When demonstrating RF wireless
communication, turn the printer on by pressing the ON switch located at the front of the printer. The printer will remain
active waiting for the wireless print command. Pressing the ON switch again will turn the printer OFF. For each wireless
demonstration, turn the printer on by pressing the ON switch. Operation in this fashion will greatly extend the life of the
battery cartridge. Unless the ON/OFF switch is pressed the printer will stay ON until the battery drains completely.
Automatic Power OFF Mode
To have the printer automatically SHUT DOWN after a period of time, turn Dip Switch # 8 ON. The printer will turn OFF
after 99 seconds. The value of the default timer can be changed by using the command ESC M n1n2 0 CR command
described earlier in the manual. Once power is cycled the printer reverts to the default 99 second value.
Infrared Communications (Option)
Set Dip Switch 1 to ON position. The printer can be powered up by pressing the power <ON/OFF> switch. If no IrDA
connection is made, the printer will automatically power down to a lower power level to conserve battery life. It will
remain in a “sleep” mode until an IrDA connection is made, at which time the printer will “wake” and print the requested
data. Pressing the power switch again will turn the printer <OFF>.
56
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.
Settings Value
IP address 192.168.1.96
DHCP mode Disabled
Ad - Hoc mode Enabled
Infrastructure mode Disabled
SSID APEX# , where # matches the printer model
Tunnel port 23 (to send data to the 802.11g module use this port number)
Printer Status Indicator LED Panel
The table below describes the normal function of each of the Printer’s Status LEDs.
LED Status Condition Function
Flashing Power is ON and the printer is in RS232/USB or IRDA mode
Steady Communicating with host
Flashing Power is ON and the printer is in Bluetooth mode
Steady Transmitting/receiving
Flashing Power is ON and the printer is in 802.11b/g mode
Steady
Steady
Steady Indicates that MCR or SCR is ready to accept data
Flashing
Transmitting/Receiving in 802.11 mode OR
Printing Self test in 802.11 mode
Battery being charged. The LED will turn off when the battery is fully charged
Dip Switches 5 and 7 are ON – USB cable is plugged in.
Note: If USB is unplugged, LED will flash Amber until printer is reset
manually
Serial Firmware upload
Note: Firmware upload complete indicated by blue flashing LED #3
LED # 1
Communication
LED # 2
Battery
LED # 3
Magnetic Card
Reader
&
Printer Error
GREEN
BLUE
Light Blue
AMBER
GREEN
57
Error/ Warning LED Panel
LED # LED Color/ Status Description Action Required
LED # 1
Communication
LED # 1
&
LED # 3
LED # 3
Magnetic Card
Reader
&
Printer Error
RED/ Steady Low power indication: Charge battery
Printer is in RS232 or USB
(#1) GREEN/ Flashing
(#3) RED/ Flashing
(#1) BLUE-GREEN
Flashing*
(#3) RED/ Flashing
GREEN
Momentary flashing
RED Flashing
RED
Flashing
RED
Steady
RED
Flash Fast
Blue
Flashing
mode and Printer Buffer is not
empty.
Printer is in Bluetooth mode
and Printer Buffer is not empty.
Printer has discovered and is
parked on the Q-Mark
Paper Error/
Paper Door Open/
Dip Switch 5 and 7 are ON
Print Error: Printer out of paper Replace roll of paper
Print head is hot. Printer will
stop printing
Firmware upload via serial
cable is completed successfully
Press Feed to clear error. Cycling printer
power will result in printer buffer data loss.
Press Feed to clear error. Cycling printer
power will result in printer buffer data loss.
Advance Q-Mark to tear bar level to continue
(refer to manual for Q-Mark commands)
Insert paper properly (refer to User’s Guide)/
Close paper door to clear error/
Place printer in correct mode
Allow print head to cool off: restart print
temperature recommended is 75oC
Cycle printer power to continue
58
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.