ABLE Ap1400 Manual

The Experts in Small Printer Solutions
Programmer Guide
Ap1400
Thermal Printer
Able Systems Limited Denton Drive, Northwich, Cheshire CW9 7TU England
Tel: +44 (0) 1606 48621 Fax: +44 (0) 1606 44903 Web: www.able-systems.com

Ref: "Ap1400ProgGuide1_2.docx" Page 2 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
1. Table of Contents
1.
Table of Contents.........................................................................................................................2
2.
Introduction...................................................................................................................................3
Notes on Printer Firmware Revisions (Including Flash).......................................................................3
Copyright Notice and Disclaimer..........................................................................................................3
3.
Modes of Operation......................................................................................................................4
Paper Feed Button...............................................................................................................................4
Printing Method....................................................................................................................................4
Built-In Fonts........................................................................................................................................5
User Font..............................................................................................................................................5
Multiple Code Page Fonts....................................................................................................................5
Dot Addressable Graphics...................................................................................................................5
Serial Interface.....................................................................................................................................6
Data Buffer and Flow Control...............................................................................................................6
USB Interface.......................................................................................................................................7
Paper Out, Paper Low and Head Up Sensors.....................................................................................7
4.
Control Code Tables ....................................................................................................................8
Command Description Format.............................................................................................................8
Command Codes Received.................................................................................................................9
Graphics Commands .........................................................................................................................10
Formatting Commands.......................................................................................................................11
Formatting Commands (Continued)...................................................................................................12
Initialise and Request Status Commands..........................................................................................13
Initialise and Request Status Commands (Continued)......................................................................14
Barcode Commands ..........................................................................................................................15
Mark Sense Operation .......................................................................................................................15
Reserved Commands ........................................................................................................................15
Codes Transmitted.............................................................................................................................16
5.
Settings and Configuration .......................................................................................................17
Setting Configuration Information.......................................................................................................17
Saving Configuration Information.......................................................................................................19
Querying Configuration Information...................................................................................................20
6.
Command Summaries ...............................................................................................................21
Summary of Print Format Commands and Volatile Settings .............................................................21
Summary of Real Time Status Information........................................................................................21
Summary Of Non-Volatile Settings ....................................................................................................22
7.
Setting up USB functionality.....................................................................................................23
Installing LIBUSB. ..............................................................................................................................23
Installing USBPrintDll.........................................................................................................................24
Manual install of the USBPrintDll.......................................................................................................24
Testing the LIBUSB install. ................................................................................................................25
8.
The USBPrintDLL interface. ......................................................................................................26

Ref: "Ap1400ProgGuide1_2.docx" Page 3 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
2. Introduction
This Programmers Guide provides a description of the software commands supported by the Ap1400
series panel mounting printers. This includes the:
•Ap1400 : Panel Mounting Printer (4.5V to 8.5V DC input)
•Ap1400V : Panel Mounting Printer (9V to 36V DC input)
An Installers’ Guide, which contains connection data and details of operation, is available from Able
Systems and should be read in conjunction with this document.
Throughout this Programmers Guide the term "Printer" should be taken to refer to any of the
printers in the Ap1400 range.
If individual products differ in some important aspect, then this is noted.
A wide range of software commands are supported, allowing control of printing format (e.g. width,
height and spacing of text, underlining, text orientation etc.), as well as selection of modes of
operation (e.g. Serial Comms settings, Paper Out, Paper Low and Head Up indications and actions
etc).
Many of the software commands are emulations of the EPSON TM-Series ESCPOS codes. Since
the implementation of ESCPOS varies from one EPSON printer to another, there is no universal
standard. The command set for these products has primarily been based on that of the EPSON TM-T
Series of thermal printers. Please refer to the acknowledgement and disclaimer.
Notes on Printer Firmware Revisions (Including Flash)
Able Systems reserves the right to modify and improve the firmware in its products at any time.
Whilst every effort is made to ensure backward compatibility, no guarantee in this respect is given or
implied.
These products include a flash re-programmable microcontroller. This allows firmware upgrades
under customer control. A Flash Programming Utility is available to aid the user in re-flashing
printers.
Also available is a Font Editor Utility, which allows the user to design and use bespoke fonts as
required. User created or modified fonts may be flashed into the printer using the same Flash
Programming Utility.
Refer to the factory for more information on these features.
Some host-selectable features may be retained during power loss by saving them to non-volatile
memory (FLASH). The user must ensure that any changes to the printer's internal parameters are
saved to flash memory, either manually or by timed auto-save. Refer to section 5.3 SAVING
CONFIGURATION INFORMATION for more details.
Copyright Notice and Disclaimer
Copyright subsists in all Able Systems intellectual property, including controller firmware (embedded
software) and circuit diagrams, pin connection lists and application data. No warranty in respect of
patent rights of Able Systems Limited or of third parties is given. Unauthorised reproduction or
amendment of controller firmware may result in prosecution.
Able Systems does not assume responsibility for interchangeable functionality of other parties'
command sets.

Ref: "Ap1400ProgGuide1_2.docx" Page 4 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
3. Modes of Operation
Please refer to the Installers’ Guide for an overview of the modes of operation, including idle mode
and spool mode (where applicable).
Some of the host-selectable features may be retained during power off by storage in non-volatile
memory (FLASH), but the others are lost. This is clearly shown in the individual command
descriptions below. The user must ensure that any changes to the printer’s internal parameters are
saved to non-volatile memory (FLASH), either manually or by timed auto-save.
Operational status is indicated by factory-programmable colour combinations on the front-panel LED.
These can indicate input voltage, buffer mode, paper status and so on. Refer to the User Guide for
details.
Paper Feed Button
No external power switch is fitted, so additional functions have been assigned to the paper feed
button.
A single press and release of the button:
- in idle or spooling mode, advances paper, also prints any partial line data from the buffer;
"Double-clicking" the button:
- in idle mode, prints a demo/test message including the firmware version, encoded calibration
data, and optionally the full character set and sample bar codes;
- in spooling mode, prints any stored data and enters idle mode.
Double-clicking means pressing and releasing twice in quick succession, in a similar manner to a PC
mouse.
Some functions of the paper feed button can be invoked or disabled by the host. The button is also
disabled for 0.25 seconds after each data byte is received, to prevent the user from prematurely
printing partial lines (Data from the host will generally be continuous).
Printing Method
Each printer mechanism has 384 horizontally-arranged elements, printing a single dot line across the
full width of the paper at once. The paper is advanced past the print head by a rubber platen driven
by a stepper motor. Typical print speed is 60 mm/s at an input voltage of 7 Volts, the maximum is
80mm/s at an input voltage of 8.5 Volts. Each printed dot is nominally 0.125 mm square. The paper
may only be fed through the printer in the forward direction.
It is not possible to print partial lines in isolation: if such a line remains in the buffer, it will not be
printed until flushed out by: a line terminator; some following data; a programmable timeout; or by the
user pressing the paper feed button, if enabled. Once a partial line has been flushed out, it may not
be extended. Any following data will be printed on the next line.
Character lines may be printed in single or double width, single or double height, and underlined.
These three text mode attributes may be combined at will. If single and double height characters are
mixed in a line, the bottom of the characters will be aligned.

Ref: "Ap1400ProgGuide1_2.docx" Page 5 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Built-In Fonts
The built-in font characters are formed according to the Font Mode:
Font
Mode
Chars/Line
Character Height
Row Height
0 32 24 dots (3.00 mm)
30 dots (3.75 mm)
1 42 24 dots (3.00 mm)
30 dots (3.75 mm)
2 24 24 dots (3.00 mm)
30 dots (3.75 mm)
3 32 24 dots (3.00 mm)
24 dots (3.00 mm)
4 48 16 dots (2.00 mm)
19 dots (2.38 mm)
Font Mode 0 is the default factory setting. Character heights refer to the maximum spans of capital
letters and descenders. Row heights refer to the interval from the top of one character row to the top
of the next, including inter-row spacing. The row height may be adjusted if required.
In all of the built-in Font Modes, the character set is the standard IBM
®
character set (also known as
Code Page 437) which includes graphics box-drawing characters. These box-drawing characters are
extended to link up in both axes where appropriate. This character set has been modified to include
the Euro symbol (‘€’) at position 80H (128 Decimal), in place of the usual capital C with cedilla (‘Ç’).
Also, certain special character substitutions are possible for particular applications (e.g.:- switching
the ‘£’ and ‘#’ characters, or including the Nordic 'ø' & 'Ø' characters in place of the ‘¢' & '¥'
characters). See the section on SETTING INTERNAL CONFIGURATION INFORMATION for details.
The Font Mode is normally stored in non-volatile memory (FLASH). This means that the printer can be
pre-configured to operate in 32, 48, 42 or 24 Char/Line modes as applicable.
If required, Font Mode changes may be disabled. See the section on SETTING INTERNAL
CONFIGURATION INFORMATION for details.
User Font
This mode gives access to a single User Font programmed into the printer’s non-volatile memory
using the Flash Programming Utility. The format of the characters in the User Font is defined within
the font itself.
When a User Font is present, the Built-In Fonts, and any character substitutions, are disabled. If the
User Font is subsequently removed, then the Built-In Fonts are re-enabled automatically.
Multiple Code Page Fonts
This kind of User Font consists of multiple code pages resident at ASCII 0x80 to 0xFF. A simple
command can be issued to switch between these pages, providing access to multilingual character
sets.
Dot Addressable Graphics
Several protocols for dot-addressable graphics data are supported:
•Eight (8) dot high graphics are aligned with the top of text characters. In these modes the dot
patterns sent by the host may be doubled-up, tripled-up or quadrupled-up, both horizontally
and vertically before printing. The dot size is nominally 0.25, 0.375 or 0.5 mm square.
•Twenty-four (24) dot high graphics are also aligned with the top of text characters, and are
printed dot-for-bit as sent by the host. The nominal dot size is 0.125 mm square. Successive
blocks can be vertically contiguous only if Font Mode 3 is selected.
•Single dot high graphics are also aligned with the top of text characters. Successive
horizontal dot lines can be vertically contiguous if no other printing is performed between
them.

Ref: "Ap1400ProgGuide1_2.docx" Page 6 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Graphics may be combined with text printing as required. Large areas of solid dots are not
recommended, as they may cause overheating and shorten the head life: try shading.
Serial Interface
The default serial interface format for the Ap1400 series printers is 9600 baud, 8 data bits, 1 stop bit
and no parity. Other formats can be programmed into the printer at the factory or in the field, from the
host. A setup program, suitable for use with a PC, is available from Able Systems to simplify this
process.
Serial data is expected on Rx in RS-232C format with -12V meaning 'mark' or logical '1', and +12V
meaning ‘space’ or logical '0', with reference to the common ground. The serial data output line, Tx,
transmits XON/XOFF and status information to the host at the same baud rate and format as the
serial data input. The hardware busy line, Busy, is true (nominally -12V) when busy.
Some host equipment use a constant space condition (+12V) to indicate a reset condition or wait
state. Some battery powered host equipment present the same output signal when they go to sleep.
By default the printer will interpret this condition as a repetitive receive error, and will print multiple ‘?’
characters to indicate the fault. If required, the printer may be set to ignore this condition.
Data Buffer and Flow Control
The printer has a nominal 10k byte buffer which enables data to be received while previous lines are
being printed. The state of the data buffer is transmitted to the host as follows:
XOFF (13HEX) sent when buffer fills to 3/4 full;
XON (11HEX) sent when buffer empties to 1/4 full; and also after a controller reset.
The hardware busy line is set when 256 bytes of space remains; and incoming data are no longer
passed to the buffer (but may be processed) when 128 bytes remain. The hardware busy line goes
ready again when 384 bytes become free. Note that the buffer can become filled with non-printable
codes, in which case the controller will go busy.
The printer always transmits an XON character when it is powered on and is ready to receive data. It
is not necessary to select hardware or software handshaking. Both are active at all times.

Ref: "Ap1400ProgGuide1_2.docx" Page 7 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
USB Interface
The Ap1400 printer has a full speed USB client interface allowing the unit to be connected to a
Windows based host via USB allowing simple configuration and access. There are two ways of
printing from the Ap1400;
1) Spool printing. This is the way a ‘standard’ desktop printer works and will enable you to print
in the normal way from applications such as Word, Excel or any other application that
supports spool printing. Spool printing requires the installation of windows drivers and allows
all applications access to the printer. To use the Ap1400 as a spool printer you will need to
install the following:
- Ap1400 USB driver
2) API interface. The API interface, takes exclusive control of the printer and allows either text or
graphical printing. In addition, the full printer command set is available to the user allowing
much tighter tailoring of the printed output to suit this form of printer & application
combination. To use the API Interface you will need to install the following:
- LIBUSB
- USBPrintDLL
Please refer to section 7 for details on how to install the correct driver for your application.
Paper Out, Paper Low and Head Up Sensors
The Ap1400 series printers typically use an FTP-628MCL103 print head which has a paper out
sensor and optionally a head up sensor. The reflective optical Paper Out sensor within the
mechanism detects an out-of-paper condition, and/or senses black marks to register with pre-printed
forms. The optional head up sensor is a mechanical switch that detects when the lid is opened.
The printer is set as standard to enter Spool mode when the sensors become active. Spool mode can
be automatically exited, when the sensors become inactive again. This behaviour may be modified.
See the section on SETTING INTERNAL CONFIGURATION INFORMATION for details.
The state of the sensors is reported in the STATUS BYTE.

Ref: "Ap1400ProgGuide1_2.docx" Page 8 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
4. Control Code Tables
General Notes: All codes from 00 to 1F which are not listed below are ignored.
An ESC, GS etc code followed by an unrecognised command is ignored, but any following
parameters are interpreted as normal characters. Any ESC, GS etc sequence which is described
below but which has an illegal parameter is abandoned at that point. The controller will attempt to
interpret subsequent characters as normal characters.
There is no need to follow ESC or GS control code strings with a line terminator. If one is added it will
be interpreted as such.
Most control codes are executed when they fall through the data buffer at printing time. Some ("real
time") codes are interpreted immediately on receipt, so that the printer can respond even if the buffer
is full.
The settings defined in some commands, identified by N, may be stored in non-volatile memory
[FLASH]. All settings are implemented as soon as they are interpreted, except for communication
settings. Newly set values for the Baud rate, parity, data and stop bit parameters are not
implemented until the printer has been cycled.
Command Description Format
In the explanations that follow, commonly recognised labels have been used (e.g. LF, CR, FF, ESC);
command parameters are given as equivalent ASCII characters (e.g. "J"); or as hexadecimal [hex]
values (e.g. 4AH); or decimal numbers (e.g. 74 or n) which are single byte values. Dots (...) mean
more parameters follow.
The command string descriptions are punctuated by commas [,] for clarity, though most versions of
BASIC will use semi-colons [;]. However, these separators will not be transmitted by the host.
As an example, the command to select the underlined printing mode can be expressed in a number of
ways, all of which are equivalent:
ESC, "!" ,n (as in the command description)
27 , 33 ,128 (expressed as decimal character values)
1BH,21H,80H (expressed as hex values)
n is a number, such that if expressed in binary, setting its most significant bit (bit 7) will select the
underline mode.
This expression could be written into a BASIC program as:
10 PRINT#1,CHR$(27);”!Ç”; ...using ASCII characters, or as:
10 PRINT#1,CHR$(27);CHR$(33);CHR$(128); ...using decimal values, or as:
10 PRINT#1,CHR$(&H1B);CHR$(&H21);CHR$(&H80); ...which is equivalent, but using hex.

Ref: "Ap1400ProgGuide1_2.docx" Page 9 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Command Codes Received
The commands detailed below are listed in ascending ASCII code order.
To assist programmers in converting existing host software, the following codes are used:
Fully supported as in EPSON ESCPOS
+ Altered functionality compared with ESCPOS
@ Able special code, no ESCPOS equivalent exists
N Setting may be retained in non-volatile [FLASH] memory
ESC,"L"
1BH,4CH
Enter spooling mode
+
Data and control codes received after this command will be stored in the buffer until either a
command (FF) or GS,L command to exit spooling mode is received, or the paper feed button is
double-clicked by the operator (double-click operation can be disabled by the ESC,c,5.. command).
ESC,"c","5",..
1BH,63H,35H,n
Enable/Disable button functions
+N
n is encoded so:
bit 0 clear (0) Disable paper feed button
bit 0 set (1) Enable paper feed button (default condition)
bit 1 clear (0) Disable double-click demo mode
bit 1 set (1) Enable double-click demo mode (default condition)
Other bits are ignored; the double-click demo mode only functions if the paper feed button is
enabled.
ESC,"X",..
1BH,58H,m..
eX
tended Commands (special to Able
)
@ N
See the section SETTING INTERNAL CONFIGURATION INFORMATION below for format.
ESC,"!",..
1BH,
21H,n
Select printing mode
+N
The third byte n is interpreted as follows:
bit 0 } Select Font Mode 0 to 4
bit 1 } (Mode 0 is factory setting)
bit 2 } (Invalid Font Mode Values are Ignored)
bit 4 Select(1)/Cancel(0) Double height mode
bit 5 Select(1)/Cancel(0) Double width mode
bit 7 Select(1)/Cancel(0) Underlined mode
Bits 3 and 6 are ignored.
Each of these attributes remains in force until actively cancelled. The Font Mode may be stored in
non-volatile memory (FLASH) and retained when the power is cycled. Some older host equipment
may require the Font Mode Select bits to be disabled; See the ESC,"X",09H,n command for details
of how to do this.
Font Modes (0 to 4) cannot be mixed within a single print line: a new line results when the Font
Mode is changed.
ESC,"R
"
, …
1BH,52
H
,n
Select Extended Page
@
N
Font Format 2 and 3 are user font images containing multiple code pages. This command is used to
select one of the code pages in the image.

Ref: "Ap1400ProgGuide1_2.docx" Page 10 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Graphics Commands
ESC,"*",..
1BH,2AH,m,n1,n2,d1...dk
Dot
-
Addressable (Bit) Graphics
+
Several modes of Dot Addressable Graphics are possible:
In all modes dot patterns are coded as 1= dot, 0= space, patterns are arranged in dot-columns, and
the MSBit of each byte is printed at the top. The number of dot columns is given by (n1+ 256*n2).
When the third byte, m=0 or 2 (00H or 02H): Doubled-up 8 dot graphics [ k = n1+ 256*n2 ]
Each 8-dot vertical column is encoded as a single byte. Each dot is doubled in both axes to
0.25 mm square. Successive rows of 8-dot graphics cannot be printed contiguously in the
vertical direction unless using a 16 dot high User Font.
When the third byte, m=3 (03H): Tripled-up 8 dot graphics [ k = n1+ 256*n2 ]
Each 8-dot vertical column is encoded as a single byte. Each dot is tripled in both axes to
0.375 mm square. Successive rows of 8-dot graphics can be printed contiguously in the vertical
direction only in Font Mode 3 or a User Font which is 24 dots high.
When the third byte, m=4 (04H): Quadrupled-up 8 dot graphics [ k = n1+ 256*n2 ]
Each 8-dot vertical column is encoded as a single byte. Each dot is quadrupled in both axes to
0.5 mm square. Successive rows of 8-dot graphics can be printed contiguously in the vertical
direction only in Font Modes 0, 1 or 2 or a User Font which is 32 dots high.
When the third byte, m=32 (20H): Plain 24 dot graphics [ k = 3 x (n1+ 256*n2)]
Each 24-dot vertical column is encoded as three successive bytes. Bytes d1, d4, d7 etc are at
the top of the 24-dot vertical columns. The printed graphic pattern is therefore represented by
the byte numbers as follows: d1 d4 d7 ... d(k-2)
d2 d5 d8 ... d(k-1)
d3 d6 d9 ... dk
Each dot is the mechanism dot size of 0.125 mm square. Significant features should be coded
using at least 2 dots together. Successive rows of 24-dot graphics can be printed contiguously
in the vertical direction only in Font Mode 3 or a User Font which is 24 dots high.
When the third byte, m=8 (08H): Single Dot Line graphics [ k = n1+ 256*n2 ]
Data bytes are printed horizontally in order from left to right across the page, with the Most
Significant Bit to the left. Each byte encodes 8 horizontal dots. Each dot is the mechanism dot
size of 0.125 mm square. Successive horizontal dot rows can be printed contiguously in any
Font Mode only if no other printing occurs between them.
If the print mechanism is allowed to stop between successive contiguous graphics patterns, slight
discontinuities may occur due to mechanical hysteresis. Consider using spool mode to prevent this.

Ref: "Ap1400ProgGuide1_2.docx" Page 11 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Formatting Commands
ESC,"
-
"..
1BH,2DH,n
Turn underline on/off
+
If n=0: Underlining is turned off; otherwise is turned on.
ESC,"2"
1BH,32H
Set default Row Height
Set default row height. ie:-30 (0.125mm) dots in Font Mode 0,1 and 2; 24 dots in Font Mode 3; and
16 dots in Font Mode 4.
ESC,"3",..
1BH,33H,n
Set Row Height
n is the row height. Allowed range: 16 to 99. Row height refers to the interval from the top of one
character row to the top of the next, including inter-row spacing. This setting is retained until
cleared, or the Font Mode is changed or the printer is powered off.
ESC,"D",..
1BH,44H,d1..dk,00
Set horizontal tab positions
+
Up to 6 positions may be recorded, and replace the default settings. If more are given, the first 6
are accepted and normal processing resumes from that point. If less than 6 are given then the
command should be terminated with a NUL(00H) character. Note that tab settings take variable
character spacing into account. Setting is retained until cleared or the printer is powered off.
ESC,"J",..
1BH,4AH,n
Print and feed extra paper
+
n is the count of notional 1/20th print lines to be fed. This command terminates the current line; n is
divided by 20 (remainder discarded) and the quotient used as a count of additional blank single-
height character lines.
ESC,"$",..
1BH,24H,n1,n2
Set absolute print position
+
Position = (n1 + 256*n2) dots from start of line. If printing is currently to the left of this position, blank
space is inserted up to it. If it is to the right, then over-printing can occur, allowing special character
combinations to be formed. Any overflow is cut off at end of line.
ESC,"
\
",..
1BH,5CH,n1,n2
Set relative position
Position = (n1+ 256*n2) dots from current position in text lines. Blank space is inserted up to the
selected dot position. Any overflow is cut off at end of line.
ESC,"d",..
1BH,64H,n
Print and feed n lines
Terminates the current line and feeds n blank print lines
ESC,"{",..
1BH,7B,n
Set/Cancel inverted character printing
n is encoded so:
bit 0 cleared (0) Normal (upright) text
bit 0 set (1) Inverted text
Normal and inverted text cannot be mixed in a single line. This setting is temporary (the default
setting can be redefined by the ESC,X command and stored in non-volatile memory [FLASH]).

Ref: "Ap1400ProgGuide1_2.docx" Page 12 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Formatting Commands (Continued)
HTAB
09H
Horizon
tal Tab
Default positions: 8,16,24,32,40;
6 positions available; programmed using ESC,D command. Ignored if off the end of a line. The first
HTAB does not move from a HTAB position to the next:
e.g.
1234567890123456
123456 T (1 Tab before "T")
1234567T (1 Tab before "T")
1234567 T (2 Tabs before "T")
12345678 T (1 Tab before "T")
LF
0AH
Line Feed
Works in an either/or way with CR: CR/LF pairs are treated as a single line terminator. Line
terminators immediately following full lines are ignored.
FF
0CH
(Real time) Form Feed
+
Exit spooling mode and print buffer contents.
Ignored if the printer is not already in spooling mode or an error condition exists.
CR
0DH
Carriage Retur
n
@
Line terminator: works in an either/or way with LF. CR/LF pairs are treated as a single line
terminator
ESC," ",..
1BH,20H,n
Set right
-
of
-
character spacing
n is the number of additional (note!) dot spaces placed to the right of each character printed.
Default= 0; maximum value= 31. Setting is retained until cleared or the printer is powered off.

Ref: "Ap1400ProgGuide1_2.docx" Page 13 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Initialise and Request Status Commands
ESC,"@"
1BH,40H
Initialise printer
Clears print parameters to power-on default, ie normal width and height, no underline, no extra
space, and default tabs. Does not affect the inverted mode. Not real-time, executed in data
sequence (unlike CAN).
CAN
18H
(Real time) Abort printing and initialise
@
Same result as ESC,'@' but executed immediately when received. A line in progress is allowed to
finish, but printing then continues from data received after the CAN code. Ignored if embedded in
an ESC, GS or graphics sequence.
GS,ENQ
1DH,05H
(Real time) request for printer status
+
This command is executed and the STATUS byte is transmitted immediately on receipt, even if the
printer is busy. See the section CODES TRANSMITTED for format.
GS,"I",..
1DH,49H,n
Request to transmit information
+
See the section QUERYING INTERNAL CONFIGURATION INFORMATION below for format.
GS,"L
"
1DH,4C
H
Exit Spool Mode and Transmit confirmation data
@
If spool mode is entered by ESC, L command and this command is used to exit from spool mode,
confirmation of the number of bytes sent whilst in spool mode will be returned. The sequence on
exiting spool mode is;
(i) Transmit initial confirmation string with data packet information
(ii) Exit Spool Mode
(iii) Print all spooled data from buffer
(iv) Transmit final confirmation string
When the GS,’L’ command is received a 4 byte confirmation string is transmitted by the printer as
follows:
STX ByteCountLo ByteCountHi CheckDigit
[02h] [06h] [00h] [4Fh]
ByteCount is transmitted as two consecutive bytes such that (ByteCountLo + (ByteCountHi x 256) )
gives the actual ByteCount value. In this case, there are 6 data bytes between the ESC,’L’ and
GS,’L’ commands, and the result of a cumulative XOR of each of these 6 bytes yields 4Fh as the
CheckDigit.
The printer then exits from Spool mode and processes the data which has been held in the buffer in
the normal way. Once the data buffer is completely empty and the mechanism is no longer running
(as normally reported by bits 1 and 2 of the STATUS byte), then the packet of data is judged to
have been processed completely. At this point a further confirmation string is transmitted as follows:
ETX ByteCountLo ByteCountHi CheckDigit
[03h] [06h] [00h] [4Fh]
Note that the first byte is STX for the first string and ETX for the second string.
The final 3 bytes are identical in both strings.

Ref: "Ap1400ProgGuide1_2.docx" Page 14 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Initialise and Request Status Commands (Continued)
GS,"a",..
1DH,61H,n
Enable/Disable automatic status
+N
Defines the conditions under which the STATUS byte is transmitted without explicit request from the
host. A bit set in ‘n’ causes the STATUS to be sent whenever the corresponding bit in the STATUS
byte changes state (see CODES TRANSMITTED for format). A value of n=00H disables automatic
reporting, and is the default condition.
ESC,"u",..
1BH,75H,n
Transmit peripheral device status
+
Transmit STATUS byte when decoded. n is discarded; this command is exactly the same as ESC,v
This command is in the buffer when the response is sent, so the buffer will not be reported as
empty. See the section CODES TRANSMITTED below for format.
ESC,"v"
1BH,76H
Transmit printer status
+
Transmit STATUS byte when decoded. This command is in the buffer when the response is sent,
so the buffer will not be reported as empty. See the section CODES for format.

Ref: "Ap1400ProgGuide1_2.docx" Page 15 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Barcode Commands
GS,"H",n
1DH,48H,n
Select automatic text in barcode
n is encoded so:
bit 0 cleared (0) No barcode text above barcode symbol (default)
bit 0 set (1) Print barcode text above barcode symbol
bit 1 cleared (0) No barcode text below barcode symbol (default)
bit 1 set (1) Print barcode text below barcode symbol
This setting is retained and used for all subsequent barcodes, but is cleared to the default when the
printer is powered off.
GS,"h",n
1DH,68H,n
Select height of barcode
+
Height of barcode = (n x 0.125mm) n is valid in the range 1 <= n <= 150.
Default value 100; a zero value is ignored; a value of 150 is used in place of values greater than
150. This setting is retained and used for all subsequent barcodes, but is cleared to the default
when the printer is powered off.
GS,"k",..
1DH,6BH,m,d1..dk,
t
Print barcode using data provided
N.B. This command must always be terminated with value “t” shown below.
The number and type of bytes of data varies with barcode type "m".
Valid m values: Terminator (t)
0: UPC-A Numeric only ASCII data: supply 11 digits 00H
1: UPC-E Numeric only ASCII data: supply 6 digits 00H
2: EAN-13 Numeric only ASCII data: supply 12 digits 00H
3: EAN-8 Numeric only ASCII data: supply 7 digits 00H
4: Code 39 Alphanumeric ASCII data: variable length (Max 22) 00H
5: Int2 of 5 Numeric only ASCII data: variable length (Max 23) 00H
6: Code 128A Alphanumeric ASCII data 0x00 to 0x5F: variable length (Max 14) FFH
7: Code 128B Alphanumeric ASCII data 0x20 to 0x7F: variable length (Max 14) FFH
8: Code 128C Numeric only ASCII data 30H to 39H: variable length (Max 14 bytes) FFH
9: Code 93 Alphanumeric ASCII data 0x00 to 0x7F: variable length (Max 16) FFH
Note that the user should verify that a given barcode will fit on the paper, especially when using the
variable length barcodes. Barcodes may not be mixed with normal text.
GS,"w",n
1DH,77H,n
Select width of barcode
Width of barcode element (narrow bar) = (n x 0.125mm)
n is valid in the range 2 <= n <= 4. Other values are ignored; Default value is 3.
This setting is retained and used for all subsequent barcodes, but is cleared to the default when the
printer is powered off. Note that the user should verify that a given barcode will fit on the paper,
especially when using the variable length barcodes.
Mark Sense Operation
Please refer to the factory for more detailed information before using the Mark Sense feature.
Reserved Commands
In general, commands which are not implemented and described above should not be sent to the
printer, as the outcome may not be as expected. However, some additional EPSON ESCPOS
commands are recognised, and an attempt is made to decode them, so that following commands will
remain in synchronism and correctly interpreted. Please refer to Able Systems in case of difficulty.

Ref: "Ap1400ProgGuide1_2.docx" Page 16 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Codes Transmitted
The printer automatically transmits XON and XOFF bytes when the buffer status changes, as follows:
XON
11H
Start transmission
Meaning: The buffer is ready to receive data.
Transmitted after a reset, or when the data buffer empties to only 1/4 full.
XOFF
13H
Stop transmission
Meaning: The buffer is not ready to receive data.
Transmitted when the data buffer becomes 3/4 full.
In addition the printer can transmit a special STATUS byte, either on request, or optionally when
individual status conditions change state:
The commands ESC,"u",n and ESC,"v" request the STATUS byte be transmitted at the time that the
command is interpreted. (N.B. The buffer is never reported as empty when these commands are
used, as it contains at least this command at the time of transmission).
The command GS,ENQ requests the STATUS byte be transmitted immediately on receipt of the
command, even if the buffer contains large amounts of data yet to be interpreted and/or printed.
The GS,"a",n command specifies individual bits of the STATUS byte which should be monitored, and
result in the STATUS byte being automatically transmitted if a change of state is detected.
[STATUS]
Status Report
The STATUS byte is encoded bitwise:
*bit 0 Head Up Sensor Active? [0= head OK 1= head up ]
bit 1 Mechanism running [0= stopped 1= running ]
bit 2 Data buffer completely empty? [0= not empty 1= empty ]
bit 3 Paper Out Sensor Active? [0= paper OK 1= paper out ]
bit 4 Reserved [ ]
bit 5 Spooling mode? [0= normal 1= spooling ]
bit 6 Error [0= no error 1= error present]
bit 7 Always Set [ Always 1 ]
* Note Head Up sensor optional, status only when fitted
The command GS,"I",n is also a request for information to be transmitted at the time that the
command is interpreted (i.e. not in ‘real-time’). For details of the valid values for n, and the resultant
transmitted information see the QUERYING INTERNAL CONFIGURATION INFORMATION section
below.
If an error condition exists, then the usual single STATUS byte is followed by a second error
identification byte. This second byte is only sent if bit6 of the STATUS byte is set. The values of the
error ID byte are as follows:
Value Error type
80H Mechanism Voltage (Vmech) above upper limit
7FH Mechanism Voltage (Vmech) below lower limit
40H Mechanism Head Temperature above upper limit
Other values are either not defined or represent internal controller hardware errors.

Ref: "Ap1400ProgGuide1_2.docx" Page 17 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
5. Settings and Configuration
The printer maintains a large number of internal settings and configuration information which is not
derived from ESCPOS control codes, and is unique to Able Systems printers.
In general, the ESC,"X",m,... command is used to set these values, and the GS,"I",m command is
used to query them. The following table details all valid combinations of these commands:
(N.B. See the section SAVING CONFIGURATION INFORMATION).
m
ESC,"X",m,...
m
GS,"I",m
3
n1,n2
Report Firmware Version Number
4 eg
"9600,N,8,1",CR Set Baud 4 eg "
9600,N,8,1",CR Report Baud Setting
6
eg "SerialNo",CR
Report Unit Serial Number
9
n1
Set Internal Defaults
9
n1,n2,n3
Report Internal Defaults
15
15
n1,n2,n3
Report Voltage/Temp Data
18
n1..n18
Set LED patterns
18
n1..n18
Report LED patterns
19
n1
Set MT102FLAGS
19
n1
Report MT102FLAGS
20
n1,n2
Set MarkFeed /
EjectFeed
20
n1,n2
Report MarkFeed / EjectFeed
23 n1
Set AUXFLAGS
23 n1
Report AUXFLAGS
33
n1
Set MaxDotsAtOnce
33
n1
Report MaxDotsAtOnce
42 n1 Set EjectOffset
42 n1 Report EjectOffset
48 Save all settings to
Flash
52 n1,n2 Set Auto-Save Period
52 n1,n2 Report Auto-Save Period
66 n1 Set print darkness
66 n1 Report print darkness
110 Produce test print
Setting Configuration Information
N.B. This section contains details of how to modify some of the basic operating functions of
the printer. Do NOT attempt to modify any parameter unless you fully understand the potential
consequences.
The command ESC,"X",m,... may be used to set various internal configuration values according to
the value of m as defined below.
m=4 Select Baud rate, parity, word length and number of stop bits. (Default: “9600,N,8,1”)
Command parameters must have format: e.g."19200,E,8,2", so:
4 or 5 number characters, [the required Baud rate]
1 comma character
1 "N/n/E/e/O/o" letter character, [the required Parity]
1 comma character
1 "7/8" number character, [the required Data bits]
1 comma character
1 "1/2" number character [the required Stop bits]
e.g. To select 19200,E,8,2 the following 14 byte command should be sent:
ESC,"X",04H,"19200,E,8,2"
or as hex codes: 1BH,58H,04H,31H,39H,32H,30H,30H,2CH,45H,2CH,37H,2CH,32H
The Ap1400 accepts the following RS232 baud rates;
1200, 2400, 4800, 9600, 38400, 57600, 115200
It accepts 8 data bits followed by either 1 or 2 stop bits and can use Odd, Even or No parity.
The setting must saved to non-volatile memory (FLASH), and does not come into effect until
after the next printer reset.
m=9 Set Internal Default Values.

Ref: "Ap1400ProgGuide1_2.docx" Page 18 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
The command ESC,"X",09H,n sets the internal default values according to individual bits in
the value of n. In each case, a bit set(1) means the following statement is true:
Bit 0 Default to inverted print mode
Bit 1 Disable FontMode bits of ESC,”!”,n command
Bit 2 Suppress "?" printing on RX error
Bit 3 [Unassigned]
Bit 4 Enable Split dots printing (See MaxDotsAtOnce [m=33] for details)
Bit 5 [Unassigned]
Bit 6 [Unassigned]
Bit 7 [Unassigned]
Note: the setting of bit 0 does not come into effect until after the next printer reset.
m=18 Set LED patterns.
The standard pattern set displayed by the printer has been worked out with a great deal of
care to provide the maximum useful information while remaining clear and unambiguous.
However they may be modified if required. Please refer to Able for details.
m=19 Set MT102FLAGS value.
The command ESC,"X",13H,n sets the internal values according to individual bits in the value
of n. In each case, a bit set(1) means the following statement is true:
Bit 0 [Must be set to enable paper out optical sensor]
Bit 1 Enable Mark Sense Operation
Bit 2 Sense Mark at Black->White or White->Black Edge
Bit 3 [Unassigned]
Bit 4 [Unassigned]
Bit 5 Led Pattern Dependent on Paper Out Sensor
Bit 6 [Must be set to enable head up sensor] (when fitted - optional)
Bit 7 Led Pattern Dependent on Head Up Sensor (when fitted - optional)
The standard setting for this value is: E1H for the Ap1400.
m=20 Set MarkFeed and EjectFeed values.
The command ESC,"X",14H,n1,n2 sets the values of MarkFeed and EjectFeed. These
parameters are used in Mark Sense operation. See MARK SENSE OPERATION section for
details.
m=23 Set AUXFLAGS value.
The command ESC,"X",17H,n sets the internal values according to individual bits in the value
of n. In each case, a bit set(1) means the following statement is true:
Bit 0 Select Short Demo Print
Bit 1 Select swapping
'#' (23H) and '£' (9CH) chars
Bit 2 Select switching in
Nordic 'ø' & 'Ø' chars in place of '¢' (9BH) & '¥' (9DH)
Bit 3 Select original CP437 character 'Ç' in place of new standard '€' (80H)
Bit 4 Select Busy to go active when Paper Out condition seen
Bit 5 [Unassigned]
Bit 6 [Unassigned]
Bit 7 [Unassigned]
m=33 Set MaxDotsAtOnce value.
The command ESC,"X",21H,n sets the value of MaxDotsAtOnce. This value controls the
operation of the printing process to limit the maximum instantaneous current that may be
drawn from the power supply.
Valid values are in the range 01H to 30H. This value equates to the number of dots that may
be energised divided by eight. 01H represents the lowest current draw (i.e. only 8 dots may
be energised at a time), and 30H represents maximum peak current draw (i.e. all dots are
allowed to be energised simultaneously).
The printer automatically slows the paper feeding to allow all the dots to be printed.
Therefore, reducing the value of MaxDotsAtOnce also reduces the overall print speed.
The default value for the Ap1400 is 08H. Refer to the factory if more information is required.

Ref: "Ap1400ProgGuide1_2.docx" Page 19 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
N.B. This value is disabled, and no splitting occurs, if bit4 of Internal Defaults (m=9) is clear.
m=42 Set EjectOffset value.
The command ESC,"X",2AH,n sets the value of EjectOffset. This parameter is used in Mark
Sense operation. See MARK SENSE OPERATION section for details.
m=48 Save all settings to Flash.
The command ESC,"X",30H forces an immediate save of all the configuration settings
to flash. This takes less than a second, but the printer goes busy during the process.
m=52 Set Auto-Save-to-Flash Period.
The command ESC,"X",34H,n1,n2 has the same format as the (m=11) command. By default
the Auto-Save-to-Flash function is disabled (See below for more details).
m=66 Set Print Darkness.
The command ESC,"X",42H,n sets the value of print darkness. This value controls the
operation of the printing process to suit different paper types.
Valid values are in the range 55H to 90H. Increasing the value causes the printed output to
become darker. 55H suits standard thermal paper. 90H suits Linerless paper.
Saving Configuration Information
All configuration information must be saved to Flash if it is to be non-volatile. Ideally, this should be
performed manually by sending the command ESC,"X",30H (see above).
Alternatively, the printer maintains a special timer which will perform an automatic save of the
configuration information after a pre-set period of inactivity. This automatic timed save is normally
disabled, but may be enabled by sending the ESC,"X",34H,n1,n2 command.
Note that during the saving procedure the printer effectively performs a full system reset. Therefore, it
is advised that the save command be issued in isolation (i.e. not embedded in a stream of printable
data).

Ref: "Ap1400ProgGuide1_2.docx" Page 20 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
Querying Configuration Information
In general, for each ESC,"X",m,.. command, the corresponding GS,"I",m command may be used to
query the current value. In some cases the information reported is different from the value(s) set.
m=3 Report Firmware Version.
In response to the command GS,"I",03H the printer transmits 2 packed BCD bytes. The first
byte contains the major and minor version, and the second byte contains the revision number.
eg:- 12H and 34H means Version 1.2.34
m=4 Report Baud rate, parity, word length and number of stop bits.
In response to the command GS,"I",04H the printer transmits a string of ASCII characters in
the same format as used in the ESC,"X",04H,... command. eg:- "19200,E,7,2"
m=6 Report Unit Serial Number.
In response to the command GS,"I",06H the printer transmits a string of up to 10 ASCII
characters terminated by a CR character. eg:- "123456",CR
This is the Unit Serial Number as set by the factory during printer test/setup.
m=9 Report Internal Defaults.
In response to the command GS,"I",09H the printer transmits 3 bytes. The first byte contains
the current values of the flags set using the ESC,"X",09H,n command. The following 2 bytes
are for Able diagnostics only.
m=15 Report Real-Time Voltage and Temperature Values.
In response to the command GS,"I",0FH the printer transmits 2 bytes.
n1 = Supply Voltage x 10 [ eg:- 43H means 6.7V ]
n2 = Printhead temperature in ºC [ eg:- 14H means 20ºC ]
m=18 Report LED patterns.
Please refer to Able for details if required.
m=19 Report MT102FLAGS value.
m=20 Report MarkFeed and EjectFeed values.
m=23 Report AUXFLAGS value.
m=33 Report MaxDotsAtOnce value.
m=42 Report EjectOffset value
m=52 Report Auto-Save Period value
m=66 Report Print Darkness
In response to each of the above commands (in the form GS,"I",m), the printer transmits the
current values of the parameters set using the corresponding ESC,"X",m,… command.
Other manuals for Ap1400
1
This manual suits for next models
1
Table of contents
Other ABLE Printer manuals