Rev. 3.002006/07/13Added baud rate 38400 at page of ESC S n and 5.1 (2)
Revised GS )
Added Chapter 5 to Chapter 10
Added GS z
1. CMP-10 COMMAND SET
CodeCommand FunctionPage
1BELSounds the Buzzer4
2HTHorizontal Tab Command5
3LFPrinting and Paper Feed Command6
4CRPrint one line Command7
5ESC RSSounds the Buzzer7
6ESC SPSetting the right space amount of the
character8
7ESC !Collective Specifying Printing Mode9
8ESC $Specifying the Absolute Positions11
9ESC %Specifying/Canceling Download Character Set12
10ESC &Define user characters13
11ESC *Specifying the Bit Image Mode14
12ESC +Switch OFF the printer17
13ESC –Specifying/ Canceling Underline17
14ESC .Printer self test18
15ESC 2Specifying 1/6-inch line feed rate18
16ESC 3Setting line feed rate of minimum pitch19
17ESC =Data Input Control20
18ESC >Saving current setting21
19ESC ?Reading magnetic stripe reader22
20ESC @Initializing the Printer23
21ESC DSetting Horizontal Tab Position24
22ESC ESpecifying/canceling highlighting25
23ESC GSpecifying/canceling Double Printing26
24ESC JPrinting and feeding paper n/203 inch27
25ESC RSelecting Code table27
26ESC SSetting serial interface communication speed28
27ESC TPrinting Diagnostic information28
28ESC VSpecifying/Canceling 90°-right- turned
Characters29
29ESC YSpecifying print density30
30ESC ZReturning diagnostic information31
31ESC \Specifying the relative positions34
32ESC _Setting the printer in default state34
33ESC `Returning the battery voltage and Printer
Head temperature35
34ESC aAligning the characters36
35ESC c5Enabling/Disabling Panel Switches37
36ESC dPrinting and Feeding the paper by n lines38
37ESC vTransmitting the printer status39
38ESC xSelecting the time interval for automatically
switching Off the printer40
39ESC {Specifying/Canceling the Inverted Characters41
40GS )Setting of printer flags42
41GS *Defining the Download Bit Image (LOGO)43
42GS /Printing the Download, Bit Image44
43GS :Starting/Ending Macro Definition45
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
— 1 —
CodeCommand FunctionPage
44GS HSelecting of Printing Position of HRI Code46
45GS LSetting the left margin47
46GS WSetting the print area width48
47GS ^Executing the Macro50
48GS aEnabling/Disabling
ASB (Automatic Status Back)51
49GS fSelecting the font of HRI characters54
50GS hSelecting the height of the Bar Code55
51GS kPrinting the bar code56
52GS wSelecting the horizontal size (Scale factor) of the Bar Code61
53GS zSaving AT command sequences to send to Bluetooth module62
54ESC lSpecify/canceling black mark function64
55FFPrinting and paper feeding to the black mark position64
* indicates a unique command or a non-compatible command.
*
*
— 2 —
2. COMMAND DETAILS
2.1 Description of Items
XXXXALL
[Function]Command Function
[Code]A sequence of code constituting a command is represented in hexadecimal number
for < >H, binary number for < >B, and decimal number for < >, respectively; [ ]k
represents a repeat count of k-times.
[Range]Indicates an argument value (setting range) for the command in hexadecimal number
(partly in decimal number).
* When used for application other than defined in each control, an error may occur.
Always use in the defined range.
[Outline]Describes a command outline.
[Caution]Describes a caution as required.
[Default]Describes an initial value in hexadecimal number for the command when accompanied
by an argument.
[See Also]Describes the associated commands for use.
[Sample Program]Describes a coding example in the Q-BASIC sample program.
* This example is only for your reference and differs depending on the language
used, version, and so on. For details, see the manual for the language used.
— 3 —
BEL
[Function]Sounds the Buzzer
[Code]<07>H
[Outline]By executing this command the buzzer will beep.
This command functions in the same manner as ESC RS.
— 4 —
HT
[Function]Horizontal Tab Command
[Code]<09>H
[Outline]Shifts the printing position to the next horizontal tab position.
•Ignored when the next horizontal tab position has not been set.
[Caution]• The horizontal tab position is set by ESC D.
•Initial setting of the horizontal tab position is each 8 characters in 9th, 17th, 25th,
columns from FONT A.
AAA ←Print and line feed
BBB ←Print and line feed
←Line feed only
CCC ←Print and line feed
— 6 —
CR
[Function]Print one line Command
[Code ]<0D>H
[Outline]This command is ignored or its action is the same as LF depending on the last
execution of GS ) 2 command (FLAG SETTING COMMAND).
If Flag 2 is 0, carriage return (CR) command is ignored.
If Flag 2 is 1, CR comamnd will act as LF command.
[Default]CR command is ignored. If you want that it acts like LF command set flag 2 to 1 by
GS ) command.
[See Also]GS )
ESC RS
[Function]Sounds the Buzzer
[Code]<1B>H<1E>H
[Outline]By executing this command the buzzer will beep.
This command functions in the same manner as BEL.
— 7 —
ESC SP n
[Function]Setting the right space amount of the character
[Code]<1B>H<20>H<n>
[Range]{0 =< n =< 20(Hex)}
[Outline]The rightward space amount is set in dot unit (1/203 inch unit).
[Caution]The rightward space amount in doublewide mode is made double of the set volume.
m=0: Copy internal character set A to user character set A
(Parameters n1, n2 and d are omitted)
m=1: Copy internal character set B to user character set B
(Parameters n1, n2 and d are omitted)
m=2: For Font A (12 × 24), n1 denotes Start character code and n2 End character
code. Every character is 48 bytes, two bytes for each line. Only the first nibble
of the second byte is used.
m=3: Define character group with ASCII codes between >= n1 and =< n2 for character
set B (9 × 16). Every character is 16 bytes.
[Caution]The data for character set A is composed from left to right and from top to bottom
with two bytes for each horizontal line. The first byte contains the first 8 bits with
the left most bit is MSB. From the second byte only the first nibble (the most significant
4 bits) is valid.
The data for character set B is composed from left to right and from top to bottom
with only one byte for each horizontal line. The nineth bith is alawys 0.
Downloaded characters are valid even after switching off the printer or after issuing
Initialize command.
Download character
Font A (12 × 24)
(Last 4 bits are not used and fixed as zero.)
d1d2d1
d3d4d2
d5d6d3
d7d8d4
d9d10d5
24
Font B (9 × 16)
(9th dot is fixed as space.)
16
d14
d15
d16
d43
d45d46
d47d48
MSBLSB
d44
87654321
— 13 —
00
8 7654321
00
ESC * m n1 n2 [d] k
[Function]Specifying the Bit Image Mode
[Code]<1B>H<2A>H<m><n1><n2> [d] k
[Range]{m= 0, 1, 20, 21(Hex)}
{0 =< n1 =< FF(Hex)}
{0 =< n2 =< 1(Hex)}
{0 =< d =< FF(Hex)}
{k = n1 + FF(Hex) x n2} (m=0, 1(Hex)) Number of bytes containing image data
{k = (n1 + FF(Hex) x n2) x 3} (m=20, 21(Hex)) Number of bytes containing image data
[Outline]According to the number of dots specified in n1, n2, specify the bit image of mode m.
• The No. of dots printed is divided by 256, whose quotient is taken as n2 and residual
as n1.
•Bit image data is sent starting from the top to bootom and from the left to right
(vertical columns scanning). In modes m=0, and 1 only one byteper column is sent
and in mode m-20h, 21h 3 bytes for each column are sent.
•d is bit image data, the bits subject to printing are taken as “1” and those not as
“0”.
• The bit image modes specified by m are shown as follows:
[Function]Specifying the Bit Image Mode (PCX format)
[Code]<1B>H<2A>H<m><n>{<a><00>H} [d]k
[Range]{m= 10, 11 or 12(Hex)}
{0 =< n =< 30(Hex)}
{0 =< a =< 18(Hex)}
{0 =< d =< FF(Hex)}
{0 =< k =< n x 18(Hex)}
[Outline]Designates a bit image of n*8 dots horizontal by 24 or a dots vertical.
Dot density is fixed at 203 dpi both horizontally and vertically.
Bit image mode selected by the value of m is shown in the following table.
m (Hex)Type
10Non-compressed data of 24 dots vertical
(Argument “a” and 00(Hex) are not used.)
11Compressed data of 24 dots vertical
(Argument “a” and 00(Hex) are not used.)
12Compressed data of a dots vertical
n denotes the number of bytes for horizontal size of a bit image.
d denotes a graphic data.
In 10(Hex) mode, data is in n × 24 bytes.
For data in 11(Hex) mode, the size in non-compressed format shall be n × 24 bytes.
For data in 12(Hex) mode, the size in non-compressed format shall be n × a bytes.
Compression system in 11(Hex) and 12(Hex) is the same as that for PCX file format
(monochrome). The printer receives the compressed data, reproduces it in the
following format and prints as bit-image data.
AIf either of upper two bit of input byte is 0, the byte is treated as graphic data.
If both of upper two bit of graphic data to be printed are 0, it is necessary to send
the data to printer in “B” format described below.
B If both of upper two bit of input byte are 0, the remaining 6 bit specifies the times
the data is repeated. The number of times to be repeated is specified in 0-3F(Hex).
The byte follows this byte is treated as graphic data to be repeated.
Graphics data should line up from left to right and from top to bottom.
— 16 —
ESC +
[Function]Switch OFF the printer
[Code]<1B>H<2B>H
[Range]None
[Outline]This command is used for switching off the printer from the host.
Sending this command causes the same operation as that by setting the power switch
to off.
ESC – n
[Function]Specifying/ Canceling Underline
[Code]<1B>H<2D>H<n>
[Range]{0 =< n =< 02(Hex)}
[Outline]Specifying/canceling an underline.
•Types of underlines by n value are shown below:
n (Hex)Type
0Canceling an underline.
1Specifying an underline for 1-dot width.
2Specifying an underline for 2-dots width.
[Caution]• An underline is attached to the full character width. It is, however, not attached to
the part having been skipped by horizontal tab command.
• An underline is not attached to a 90°- right-turned characters.
[Outline]Prints test page, downloaded bit image, and self-diagnostic information. The self-
diagnostic information includes print density, print head temperature, battery voltage,
Serial or IrDA interface, baud rate, and memory switch setting.
[See Also]ESC T
ESC 2
[Function]Specifying 1/6-inch line feed rate
[Code]<1B>H<32>H
[Outline]The line feed rate per line is specified by 1/6 inch.
[Outline]This command saves International character, Serial port baud rate, Print density, Auto
power off time and maximum speed at Infrared communication to NV memory so
that the setting can be resumed automatically when power on after setting data on
RAM memory is gone by like battery is disconnected.
n (Hex)Type
0Max speed at Infrared communication is 115200 bps.
1Max speed at Infrared communication is 57600 bps.
[Caution]Do NOT use this command frequently.
NEVER turn the printer off during command is running. Otherwise there is a risk to
lose the firmware updating function.
Power is turned off automatically when setting is saved.
[Default]n = 0
[See Also]ESC R, ESC S, ESC Y, ESC x
— 21 —
ESC ? n
[Function]Reading magnetic stripe reader
[Code]<1B>H<3F>H<n>
[Range]{0 =< n =< 7(Hex)}
[Outline]When the command is received the bicolor LED is shining in RED and the printer is
waiting for the magnetic card to be swiped through the reader. If even after 10
seconds the card is not swiped the command is aborted automatically.
Printer returns the information read from the tracks followed by 00(Hex).
Reads the data of the track in the following table by the value of n.
n (Hex)Track
0Invalid
1Track 1
2Track 2
3Track 1 and 2
4Track 3
5Invalid
6Track 2 and 3
7Invalid
The format of the data read is as follows.
TrackHeaderCard dataFooter
TrackTrack 1 is F1 (Hex)
Track 2 is F2 (Hex)
Track 3 is F3 (Hex)
HeaderTrack 1: “%”
Track 2: “;”
Track 3: “+” or “;”
Card dataASCII data
Footer“?”
If reading track is more than one (n=3 or 6), footer data of track 1 or 2 is followed by
track data of track 2 or 3.
[Caution]The command for reading multiple tracks at a time may often result in read error.
If reading is unsuccessful, repeat it.
— 22 —
ESC @
[Function]Initializing the Printer
[Code]<1B>H<40>H
[Outline]Clears data stored in the print buffer and brings various settings to the initial state
(Default state). Items not cleared are as shown below.
•Data inside the internal input buffer are not cleared.
• Does not clear any data in the internal input buffer.
• Does not clear downloaded characters.
• Does not clear defined downloaded characters.
• Does not clear defined downloaded bit image.
•Does not clear defined macro.
• Does not clear setting for print density.
• Does not clear baud rate setting of serial port.
• Does not clear valid/invalid setting for panel switch.
• Does not clear ASB mode setting.
• Does not clear setting for auto power-off time.
• Does not clear memory switch.
[Caution]At power off, the following settings are cleared in addition to the items cleared by
this command.
• Clears input buffer.
• Clears macro.
• Return ASB mode according to the memory switch setting.
• “n” indicates the no. of columns from the beginning to the horizontal tab position.
At this time, n= set position – 1 is to be specified. For example, to set the position
at 9th column, n=8 is to be specified.
•k denotes the number of horizontal tab positions you want to set.
• The tab position is set at position where it is “character width × n” from the line
beginning. The character width, at this time, includes the rightward space amount.
In double wide characters, it is made double of the ordinary case.
•Tab positions can be specified are maximum 32. Specifying exceeding this is
ignored. <n> k, which denotes a setting position, is input in the increasing order
and ends at <00> H.
• ESC D NUL clears all the set tab positions. Following clearing, horizontal tab
command is ignored.
[Caution]When the data, <n> k, is equal to or smaller than its preceding data, <n> k-1, it is
assumed that tab setting is finished. If this is the case, the next data onward will be
processed as normal data. When the data, <n> k, exceeds a 1-line print area, set the
horizontal tab position, assuming “Set digit position = Maximum print digits + 1.”
The horizontal tab position does not change even if the character width is altered
after setting the horizontal tab position.
[Default]Initial value is specified every eight characters (9th, 17th, 25th, and on) of Font A.
[See Also]HT
[Sample Program]
[Print Results]See Sample Program and Print Results for HT.
— 24 —
ESC E n
[Function]Specifying/canceling highlighting
[Code]<1B>H<45>H<n>
[Range]{0 =< n =< FF(Hex)}
[Outline]Specifying/canceling the highlighting characters.
[Outline]Sets the communication speed for the serial interface.
The command is valid only when the printer is connected through a serial cable. It is
not valid when using IrDA interface. The last setting is valid even after the printer is
switched OFF.
[Default]The default value is 3 [9600 BPS]
ESC T
[Function]Printing Diagnostic information
[Code]<1B>H<54>H
[Outline]Prints current printer attributes and diagnostics.
[Outline]The printer will return 32 bytes of information with the following structure:
1-22:Printer name up to 22 charachters.
23-25: Firmware version
26-27: Language version, described by two characters.
28-32: When the corresponding bit is 1, the function is supported and when 0, the
function is not supported.
BYTE 28
BIT7
Reserved, always 1
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
IrDA support
Mag stripe reader
Reserved
Katakana support (Characters after 80(Hex))
JIS and SHIFT-JIS Support
Not in use
Not in use
— 31 —
BYTE 29
BIT7
Reserved, always 1
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Update via firmware
interface
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
BYTE 30
BIT7
Reserved, always 1
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
— 32 —
BYTE 31
BIT7
Reserved, always 1
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
BYTE 32
BIT7
Reserved, always 1
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
Not in use
— 33 —
ESC \ n1 n2
[Function]Specifying the relative positions
[Code]<1B>H<5C>H<n1><n2>
[Range]{0 =< n1 =< 255}
{0 =< n2 =< 255}
[Outline]The printing start position is specified in the number of dots (1/203 inch unit) from
the current position.
• Rightward direction is taken as plus and leftward direction as minus.
•To specify N dot in minus (left) direction, use a complement of N for assignment.
•N dots = 65536 – N
• The number of dots is divided by 256, whose quotient is taken as n2 and the residual
as n1.
[Caution]Specifying exceeding the top of line or the end of line is ignored.
[See Also]ESC $
[Sample Program]See Sample Program and Print Results for ESC $.
ESC _
[Function]Setting the printer in default state
[Code]<1B>H<5F>H
[Outline]Sets the printer in default state. The default state is as follows:
• All printing attributes like underline, rotating etc. are cleared.
• Internal font A (12 × 24) is selected.
• Pitch between lines is 1/6 inch.
• Pitch between characters is 0.
• Barcode height is 162 dots, and barcode width is 3.
• All downloaded fonts and bit images are cleared.
• Print density is 100%.
• Communication speed is set to 9600 bps.
• Auto power-off time is set at 5 min.
• Memory switch is set to “all 0”.
[See Also]ESC @
— 34 —
ESC `
[Function]Returning the battery voltage and Printer Head temperature
[Code]<1B>H<60>H
[Outline]When this command is send to CMP-10, the printer will return the current value of
battery voltage and the current temperature of the printer thermal head.
• Battery voltage is returned in the format: battery voltage × 10 + 20H and head
temperature is returned in the format: head temperature + 20H.
[Sample Program]
PRINT #1, CHR$ (&H1B) + “ ` ”;
[Print Results]Suppose the battery voltage is 7.8 volts and head temperature is 40°C.
Then CMP-10 will return <6C>H, <48>H to the host.
This values are calculated as follows:
Volatge: 7.8 × 10 = 78 + 32 =110 which is 6CH.
Temperaure: 40 + 32 = 72 which is 48H.
32 is equal to 20H.
— 35 —
ESC a n
[Function]Aligning the characters
[Code]<1B>H<61>H<n>
[Range]{0 =< n =< 2(Hex)}
[Outline]All the printed data within one line are aligned in the specified position.
Depending on n value, positional alignment is carried out as in the table below:
n (Hex)Position
0Left end alignment
1Centering
2Right end alignment
[Caution]• This is valid only when n is inputted at the beginning of line.
Status sent out consists of 1 byte whose content is as in the table below.
BitFunction
0Not defined
1Not defined
2Paper or paper coverWith paper andNo paper or
3Not defined
4Not usedFixed to 0–
5Not defined
6Not defined
7Not defined
[Caution]In paper end status, this command may be unreceptible state due to BUSY state.
[Sample Program]
OPEN “COM1:N81NN” AS #1 ;
PRINT #1, CHR$ (&H1B) ; “v” ;
A$ = INPUT$ (1, #1) ;
CLOSE #1
END
01
cover closedcover open
Value
— 39 —
ESC x n
[Function]Selecting the time interval for automatically switching Off the printer.
[Code]<1B>H<78>H<n>
[Range]{1 =< n =< 3C(Hex)}
[Outline]Sets the time interval after which the printer will be switched Off automatically if
there is no incoming data through the Serial interface, there is no IrDA communication
and LF button is not pressed. The maximum value for the interval is 60 minutes
<3C>H .
[Default]n = 05(Hex) 5 minutes
[Sample Program]
PRINT #1, CHR$ (&H1B) + “x” + CHR$ (H14);
After executing this command the printer will perform auto power off after 20 minutes,
if there is no IrDA communication and LF button is not pressed.
— 40 —
ESC { n
[Function]Specifying/Canceling the Inverted Characters
[Outline]This model has 8 memory switches and selecting, releasing, and changing a function
is available with this command.
Memory switch setting is retained even after printer power off.
n specifies the number of memory switch to be operated.
m specifies a selection.
The contents of individual memory switches are as shown below.
Memory SwitchOFF (0)ON (1)
1Slach 0Normal 0
2CR is ignoredCR has the same action as LF
3Default font ADefault font B
4Prints “Low Battery”.Does not print “Low Battery”.
5ASB Invalid for defaultASB Valid for default
6Not in use
7IrDA protocol enabledIrDA protocol disabled
8Shift JIS for defaultJIS for default
[Caution]The setting of the changed memory switch is enabled by resetting the power switch.
{1 =< n2 =< F8} Defines the vertical size of downloaded image.
[Outline]Defines downloading bit images of the number of dots specified by n1 and n2.
The numbers of dots are n1 × 8 in horizontal direction and n2 × 8 in vertical direction.
The number of horizontal bytes can be up to 7F, but only the first 48 (30H) bytes will
be printed. The rest will be rejected.
•d indicates bit image data.
• The downloaded bit image thus defined is valid till it is redefined or ESC _ is
executed. After power off, the downloaded bit image is maintained even by the
execution of Initialize command.
[Caution]• This downloaded bit image is also printed at the self-test printing.
• The maximum size of the Bit image cannot exceed 16 KB.
• Relations between the bit image data and the dot defined are shown below.
[See Also]GS /
[Sample Program]
GOSUB IMG
PRINT #1, CHR$ (&H1D) + “/” + CHR$ (0);
PRINT #1, CHR$ (&H1D) + “/” + CHR$ (1);
PRINT #1, CHR$ (&H1D) + “/” + CHR$ (2);
PRINT #1, CHR$ (&H1D) + “/” + CHR$ (3);
END
IMG:
n 1 = 10 : n 2= 50
PRINT #1, CHR$ (&H1D) + “*”;
PRINT #1, CHR$ (n1) + CHR$ (n2);
FOR I=1 TO n2
FOR J=1 TO n1
PRINT #1, CHR$ (J);
NEXT I
NEXT J
RETURN
— 43 —
[Print Results]
GS / m
[Function]Printing the Download, Bit Image
[Code]<1D>H<2F>H<m>
[Range]{0 =< m =< 03(Hex)}
[Outline]Prints download bit image in a mode specified by m.
Means termination when received while defining a macro.
[Caution]• Maximum content available for macro definition is 3328 bytes.
•A portion exceeding 3328 bytes is not defined.
• Even with ESC @ (initialization of the printer) having been executed, defined content
is not cleared. Therefore, it is possible to include ESC @ into the content of macro
definition.
• Normal printing operation is carried out even while in macro definition.
[Outline]This command sets the left margin specified by nL and nH. The value of the left
margin is [(nL + nH × 256) × 1/203] inches.
[Caution]• This command only works when it is entered at the beginning of a line.
• The maximum settable left margin is equal to the horizontal printable area. A
setting greater than this maximum is trimmed to the maximum.
•When mapping character data, if the print area specified is not wide enough to
accommodate one character of the current font, only the line for that character
data is handled as follows:
(1) The print area is extended toward the right to be equivalent to one character of
the current font, but not wider than the printable area.
(2) If an area for one character cannot be provided as a result of step (1), the print
area is extended toward the left. (So, the left margin is decreased.)
• When mapping non-character data (Bit image, downloaded bit image, or bar code),
if the print area specified is narrower than 9-bits, only the line for that data is handled
as follows:
(1) The print area is extended toward the left (So, the left margin is decreased)
until it is 9-dot wide, but not wider than the printable area.
[Default]nL = 0, nH = 0
— 47 —
GS W n
[Function]Setting the print area width
[Code]<1D>H<57>H<nL><nH>
[Range]{0 =< nL =< FF(Hex)}
{0 =< nH =< FF(Hex)}
[Outline]Sets the print area width specified by nL and nH.
• The print area width will be [(nL + nH × 256) × 1/203] inches.
Printable Area
Left MarginPrintable Area With
[Caution]• This command only works when it is entered at the beginning of a line.
• If the value entered with this command exceeds the printable area for one line, the
entire area except the left margin is set as the print area width.
• For calculation of print area width, the basic pitch 1/203 inch for horizontal direction
is used.
(1) The print area is extended toward the right to accommodate the first character,
but not wider than the printable area.
Printable Area
A
Left Margin
Printable Area Width
Extended toward the right
(2) When sufficient area cannot be secured even by executing the processing (1),
the print area is extended to the left (decreasing left margin).
Printable Area
A
Left Margin
(2) xxxx
Printable Area Width
(1) Extended
toward the right
— 48 —
(3) When sufficient area cannot be secured even by executing the processing (2),
the right space is decreased.
• When bit image (or downloaded bit image) is developed, if the print area width is
less than the minimum lateral width of the bit image (2 dots for single density, 1
dot for double density), the following processing is carried out only in the same
line.
(1) Extend the print area to the left (decreases left margin) till it reaches the width
equivalent to the minimum lateral width of bit image within the range of
printable area.
[Default]nL = 40 (Hex), nH = 2 (Hex)
[See Also]GS L
— 49 —
GS ^ n1 n2 n3
[Function]Executing the Macro
[Code]<1D>H<5E>H<n1><n2><n3>
[Range]{0 =< n1 =< FF(Hex)}
{0 =< n2 =< FF(Hex)}
{0 =< n3 =< 1(Hex)}
[Outline]Executing contents defined in macro.
The following items are set for parameters n1 to n3.
n1: The number of times of macro execution
n2: Waiting time on macro execution. Waiting time of n2 × 100 msec is given for
every execution.
n3: Macro execution mode
n (Hex)Mode
0Continuous execution
1Execution by LF switch
Continuous execution: The Macro is executed n1 times continuously at the time
intervals specified by n2.
Execution by LF switch: After waiting for lapse of time specified by n2, the LF switch
is waited to be pressed. When it is pressed, the macro is executed once.
This action is repeated n1 times.
[Caution]• When this command is received while in macro definition, suspension of macro
definition is indicated. At this time, the defined content is cleared.
• No execution takes place when macro is held undefined or n1=0.
• While in macro execution with n3=1, paper feed with the LF switch is not available.
• During execution of a macro, the power cannot be turned off.
[See Also]GS :
[Sample Program]See Sample Program and Print Results for GS :.
— 50 —
GS a n
[Function]Enabling/Disabling ASB (Automatic Status Back)
[Code]<1D>H<61>H<n>
[Range]{0 =< n=< FF(Hex)}
[Outline]This command selects the status item to be addressed by ASB (Automatic Status
Back.)
BitStatus Item Addressed by ABS
0Not defined
1Defining LF button function
2Thermal head temperature status
3Paper end sensor and paper cover open status
4Not defined
5Not defined
6Not defined
7Not defined
BIT7
When this command is executed, the printer will return 4 bytes with status information,
with the follwoing meaning:
BYTE 1
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use (0)
Not in use (0)
Not in use (0)
Not in use (0)
Not in use (1)
Not in use (0)
The paper is fed manually by LF switch
Not in use (0)
— 51 —
BYTE 2
BIT7
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use (0)
Not in use (0)
Not in use (0)
Not in use (1)
Not in use (0)
Not in use (0)
Thermal head is overheated (1)
Not in use (0)
BYTE 3
BIT7
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use (0)
Not in use (1)
No paper or cover open (1)
No paper or cover open (1)
Not in use (0)
Not in use (0)
Not in use (0)
Not in use (0)
— 52 —
BYTE 4
BIT7
BIT6BIT5BIT4BIT3BIT2BIT1BIT0
Not in use (0)
Not in use (0)
Not in use (0)
Not in use (0)
Not in use (1)
Not in use (0)
Not in use (0)
Not in use (0)
[Caution]• If any status item is enabled, the status is sent to the host when this command is
executed. After that time on, the status is sent each time an enabled status item
changes. Because each status item represents the current condition, status items
disabled for ASB may also have changed.
• The ASB function is disabled if all status items are disabled.
• The printer sends 4 bytes of status shown in the tables below, without checking
whether the host is ready to receive or busy. The 4 bytes of status is a continuous
string except for XOFF code.
• Because this command is executed when data is mapped in the receive buffer,
there may be a delay between command receiving and status sending depending
on the condition of the receive buffer.
• Even if the printer is excluded from the selection of peripheral equipment (ESC =),
the 4 bytes of status is sent to the host whenever status changes.
— 53 —
GS f n
[Function]Selecting the font of HRI characters
[Code]<1D>H<66>H<n>
[Range]{n = 0, 1(Hex)}
[Outline]Selecting the font of HRI characters in printing bar code.
The type of font can be selected with “n” as follows:
n (Hex)Font
0Font A (12 × 24)
1Font B (9 × 16)
The HRI characters refer to the bar code-turned characters so that you can read them.
[Caution]The HRI characters are printed at the position specified with GS H.
n denotes the number of dots in the vertical direction.
[Default]n = A2(Hex) 162 dots
[Sample Program]See Sample Program and Print Results for GS w .
— 55 —
GS k m [d1 ..... dk] NUL
GS k m n [d1 ...... dn]
[Function]Printing the bar code
[Code](1) <1D>H<6B>H<m> [d1.....dk] NUL
(2) <1D>H<6B>H<m><n> [d1....dn]
[Range](1) 0 =< m =< 6 The definitions of “k” and “d” vary with the bar code system.
(2) 65 =< m =< 73 The definitions of “n” and “d” vary with the bar code system.
[Outline]Selects a bar code system and prints the bar code.
For (1):
mBar code systemRange of “k”Range of “d”
0UPC-Ak=1148 =< d =< 57
1UPC-Ek=1148 =< d =< 57
2JAN13 (EAN)k=1248 =< d =< 57
3JAN8 (EAN)k=748 =< d =< 57
4CODE391 =< k48 =< d =< 57,
65 =< d =< 90
32, 36, 37, 43, 45,
46, 47
5ITF1 =< k (Must be an48 =< d =< 57
even number)
6CODABAR (NW-7)1 =< k48 =< d =< 57,
65 =< d =< 68
36, 43, 45, 46, 47, 58
For (2):
m(2)Bar code systemRange of “n”Range of “d”
65UPC-An=1148 =< d =< 57
66UPC-En=1148 =< d =< 57
67EAN13 (JAN)n=1248 =< d =< 57
68EAN8 (JAN)n=748 =< d =< 57
69CODE391 =< n48 =< d =< 57,
65 =< d =< 90
32, 36, 37, 43, 45,
46, 47
70ITF1 =< n (Must be an48 =< d =< 57
even number)
71CODABAR1 =< n48 =< d =< 57,
65 =< d =< 68
36, 43, 45, 46, 47,58
72CODE931 =< n0 =< d =< 127
73CODE1281 =< n0 =< d =< 127
— 56 —
[Caution]
For (1):
• This command ends with a NUL code.
• For UPC-A or UPC-E, the bar code is printed when 12 bytes of bar code data have
been entered, and the subsequent data is handled as normal data.
• For JAN13, the bar code is printed when 13 bytes of bar code data have been
entered, and the subsequent data is handled as normal data.
• For JAN8, the bar code is printed when 8 bytes of bar code data have been entered,
and the subsequent data is handled as normal data.
• The data of ITF bar code must have an even number of columns. Should the data
have an odd number of columns, the last column is ignored.
For (2):
• Numeral “n” indicates the number of data items, and the subsequent “n” bytes of
data are handled as bar code data.
• If “n” is out of the range, the processing of the command is aborted, and the
subsequent data is handled as normal data.
For STANDARD MODE:
• If “d” is out of the range, only a paper feed is executed, and the subsequent data is
handled as normal data.
• If the bar code is wider than the print area for one line, the bar code is not printed,
but only a paper feed is executed.
• The amount of paper feed corresponds to the height of the bar code (Including the
HRI characters if HRI character printing is specified), irrespective of the line feed
width set by a command such as ESC 2 or ESC 3.
• This command only works if no data exists in the print buffer. If any data exists in
the print buffer, the data subsequent to “m” is handled as normal data.
• After the bar code is printed, the beginning of the line is taken as the start position
for the next print.
• This command is not affected by any print modes (Emphasis, double strike,
underline, and character size), except for the inverted character mode.
[Description of Bar Codes]
<For print examples, refer to page 56>
UPC-A
This bar code, consisting of numerals only, has a fixed length of 12 columns; a 11column number entered from the host or application software plus a check digit
(12th column) automatically calculated inside the printer. If the 12th-column numeral
is sent from the host, the entire bar code will be printed as it is.
UPC-E
This bar code, consisting of numerals only, has a fixed length of 8 columns; the first
number system character is “0” stationary. A 12-column numeral entered from the
host or application software is compressed to 8 columns with a check digit attached
and then is printed. The 12thcolumn check digit is automatically calculated inside
the printer. If it is and sent from the host, the entire bar code will be printed,
compressed to 8 columns.
JAN-13(EAN)
This bar code, consisting of numerals only, has a fixed length of 13 columns; a 12column number entered from the host or application software plus a check digit
(13th column) automatically calculated inside the printer. If the 13th-column numeral
is sent from the host, the entire bar code will be printed as it is.
— 57 —
JAN-8(EAN)
CODE39
ITF
CODABAR (NW-7)
CODE93
CODE128
This bar code, consisting of numerals only, has a fixed length of 8 columns; a 7column number entered from the host or application software plus a check digit (8th
column) automatically calculated inside the printer. If the 8th-column numeral is
sent from the host, the entire bar code will be printed as it is.
This bar code, consisting of upper-case alphabetic characters and numerals, has a
variable length of columns. The start/stop code “*” is automatically added by the
printer. The available characters include space and “$ % + – • / 0 1 2 3 4 5 6 7 8 9” and
upper-case alphabetic characters.
A check digit is added and printed automatically.
This bar code, consisting of only numerals, has a variable length of even-number
columns. If a code of odd-number columns is sent, the bar code will not be printed.
This bar code, consisting of alphanumerics, has a variable length of columns.
Available characters include “0 1 2 3 4 5 6 7 8 9 A B C D $ + – ./ :”. A start/stop code
is required; any one of A, B, C, and D is used.
This bar code, consisting of alphanumeric and control characters, has a variable length
of columns. The HRI character string is preceded and followed by a “n” character.
HRI characters for control characters (00H - 1FH, and 7FH) are each printed as a
combination of a “n” character and an alphabetic character.
This bar code consists of 103 bar code characters and three code sets, enabling 128
ASCII code characters to be printed. It has a variable length of columns.
• Code set A ASCII characters 00H - 5FH can be represented.
• Code set B ASCII characters 20H - 7FH can be represented.
• Code set C Two-digit numbers 00 - 99 can each be represented by one character.
In addition to the above characters, special characters are available:
• Shift character (SHIFT)
When used in code set A, one character next to a Shift character is treated as a
character of code set B. When used in code set B, one character next to a Shift
character is treated as a character of code set A. The Shift character cannot be
used in code set C.
• Code set select characters (CODE A, CODE B, CODE C):
The code set following a code set select character is switched to code set A, B, or C.
• Function characters (FNC1, FNC2, FNC3, FNC4):
How the function characters are used depends on each application. In code set C,
only FNC1 is available.
— 58 —
When sending print data, note these points:
(1)Each string of bar code data must begin with a code set select character (CODE A,
CODE B, or CODE C), which selects the first code set to use.
(2) Every special character is specified by a combination of two characters: a brace
“{“ followed by one character. A brace “{“ itself is sent twice consecutively.
<Example>
To print “No.” in code set B, followed by “123456” in code set C, send the following
data string:
GS k <73><10><7Bh 42h> “No.” <7Bh 43h><12><34><56>
[Sample Program]
[Print Results]
• If the printer finds a string of bar code data that does not begin with a code set
select character, it immediately aborts the command processing and handles the
subsequent data as normal data.
•If the printer received a character that is not available in the currently selected code
set, it immediately aborts the command processing and handles the subsequent
data as normal data.
• An HRI character corresponding to either a Shift character or a code select character
is not printed. An HRI character for either a function character or a control character
is treated as a space character.
11
alphabets and numerals. The start/stop code
“*” is automatically added.
Even-column variable-length bar code
22
consisting of numerals only.
Variable-length bar code consisting of alpha
15
numerals. Any one of A, B, C, and D is
required as the start/stop code.
—
CODE128
Variable-length bar code consisting of all 128
14
ASCII code characters.
Printing is done depending on bar code specification type, number of print column,
bar code height, width (Magnification), visible code presence, and bar code data
specification.
— 60 —
GS w nL nH
[Function]Selecting the horizontal size (Scale factor) of the Bar Code
[Code]<1D>H<77>H<n>
[Range]{2 =< n =< 4(Hex)}
[Outline]Selecting bar code width.
n denotes the number of dots in fine element width.
GS z ..... ^C (Available only with firmware version 2.12 or later)
[Function]Saving AT command sequences to send to Bluetooth module
[Code]<1D>h <7A>h [d1….dn] <03>h
[Range]0 =< n =< 60
[Outline]Printer saves the AT command sequences specified by [d1….dn] in the NV memory.
At the first time of power-on after saving the sequences, printer transfers the
sequences to Bluetooth module. Then the printer clears the sequence from NV
memory and the printer power is turned off.
If there is no AT command is specified (<1D>h <5A>h <03>h), no data is transferred
to Bluetooth module at power-on.
It is possible to send more than one AT command once. CR (< 0D>h) is the separator
between the commands. By the CR, 500 ms delay is inserted between the commands.
Available AT commands for Bluetooth module
(Only for the Bluetooth module coming with firmware version 2.12 or later)
AT commandFunctionFactory default
AT*PC=string=Set the PIN code.Last 4 digits of BD 1,2,3,5
(string part is up to 16 characters)address
AT*AE=00
AT*AE=10
AT*AE=11Authentication and encryption: Use
AT*PAIRINFO=0
AT*PAIRINFO=1 Pairing information is preserved.not preserved
Remarks
1: Preserved pairing information is cleared.
2: PIN Code characters should not include “ÅÅ”
3: When PIN Code is set blank (AT*PC==), authentication and encryption is set to
“disuse”.
4: When PIN Code is blank, AT*AE command can not set authentication to “use”.
5: AT command sequences must end with CR(<0D>H).
[Caution]When printer is turned on next time, saved AT command sequences are transferred
to the Bluetooth module and sent data and the response from Bluetooth module is
printed.
If the response is OK, setting is done correctly.
After the power on, it takes several seconds to start printing.
Authentication and encryption: Disuse
Authentication: Use, encryption: Disuseencryption: Disuse
Pairing information is not preserved
Authentication and 4,5
Pairing information is 1,5
Remarks
— 62 —
[Example]To enable the pairing information to be preserved, following command sequences
need to be sent to the printer.
GS z AT*PAIRINFO=1 CR ^C
<1D 7A 41 54 2A 50 41 49 52 49 4E 46 4F 3D 31 0D 03>h
Printer power is turned off by receiving this command.
Print result at power on after receiving this command as follows.
********************************
BLUETOOTH INIT COMMANDS:
AT*PAIRINFO=1
OK
********************************
[Remarks]Besides this command “AT*PAIRINFO=0” can be sent manually by following steps.
Open the paper cover.
Start pressing the LF switch down.
Press the ON/OFF switch down and release the switch.
Keep the LF switch pressed down for more than 5 seconds.
Close the paper cover.
— 63 —
BLACK MARK FUNCTION
ESC l n
[Function]Specify/canceling black mark function
[Code]<1B>H<6C>H<n>
[Range]n = 0 or 1
[Outline]Specifying / canceling the black mark function.
n (Hex)Type
0Canceling black mark function
1Specifying black mark function
[Caution]Black mark function uses PE sensor of CMP-10 for black mark sensor. Therefore, the
condition of detecting paper end and detecting open cover is changed in this mode.
[Default]n = 0
[See also]FF Note on Next page
FF
[Function]Printing and paper feeding to the black mark position
[Code]<0C>H
[Outline]This command prints the data in the printer buffer and searches for black mark. It is
ignored if black mark function is not specified.
[Caution]This command is valid only when black mark function is specified.
[See also]ESC l n Note on next page
— 64 —
Note for Black Mark Function
1.Error detection at black mark mode
Paper end is checked during printing but black mark is not checked.
After receiving FF command, printer checks black mark and paper end. Once black is detected and white
is detected again within 6 mm paper feed, it is determined as black mark. If the white is not detected
within 6 mm paper feed, it is determined as paper end.
After receiving FF command, if printer cannot detect back mark by feeding paper for 360 mm, printer
recognizes it as black mark detecting error. And the result is same as detecting paper end.
To release the error, it is necessary to put correct paper and press LF switch long.
2.LF switch operation in black mark mode
Press short:Feed one line
Press longer than 1 sec.: Feed paper to find next black mark. (Same as sending FF command)
3.Switching Black mark mode
Black mark mode is set for disabled at factory.
Once black mark mode is enabled, it is effective till receiving disabling command or the battery connector
is disconnected.
By sending command ESC > which saves setting condition to NV memory, black mark mode can be kept
enabled even if battery connector is disconnected.
4.Remarks for programming
As it is possible to print on black mark, if user does not want to print on the black mark, it have to be
taken care by user side program
5.Remarks on handling
If the paper cover is open in black mark mode, there is a possibility to recognize it as detecting black
mark.
6.Designing black mark paper
Black mark should be on recording side of the thermal paper.
Darkness of black mask should be 0.9 or more (PCS value).
The black mark size and position should be as follows.
A
B
C
A = 4 - 6 mm
B = 15 mm or more
C = 20 – 360 mm
The distance from PE sensor and print head is approx. 7.5 mm.
— 65 —
Printing direction
3. CHARACTER CODES TABLE
WPC1252
— 66 —
4. PROGRAMMING CONSIDERATIONS
4.1 Notes at Lowered Battery Voltage
When battery is low, highly loaded printing such as printing of graphics with much black area may cause
power off during printing.
When executing high loaded printing, charging the battery before lowing of battery voltage is recommended
while keeping checking the information on the battery by the use of relevant command.
4.2 Notes on Printing After Paper Cutting
When the paper is cut by manual cutter, paper is likely to be caught by the cutter.
Therefore, in printing the first line just after cutting, the printing may be compressed in vertical direction.
When starting printing, feed one line without printing to prevent compressed printing.
Start bit: 1 bit
Data bit: 8 bits Fixed
Parity bit: No parity
Stop bit: 1 bit
(4)Signal polarity
RS-232C
• Mark = logic “1” (–3V ~ –12V)
• Space = logic “0” (+3V ~ +12V)
(5)Receiving data (RD signal)
RS-232C
• Mark = logic “1” (–3V ~ –12V)
• Space = logic “0” (+3V ~ +12V)
(6) Transmission control (TD signal)
DC1 code (11H) X-ON: Data reception is available
DC3 code (13H) X-OFF: Data reception is not available
5.2. Connector Pin Configuration
Pin No.SignalDirectionFunctionPin No. of Cable
3TXDOutputTransferred dataNo. 2 pin of D-Sub 9 pins
6+5V—No connection
7RXDInputReceived dataNo. 3 pin of D-Sub 9 pin
11RTSInputAuto Turn OnNo. 7 pin of D-Sub 9 pin
14——No. 5 pin of D-Sub 9 pin
15GND—No. 5 pin of D-Sub 9 pin
Connector
Printer side:Connector used on StarTac (Motorola)
PC side9 pin D-SUB
Cable
Communication mode setting
(InfraRed or Serial)
— 68 —
5.3 Explanation of Input/Output Signals
(1)RXD
This is signal, receiving data from the host. On occurrence of framing error, overrun error, or parity
error, the data is printed as “?”.
(2)TXD
This signal is for data flow control by X-ON/X-OFF. If data remains in the printer’s input buffer is 2048
bytes or less, the printer transfers a DC3 (13H: Data Receive Not Ready) signal to the host. If data in the
input buffer exceeds 4096 bytes, the printer transfers a DC1 (11H: Data Receive Ready) signal to the host.
(3)Vcc
This is a power supply (+5 V). The signal is not use in the standard serial cable!
(4)GND
This is a GND on the circuit.
(5)Auto turn-on
The printer can be turned on by using RTS signal from the host
CAUTION: Ensure that the RTS signal is deactivated when your application software not using the printer as
auto turn-off function is disabled when RTS is active
14, 15 pin (Communicate mode setting)
Using dedicated cable makes these pin short-circuited.
If these pins are short-circuited, printer sets the communicate mode to serial communication.
If these pins are not short-circuited, printer set the communication mode to infrared.
5.4 Error Detection
Framing and overrun are detected. On detection of any error, the data are stored in the buffer as “?”.
(1)Framing Error
With “space” state having been detected on detection of a stop bit, error takes place. The data are
stored in the buffer as “?”.
(2)Overrun Error
On detection of an overrun error, the data are stored in the buffer as “?”.
5.5 Buffering
This printer incorporates 64K byte buffer. This allows most print jobs to by fully buffered so that the host can
continue quickly.
(After standard charge and discharge 400 mA till cut off at 23ºC,
then measure the capacity)
(8)Initial impedance100m ohm or less
(9)Cycle life capacity1400 mAh or more
(Repeat the routine - Standard charge + discharge 2000 mA till cut-off –
299 times and leave one day, then measure in same condition as initial
capacity)
(10) Discharge by temperature–10ºC 50%
0ºC80%
23ºC 100%
45ºC 100%
(After standard charge and discharge 1000 mA till cut-off)
(11) Storage1600 mAh or more
(After standard charge, keep it at 23ºC in 30 days then discharge
1000 mA at 23ºC till cut-off)
8.2 Power Management
(1) Printable lines40,000 lines or more
(Room temperature, full charge, ASCII slide pattern printing)
(2) Auto power off time5 minutes (can be changed between 1 and 60 minutes)
(3) Low battery detection voltage6.7V
(4) Battery release voltage5.5V
8.3Power Consumption
Average1.45A (ASCII slide pattern printing)
Peak2A
Stand-by80 mA
— 73 —
9. AC ADAPTOR
(1)Input voltage100V ~ 240V AC (50/60 Hz)
(2)Input current250 mA
(3)Rated output9V ±5%
(4)Efficiency65% or more (AC 100V/50 Hz full load)
70% or more (AC 240V/50 Hz full load)
(5)Ripple and noise voltageLess than 150 mVp-p (9 VDC)
(6)Insulation testMore than 100M ohm
(DC 500V, 1 minute, between primary and secondary circuit and chassis)
(7)Leakage current0.25 mA or less (AC 240V/50 Hz)
(8)Temperature rise45K or less on case surface (100 VAC/50 Hz full load @25°C)