Oneil microFlash2 User manual

The most reliable portable printers available for distribution,
retail, manufacturing, law enforcement, utilities, transportation,
and an extensive range of business services.
“We’ve earned our reputation
by building and supporting the
most reliable portable printers
in the industry. O’Neil printers
are engineered with one goal
in mind: to keep on working…
and they do!”
O’Neil Programming
Language Reference Manual

O’Neil Product Development, Inc.
8 Mason
Irvine, CA 92618
Tel: (949) 458-0500
Fax: (949) 458-0708
www.oneilprinters.com
Copyright © 2006
O’Neil Product Development, Inc.
All rights reserved.
This manual and any examples contained herein are provided ‘as is’ and are subject to
change without notice. O'Neil Product Development, Inc. makes no warranty of any kind
with regard to this manual, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose. O'Neil Product Development, Inc.
shall not be liable for any errors or for incidental or consequential damages in connection
with the furnishing, performance, or use of this manual or the examples herein.
This guide is copyrighted. All rights are reserved. This guide may not, in whole or in part,
be reproduced, translated, stored in a retrieval system or transmitted in any form or by
any means, electronic, mechanical, photographic, or otherwise, without prior written
consent of O'Neil Product Development, Inc.
microFlashis a trademark of O' Neil Product Development, Inc. All other brand names
and product names shown in this manual are tradenames, trademarks, or registered
trademarks of the respective manufacturers or distributors of those products.
Part Number Revision Date Description
110200-001 1.2 9/11/2006 Changed the name of the document to O'Neil Programming
Language Reference Manual.
110200-001 1.1 3/6/2006 Formatting changes: Added revision history; added cross-references
to Fonts document.
110200-001 1.0 2/2006 Initial release.


3
O’Neil Programming Language Reference Manual
Introduction 5
Overview of Printing Modes 5
Line Printer Mode 5
Easy Print Mode 5
Using This Guide 6
Document Conventions 6
Graphic Conventions 7
Using Line Printer Mode 8
Overview of Line Printer Mode 8
Line Printer Commands 8
Using Easy Print Mode 15
Overview 15
Easy Print Commands: General Guidelines 17
Sample Easy Print Job 17
Easy Print Commands 18
Ahead Command 18
Back Command 18
Line Printer Mode 19
Self-Test Printout 19
Status 19
Initial Program Load 19
Easy Print: Using the Print Command 20
Print Command: Guidelines 21
Print Command: Specifying Global Options 21
Print Command: Customizing Fonts 23
Font Names 23
Font Field Options 23
Print Command: Customizing Bar Codes 24
Bar Code Names 24
Bar Code Field Options 24
Using PDF-417 Symbols 25
Print Command: Customizing Graphic Names 26
Graphic Names 26
Graphic Field Options 26
Print Command: Customizing Line Names 26
Line Names 26
Easy Print: Using Configuration Commands 27
Creating Configuration Command Files 27
Two-Letter Configuration Commands 27
Three-Letter Configuration Commands 32
Table of Contents

Table of contents (continued)
4
O’Neil Programming Language Reference Manual
Querying the Printer 41
Overview 41
Sending Queries 41
Interpreting Query Replies 41
Query Formats 41
Query Commands 42
Status Query 43
Status Reply Explanation 43
Print Job Status Query 45
Print Job Status Reply Explanation 46
Configuration Query 47
Configuration Reply Explanation 48
Battery Query 49
Version Query 49
Version Reply Explanation 50
Memory Query 50
Memory Reply Explanation 50
Printhead Query 51
Printhead Reply Explanation 51
Infrared Query 52
Infrared Reply Explanation 53
Font Query 55
Fonts Reply Explanation 55
Graphics Query 56
Graphics Reply Explanation 56
Formats Query 57
Formats Reply Explanation 57
802.11b/TCP/IP Query 57
802.11b/TCP/IP Reply Explanation 58
Bluetooth Query 59
Bluetooth Reply Explanation 60
Magnetic Card Configuration Query 61
Magnetic Card Configuration Reply Explanation 61
Magnetic Card Read Query 62
Magnetic Card Read Reply Explanation 62
Card Reader Status Query 63
Card Reader Status Reply Explanation 63
Label Configuration Query 64
Manufacturing Date Query: ESC{MD?} 64
Serial Number Query: ESC {SN?} 65
Demand Quantity Query 65
Cancel Query 65
Reset Query 65
Table of Contents 66

5
1
O’Neil Programming Language Reference Manual
Introduction
The O'Neil Quick Reference Programmer's Guide is a reference guide for O'Neil printers. This
programming guide documents the functions and features of the printer's programming
language.
Overview of Printing Modes
O'Neil thermal printers support several different printing protocols. The two native protocols
are Line Printer and Easy Print. Each of these protocols have their own unique advantages
depending upon what is to be printed. It is also possible to mix Line Printer and Easy Print in
a single printed image. In addition to these two modes, there are also several emulation
modes. These emulation protocols are covered in separate documents.
Line Printer Mode
The Line Printer mode is the simplest method of printing. Each line to be printed is sent to
the printer as a sequence of single bytes (some Asian character sets require two bytes for
each character). The printer accepts characters and begins to print when a Carriage Return
(0x0D) or Line Feed (0x0A) is received. Then all characters received to that point are printed
on a single line. A series of ESCape code sequences can be sent to the printer to alter the
look of the characters (e.g. to make them double wide, or to change the font, or to change
other aspects of the appearance of the printout). You can also have the printer re-align if you
are using stocks with a "Q" or alignment mark.
Easy Print Mode
The Easy Print mode is a much more powerful method of printing. Easy print is actually a
printing protocol that lets you give commands to the printer (such as PRINT). Within that
protocol, you can tell the printer how to print that data (e.g. using a variety of fonts, or as a
bar code), exactly where to put the data (anywhere on the printed image down to .005"),
and how to modify the data (e.g. tall, wide, rotated). And you can store graphics images
such as logos or icons to be used anywhere on the printed image. If you are printing on pre-
cut labels, you can use a pre-printed "Q" mark or the gap between labels to re-align after
each image is printed.
Note:
The commands documented in this programmer's guide are available
depending upon which version of firmware is installed on your printer and which
printer you are using. To determine which version of the firmware you are
using, print a self-test. The self-test printout lists information about your
printer's configuration, options, etc.

Introduction
6
O’Neil Programming Language Reference Manual
Using This Guide
• Click the buttons at the top of each page as follows:
•IntheTable of Contents, click on a chapter or a heading to go to the page indicated.
•IntheIndex, click on a page number to go to the page indicated.
Document Conventions
Contents: Go to the first page of the Table of Contents
Index: Go to the first page of the Index.
Help: Go to this page.
Italics Indicates directory names, references to other resources, a value to be
entered, and emphasis.
Example:
Bold
Indicates a window name, field name, or option.
Example:
TO PRINT LINE PRINTER EASY PRINT EMULATION
Bar Codes X
Complex image (exact text/barcode/graphic
positioning important) X
Line after line of text (receipts or invoice) X
Graphics (one time – not stored) including
captured signatures X
Graphics (stored) X
Labels (Butt cut or Die Cut) with alignment “Q”
mark or gap between labels X (Text Only) X (Complex)
Pre-Printed “fill in the blank” form X
Rotated image X
Rotated areas on image X
Use O’Neil printer in system meant for another
make of printer X

2
8
O’Neil Programming Language Reference Manual
Using Line Printer Mode
Overview
Line printer mode is the simplest protocol supported by the O'Neil thermal printers. Using
Line Printer mode, you can send a line of text as a sequence of characters to the printer
followed by a carriage return (0x0D), and/or a line feed (0x0A), or a form feed (0x0C) and
the printer prints that line of text. Commands can be used to change the way the printout
looks and to select different fonts (fonts are available as the common IBM PC Code Page 437
mapping as well as many other mappings and international character sets). For more
information on fonts, refer to the O'Neil Portable Printers Fonts Guide.
Commands are usually either a single non-printable character, or a sequence of characters
beginning with a non printable character such as ESCape (0x1b). Although these commands
can be placed anywhere in the text, they will usually take effect exactly where they are
placed. So you must be careful to place them where you want the effect to take place. For
example, to change fonts you send ESC w n, where 'n' is the single character name of the
font (seen AN-3 or AN-12). If you do this at the beginning of the line, it will affect the entire
line. But if you place this in the center of a line, it will affect only those characters that come
after. If you place this at the end of the line, it will have no effect on that line at all, but will
affect the next line.
Use Line Printer mode to print receipts and labels with text and simple, bitmap, graphics that
do not need to be stored. You can also use Line Printer mode to insert signatures.
Line Printer Commands
The following table lists Line Printer commands:
Note: This chapter assumes a basic knowledge of computer programming and is
designed to be used by programmers, software engineers, and technicians.
Command Description Page
ESC C n Sets form length. Range for nis 1-255. 9
ESC A n Sets interline spacing; n=0 (default). 9
CAN Cancels buffer line 9
ESC V n1 n2 Bit-mapped graphics mode select 10
ESC B Begins acceptance of compressed graphics 11
ESC E Ends acceptance of compressed graphics 11
SO Sets double wide print 11
SI Condensed print 11
FF Form feed 12
LF Line feed 12
CR Carriage return 12
ESC w n
Font select. The range for nis 21-26 hex. 12
ESC @ Resets the printer 12

Chapter 2: Using Line Printer Mode
9
O’Neil Programming Language Reference Manual
ESC Hn Multiplies the height ntimes 13
ESC Q n1n2 Advances n1n2 from the Q mark. For more
information about the Q mark, refer to Specifications
in the O'Neil Thermal Programming Guide.
13
ESC R n International font selection 13
ESC ! n Sets double wide and double high 13
ESC EZ Goes to Easy Print Mode 14
Note: Line Printer commands are case-sensitive. Make sure you use the correct
case when entering commands. An n indicates binary numbers, not ASCII
characters. For more information, see the individual command(s).
Esc C n Set Form Length
Format ESC C n
Dec 27 67 n
Hex 1B 43 n
Function Sets the page length in character lines. In the command
format, nrepresents the number of lines in the form and nis
a single byte. The default for nis 20 decimal, 14
hexadecimal. The range for nis 1-255.
Esc A n Set Interline Spacing
Format ESC A n
Dec 27 65 n
Hex 1B 41 n
Function Sets the number of blank dotlines that are fed between
character lines. The printer adds n(eight-bit binary number)
blank lines after completing the current line(s) and before
printing the next line.
The default value for nis zero where nequals the number of
inter-character blank dotlines in a single character. The range
for nis 1-155.
CAN Cancel Line Buffer
Format CAN
Dec 24
Hex 18
Function Cancels the character received on the currently forming, but
not yet printed, line.

Chapter 2: Using Line Printer Mode
10
O’Neil Programming Language Reference Manual
Esc V n1 n2 Bit-Mapped Graphics
Format ESC V n1 n2
Dec 27 86 n1n2
Hex 1B 56 n1n2
Function Prints the next (n1*256 + n2) dotlines as bit-mapped
graphics. n1n2 form a 16-bit binary number set, the most
significant byte first. Used to print user-generated bitmap
graphics across the width of the printhead. After receipt of this
command, the printer dumps the binary data directly to the
printhead. As customary with bitmap data, a 1bit indicates a
dot is on, 0bit indicates the dot is off. Graphics printed using
this command must be the exact width of the head in bits. Bit
7of the first byte of data received prints at the left-most dot
on the head as you view the printhead with the paper feeding
away from you. The printer remains in
bit-mapped graphics mode until the total amount of bytes
necessary to fill n1n2 lines of print are received by the printer.
Use the following table for guidelines when adding a bit-
mapped graphic.
Printer Type Dots
Across
Bytes
Across
Dots Per Inch
microFlash2 384 48 203
microFlash3 576 72 203
microFlash4t/4tCR 832 104 203
microFlash2t/2tCR 384 48 203
microFlash2i/2iCR 240 30 127 Horizontal
69 Vertical

Chapter 2: Using Line Printer Mode
11
O’Neil Programming Language Reference Manual
Esc B, ESC E Accept Compressed Graphics
Format ESC B ESC E
Dec 27 66 27 69
Hex 1B 42 1B 45
Function Accepts compressed graphics. The printer decompresses and
prints the graphic.
Each compressed dotline (using a run-length encoding
scheme) is preceded by an uppercase G. Each uncompressed
dotline is preceded by an uppercase U. Vertical white space
(where several consecutive dotlines have not been printing) is
processed using an uppercase Afollowed by a single byte
count of the number of dotlines to advance.
Compressed dotlines use a single graphics byte, followed by
the number of times the byte is repeated. After the
compressed graphics data command (ESC B) is received,
each dotline must be preceded by the Gor U, or an Amay be
sent followed by the number of lines to advance.
When all data is sent, the final bytes must be ESC E to exit
compressed graphics data.
Compressed graphics mode requires a graphic image the
same width as the printhead in use.
Note: The microFlash3 printer has 576 bits across a single
line; the microFlash2/2t has 384 bits and the microFlash2i
has 240 bits microFlash4t has 832 bits across a single line.
SO Set Double Wide Print
Format SO
Dec 14
Hex OE
Function Prints the current font in double wide width until an SI (Set
Single Wide Print) command is received or a carriage return
is received.
SI Set Single Wide Print
Format SI
Dec 15
Hex OF
Function Prints the current font in single width.

Chapter 2: Using Line Printer Mode
12
O’Neil Programming Language Reference Manual
FF Form Feed
Format FF
Dec 12
Hex 0C
Function Prints the current line, then advances the paper to top of
form (TOF).
LF Line Feed
Format LF
Dec 10
Hex 0A
Function Prints the current line and advances the paper.
CR Carriage Return
Format CR
Dec 13
Hex 0D
Function Prints the current line and advances the paper to top of form
(TOF). The CR command is similar to LF; both commands are
provided for your convenience.
Note: To print and advance nlines, use the number of CR
commands, or LF commands, or a combination of CR/LF and
LF/CR commands.
ESC w nSelect Font
Format ESC w n
Dec 27 119 n
Hex 1B 77 A
Function Selects a Line Printer font given n, a binary, eight-bit number.
For more information on fonts, refer to the O'Neil Portable
Printers Fonts Guide.
ESC @ Reset Printer
Format ESC @
Dec 27 64
Hex 1B 40
Function Resets the printer to defaults.

Chapter 2: Using Line Printer Mode
13
O’Neil Programming Language Reference Manual
Note: Use the following Easy Print command to return to Line Printer
mode while in Easy Print mode. {LP} is not a Line Printer command.
If you mistakenly use {LP} while in Line Printer mode, {LP} prints on
your receipt or label.
Format: {LP}
ESC Hn Heighten Font nTimes
Format ESC Hn
Dec 27 72 n
Hex 1B 48 n
Function Multiplies the height of the font by n. Must apply to the entire
line.
ESC Q n1n2 Advance n1n2 from Q mark
Format ESC Q n1n2
Dec 27 81 n
Hex 1B 51 n
Function Advances the paper n1n2 dotlines from the Q mark. For
information on the Q mark, refer to Specifications in the
O'Neil Thermal Programming Guide.
ESC R n Select International Character Set
Format ESC R n
Dec 27 82 n
Hex 1B 52 n
Function Select international character sets.
Note: The common IBM Code page 437 with 224 characters
must be used.
0=USA 4=Denmark
1= France 5=Sweden
2=Germany 6=Italy
3=UK 7=Spain
ESC !n Set Double Wide and Double High
Format ESC ! n
Dec 27 33 n
Hex 1B 21 n
Function Selects font height and width for one line. Must apply to
entire line.
n=10h 16d Double high
n=20h 32d Double wide
n=30h 48d Double high and double wide

15
3
O’Neil Programming Language Reference Manual
Using Easy Print Mode
Overview
The Easy Print protocol is much more than just a printing protocol. In its most basic form,
Easy Print mode allows the user to send and execute commands. As part of the command
execution, the printer may return data to the host. In addition to printing, commands also
allow paper motion, configuring, and control of peripherals such as the magnetic and smart
card readers.
All commands begin with an opening "left curly bracket" or '{' (ASCII 0x7C) and end with a
closing "right curly bracket" or '}' (ASCII 0x7D). The commands immediately follows the
opening bracket '{'. A colon ':' separates the command from the data that follows. The
general format of any Easy Print command is: {[COMMAND]<:DATA>}.
Easy Print mode controls the printer down to a single dotline. At the printer's resolution of 8
dots per mm, or approximately 200 dots per inch, one dotline is approximately .005". Most
dimensions in Easy Print are in dotlines. For example, a simple command that allows paper to
advance or retract would be {AHEAD:200} or {BACK:50} (the command AHEAD or BACK is
followed by the number of dotlines to move paper).
Easy Print commands are categorized as follows:
• Paper movement and misc.
• Toggle Protocols
•Printing
• Downloading Fonts and Graphics
• Configuration

16
Chapter 3: Using Easy Print Mode
O’Neil Programming Language Reference Manual
You can use Easy Print mode to design custom receipts, tickets, or reports with borders,
lines, stored graphics, logos, bar codes, and text. For example, you can create a receipt with
your company logo at the top, an identifying bar code in the middle, and a signature line at
the bottom. Easy Print mode also allows you to use stored graphics, thus increasing your
print speed.
You can also use Easy Print mode to create images that are missing variable data which can
be inserted when the image prints. For example, if a graphic is used multiple times on a
receipt, ticket, or report, use Easy Print mode to store the graphic in Flash memory,
minimizing the communication time between the printer and the host computer and
increasing your print speed. Depending on the size of the format and the amount of memory
available in your microFlash printer (1M or 4M), up to 100 different formats can be stored in
internal memory. Only variable data is then sent from the handheld computer to the printer.
This chapter contains the following information:
•Easy Print Commands
•Easy Print: Using the Print Command
•Easy Print: Using Configuration Commands
COMMAND MEANING ORIGINAL
MF2/MF3/2t/4t
RADIO READY
2t/3l/4t
PAPER MOVEMENT
AHEAD:nnn Advances paper by nnn dotlines X X
BACK:nnn Retracts paper by nnn dotlines X X
S Status (returns a fixed status string) X X
SWITCH PROTOCOLS
DP Puts printer into configured default
protocol X
LP Puts printer into Line Printer mode X X
ESC Synonym for LP X
EMZn Puts printer into emulation mode EMZn
(where n = 1, 2, 3 etc,) X
EMCn Puts printer into emulation mode EMCn
(where n = 1, 2, 3 etc.) X
EMPn Puts printer into emulation mode EMPn
(where n =1, 2, 3 etc.) X
PRINTING
TP Prints a self test printout (does not
require any data) X X
PRINT:data
Prints the data received. Note that the
data must be in a particular format (see
AN07 for Printing With Easy Print
X X
DOWNLOADING FONTS AND GRAPHICS
Easy print is used for downloading fonts and graphics. It is best to use the Windows
Configuration Program or the OPDI Suite for downloading, rather than attempt to write the code
yourself. Other Application Notes describe this process in detail
CONFIGURATION
Easy Print is used to set configuration values into the printer. More detailed information is given
in other Application Notes

17
Chapter 3: Using Easy Print Mode
O’Neil Programming Language Reference Manual
Easy Print Commands: General Guidelines
Use the following guidelines when entering Easy Print commands:
• Easy Print commands appear as {Command:Information} where Information
indicates a set of instructions needed by the printer to carry out a command. Not all
Easy Print commands require a set of instructions to carry out a command. Some
commands, such as {LP}, contain only a few characters with no additional
instructions. To determine if a command needs additional instructions, see the specific
Easy Print command on page 18.
• Some Easy Print commands, such as the Print command, require a complex set of
instructions to carry out a command. For more information about the Print command,
see Easy Print: Using the Print Command.
• If the printer is asleep, null characters must precede Easy Print or Line Printer
commands. If the printer is awake in either mode, do not precede a command with
null characters.
• Always use Easy Print mode for graphics that are used multiple times, such as a
company logo.
• Do not insert spaces in a command unless they are part of the data. For information
on the data, see Easy Print: Using the Print Command.
• All commands must be entered in uppercase.
Sample Easy Print Job
Note 1: This chapter assumes a basic knowledge of computer programming and is
designed to be used by programmers, software engineers, and technicians.
Note 2: To switch between Easy Print and Line Printer modes, enter ESC EZ to go to
Easy Print mode. To switch from Easy Print mode to Line Printer mode, enter {LP}.

18
Chapter 3: Using Easy Print Mode
O’Neil Programming Language Reference Manual
Easy Print Commands
Easy Print commands have a unique format and function. All but the Query class of
commands are documented on the following pages. For information on queries, refer to
Querying the Printer in the O'Neil Thermal Programming Guide.
The following table lists available Easy Print commands:
Ahead Command
Back Command
Note:
In this chapter, an nindicates ASCII numbers, not binary numbers. For more
information, see the specific command listed in the table below.
Command Page
Ahead 18
Back 18
LP 18
Self-Test Printout 18
Status 18
Initial Program Load 19
Print Commands 20
Configuration 27
Ahead Command Format {AHEAD:nnn}
{
A left bracket begins the command set.
AHEAD:nnn
AHEAD:nnn or Ahead:nnn or A:nnn advances the paper
by nnn dotlines. Use the Ahead command as an
alternative to manually advancing the paper. The range
for nnn is 1 to 65,000 dotlines.
}
A right bracket ends the command set.
Back Command Format {BACK:nnn}
{
A left bracket begins the command set.
BACK:nnn
BACK:nnn or Back:nnn or B:nnn backs the paper by nnn
dotlines. Use the BACK command to reposition the edge of
the paper for minimum paper waste.
}
A right bracket ends the command set.

19
Chapter 3: Using Easy Print Mode
O’Neil Programming Language Reference Manual
Line Printer Mode
Self-Test Printout
Status
Initial Program Load
Line Printer Mode {LP}
{
A left bracket begins the command set.
LP
LP puts the printer into Line Printer mode.
Note:
Do not send additional characters for 500ms (is this
the time period?) after sending this command (need more
info. Why not?)
}
A right bracket ends the command set.
Self-test Printout {TP}
{
A left bracket begins the command set.
TP
TP commands a self-test printout.
}
A right bracket ends the command set.
Limited Self-test Printout {TP1}
{
A left bracket begins the command set.
TP1
TP1 commands a limited self-test printout.
}
A right bracket ends the command set.
Status {S}
{
A left bracket begins the command set.
S
Returns an Easy Print status string.
}
A right bracket ends the command set.
Initial Program Load {IPL:0xAA55}
{
A left bracket begins the command set.
IPL:0xAA55
Erases the .BIN printer application file. This command is
used in preparation to reload a new file.
}
A right bracket ends the command set.
This manual suits for next models
7
Table of contents
Other Oneil Label Maker manuals