1.2 Character Set ................................................................................................................................................. 1
1.3 Control Commands ....................................................................................................................................... 1
1.3.1 Control Command Details .................................................................................................................. 1
1.3.2 How to Send Control Commands ...................................................................................................... 1
2. CONTROL COMMANDS ..................................................................................................................... 2
2.1 ESC/POS Command List ............................................................................................................................... 2
2.1.1 Description of Items ............................................................................................................................ 6
ESC d n ................................................................................................................................................ 11
2.2.2 Print Character Commands .............................................................................................................. 12
CAN ........................................................................................................................................................12
ESC SP n ..............................................................................................................................................13
ESC ! n ................................................................................................................................................. 14
ESC % n ............................................................................................................................................... 16
ESC & s n m [a [p] s × a] m–n+1 .................................................................................................... 17
ESC – n ................................................................................................................................................. 18
ESC ? n ................................................................................................................................................. 19
ESC E n ................................................................................................................................................ 20
ESC G n ................................................................................................................................................ 21
ESC M n ................................................................................................................................................. 22
ESC R n ................................................................................................................................................ 22
ESC V n ................................................................................................................................................ 23
ESC t n ................................................................................................................................................. 24
ESC { n ................................................................................................................................................. 25
ESC ~ J n (Valid in CBM1000II-Compatible Mode) ............................................................................. 26
DC3 n (Valid in CBM1000II-Compatible Mode) ................................................................................... 27
GS ! n ...................................................................................................................................................28
GS B n ..................................................................................................................................................29
GS b n .................................................................................................................................................. 30
2.2.3 Print Position Commands................................................................................................................. 31
ESC D [ n ] k NULL ............................................................................................................................ 33
ESC T n ................................................................................................................................................ 34
ESC a n................................................................................................................................................. 37
GS L nL nH.......................................................................................................................................... 39
GS W nL nH ........................................................................................................................................ 40
GS / m .................................................................................................................................................. 49
GS v 0 m xL xH yL yH d1...dk ............................................................................................................... 50
2.2.6 Status Commands............................................................................................................................. 52
DLE EOT n ............................................................................................................................................ 52
GS a n .................................................................................................................................................. 55
GS r n ...................................................................................................................................................58
2.2.7 Paper Detecting Commands ............................................................................................................ 60
ESC c 3 n .............................................................................................................................................. 60
ESC c 4 n .............................................................................................................................................. 61
ESC c 5 n .............................................................................................................................................. 62
GS V m n ..... (2) ................................................................................................................................. 65
2.2.11 Bar Code Commands ...................................................................................................................... 66
GS H n .................................................................................................................................................. 66
GS f n ................................................................................................................................................... 68
GS h n .................................................................................................................................................. 69
GS k m [d1 ...... dk] NULL ......... (1)
GS k m n [d1 ...... dn] ................ (2) ...................................................................................................... 70
GS w n ................................................................................................................................................. 76
2.2.12 Commands for Non-volatile Memory ........................................................................................... 77
F S p n m............................................................................................................................................... 77
F S q n [xL xH yL yH d1…dk] 1… [xL xH yL yH d1…dk] n .............................................................. 78
2.2.13 Black Mark Control Commands ..................................................................................................... 80
GS FF (Valid Only at B.M Paper Selection) ........................................................................................ 80
GS < (Valid Only at B.M Paper Selection) .......................................................................................... 80
GS A m n (Valid Only at B.M Paper Selection) ................................................................................ 81
GS C0 m n........................................................................................................................................... 82
GS c ....................................................................................................................................................... 86
GS I n1L n1H n2L n2H........................................................................................................................ 87
2.2.14 Printer Function Setting Commands .............................................................................................88
2.2.15 Other Commands .......................................................................................................................... 117
DLE ENQ n .........................................................................................................................................117
DLE DC4 fn m t (Specification of fn = 1) ............................................................................................ 118
DLE DC4 fn d1...d7 (Specification of fn = 8) ...................................................................................... 119
ESC = n .............................................................................................................................................. 120
ESC L ................................................................................................................................................... 122
ESC S .................................................................................................................................................. 123
ESC p m n1 n2 .................................................................................................................................124
GS ( A pL pH n m ............................................................................................................................... 125
GS I n ................................................................................................................................................. 126
GS P x y ............................................................................................................................................ 128
4.3 Identification of Send Status .................................................................................................................... 153
— iii —
1. OUTLINE
1.1 Operation Mode
CT-S300 has ESC/POSTM as control commands.
1.2 Character Set
All print data sent from the host computer to the printer are automatically converted to one-byte alphanumeric
or katakana characters (ANK) or two-byte Kanji corresponding to the characters and symbols.
NOTE: For the contents of character set, refer to Chatacter Code Table of this document.
1.3 Control Commands
1.3.1 Control Command Details
Control Commands are used for controlling the operations of the printer such as starting/stopping of printing,
line feeding, paper feeding, etc. They control all functions related to printing, such as type of characters,
enlargement of characters or setting of format.
1.3.2 How to Send Control Commands
Some methods are available for sending Control Commands from the host computer to the printer. Here, a
method of sending by BASIC programming is explained.
Example 1
Let’s print a character string “CITIZEN” in enlarged (double-height, double-width) and in normal format.
Program coding
The Control Command shows that the command name for setting the size of a character is GS !. Let’s make
a program using this code. An example is shown below.
In lines 20 and 50, setting and canceling of enlarging a character is sent. As a result, lines 30 and 60 print the
same character string but line 30 prints enlarged characters and line 60 cancels the enlargement and prints in
normal format.
* In this document, sample programs are in BASIC. For details of BASIC programming, refer to the manual
for BASIC.
— 1 —
2. CONTROL COMMANDS
2.1 ESC/POS Command List
Print Control Commands
Control
Command
LFPrinting and paper feedS.P.
CRBack to printingS.P.
FF(1) Printing in PAGE MODE and returning to
STANDARD MODE (at the selection of PAGE MODE)
(2) Printing of Black mark and paper feeding to the top of the
print position (with Black mark paper selected)
ESC FFPrinting data in PAGE MODEP
ESC JPrinting and feeding paper in minimum pitchS.P.O
ESC dPrinting and feeding the paper by “n” linesS.P.
Print Character Commands
CommandsFunctionModeGS P
CANCanceling print data in PAGE MODEP
ESC SPSetting the right spacing of the characterS.P.O
ESC !Collectively specifying the printing modeS.P.
ESC %Specifying/canceling download character setS.P.
ESC &Defining the download charactersS.P.
ESC –Specifying/canceling underlineS.P.
ESC ?Deleting download charactersS.P
ESC ESpecifying/canceling emphasis printingS.P.
ESC GSpecifying/canceling double strike printingS.P.
ESC MSelection of character fontsS.P.
ESC RSelecting the international character setS.P.
ESC VSpecifying/canceling 90°-right-turned charactersS
ESC tSelecting the character code tableS.P.
ESC {Specifying/canceling the inverted charactersS
ESC ~ JSpecifies/cancels printing in red (black-based paper)S.P.
DC3Specifies/cancels printing in red (black-based paper)S
GS !Specifying the character sizeS.P.
GS BSpecifying/canceling the black/white inverted printingS.P.
GS bSpecifying/canceling the smoothingS.P.
FunctionModeGS P
P
— 2 —
Print Position Commands
CommandsFunctionModeGS P
HTHorizontal tabS.P.
ESC $Specifying the absolute positionsS.P.O
ESC DSetting horizontal tab positionS.P.
ESC TSelecting the character printing direction in PAGE MODEP
ESC WDefining the print area in PAGE MODEPO
ESC \Specifying the relative positionS.P.O
ESC aAligning the charactersS
GS $Specifying the absolute vertical position of characters inPO
PAGE MODE
GS LSetting the left marginSO
GS WSetting the print area widthS.P.O
GS \
Specifying the relative vertical position of a character in
PAGE MODE
S.P.O
Line Feed Span Commands
CommandsFunctionModeGS P
ESC 2Specifying 1/6-inch line feed rateS.P.
ESC 3Setting line feed rate of minimum pitchS.P.O
Bit Image Commands
CommandsFunctionModeGS P
ESC *Specifying the bit image modeS.P.
GS *Defining the download bit imageS.P.
GS /Printing the downloaded bit imageS.P.
GS v0Printing of raster bit imageS
Status Commands
CommandsFunctionModeGS P
DLE EOTSending status in real-timeS.P.
GS aEnabling/disabling ASB (Automatic Status Back)S.P.
GS rSending statusS.P.
Paper Detecting Commands
CommandsFunctionModeGS P
ESC c3Selecting the Paper Sensor valid for Paper-end signal outputS.P.
ESC c4Selecting the Paper Near-end Sensor valid for print stopS.P.
— 3 —
Panel Switch Commands
CommandsFunctionModeGS P
ESC c5Enabling/disabling the panel switchesS.P.
Macro Commands
CommandsFunctionModeGS P
GS :Starting/ending macro definitionS.P.
GS ^Executing the macroS.P.
Cutter Commands
CommandsFunctionModeGS P
GS VCutting the paperS.P.O
Bar Code Commands
CommandsFunctionModeGS P
GS HSelecting of printing position of HRI charactersS.P.
GS fSelecting the font of HRI charactersS.P.
GS hSpecifying the height of the bar codeS.P.
GS kPrinting the bar codeS.P.
GS wSpecifying the horizontal size (magnification) of bar codeS.P.
Commands for Non-volatile Memory
CommandsFunctionModeGS P
FS pPrinting the download NV bit imagesS
FS qDefining the download NV bit imageS
Black Mark Control Commands
CommandsFunctionModeGS P
GS FFPrinting and ejecting Black mark paperS.P.
GS <Initialiging the printer mechanismS.P.
GS ACorrecting the leader position of Black mark paperS.P.
GS C0Setting the numbering print modeS.P.
GS C1Setting the numbering counter mode (A)S.P.
GS C2Setting the numbering counterS.P.
GS C;Setting the numbering counter mode (B)S.P.
GS cPrint the counterS.P.
GS ISetting the Black mark lengthS.P.
— 4 —
Printer Function Setting Commands
CommandsFunctionModeGS P
GS ( DEnabling or disabling real-time commandS
GS ( EPrinter function setting commandS
GS ( MCustomizing the printerS
GS ( NDesignating font attributeS
Other Commands
CommandsFunctionModeGS P
DLE ENQReal-time request to printerS.P.
DLE DC4Outputting specified pulse in real-timeS.P.
ESC =Data input controlS.P.
ESC @Initializing the printerS.P.
ESC LSelecting PAGE MODES
ESC SSelecting STANDARD MODEP
ESC pGenerating the specified pulsesS.P.
GS ( AExecution of test printingS
GS ISending the printer IDS.P.
GS PSpecifying the basic calculation pitchS.P.
GS RSSound buzzerS.P.
In the Mode column: S = STANDARD MODE, P = PAGE MODE
O = shows the command affected by GS P.
— 5 —
2.1.1 Description of Items
XXXX
[Function]The name of a command.
[Code]The string of codes comprising the command is represented by < >H for hexadecimal
numbers, < >B for binary numbers, and < > for decimal numbers, [ ] k denotes the
number of repetition of “k” times.
[Range]Indicates the values (setting range) of arguments of the command.
Note: If values outside the defined domain specified with control codes are used,
malfunctions could possibly occur, so be sure to use the values within the defined
domain.
[Outline]Describes the functions of the command.
[Caution]Describes important points and cautionary notes, as required.
[Default]Initial values for the command if it has arguments.
[See Also]Describes commands related to the command when it is used.
[Sample Program]Describes examples of coding on Quick-Basic.
* Examples are only for reference. They may vary depending on language and
version. For details, please refer to a manual in your language.
[Print Results]Describes the print results obtained by executing the above programs. However, the
print results shown are different in scale from actual print results.
— 6 —
2.2 Command Details
2.2.1 Print Control Commands
LF
[Function]Printing and paper feed
[Code]<0A>H
[Outline]Prints data inside the print buffer and feeds paper based on the line feed amount
having been set.
[Caution]After this command is executed, the beginning of the line is taken as the start position
AAA ← Print and line feed
BBB← Print and line feed
← Line feed only
CCC← Print and line feed
— 8 —
FF
[Function](1) Printing in PAGE MODE and returning to STANDARD MODE (at the selection of
PAGE MODE)
(2) Printing of Black mark and paper feeding to the top of the print position (with
Black mark paper selected)
[Code]<0C>H
(1) At selection of PAGE MODE
[Outline]Executes a batch printout of the data mapped in the entire print area, and then returns
to STANDARD MODE.
[Caution]• All mapped data is erased after printout.
• The print area set up by ESC W is initialized.
• This command does not execute a paper cut.
• After this command is executed, the beginning of the line is taken as the start
position for the next print.
• This command is only effective when the PAGE MODE is selected.
[See Also]Appendix 4.1.4 “Example of Using PAGE MODE”
ESC FF, ESC L, ESC S
(2) At selection of Black mark paper (valid only for Black mark specification)
[Outline]This command prints the data in the printer buffer and searches for the head of the
next Black mark (Black mark position)
[Caution]• This command does not execute a paper cut.
• After this command is executed, the beginning of the line is taken as the start
position for the next print.
[See Also]GS FF
— 9 —
ESC FF
[Function]Printing data in PAGE MODE
[Code]<1B>H<0C>H
[Outline]Executes a batch printout of the data mapped in the entire print area in PAGE MODE.
[Caution]• This command is only effective when PAGE MODE is selected.
• Mapped data, as well as the ESC T and ESC W settings, and the character mapping
position are held even after printing.
[See Also]Appendix 4.1 “Explanation on PAGE MODE”
FF, ESC L, ESC S
ESC J n
[Function]Printing and feeding paper in minimum pitch
[Code]<1B>H<4A>H<n>
[Range]0 n 255
[Outline]Prints the data held in the print buffer and feeds paper by [n × basic calculation pitch]
inches.
[Caution]• After this command is executed, the beginning of the line is taken as the start position
for the next print.
• The line feed width can be set separately for the STANDARD and PAGE MODES.
• This command does not affect the line feed width defined by ESC 2 or ESC 3.
• The basic calculation pitch is set by GS P.
• Fractions resulting from calculation are corrected with the minimum pitch of the
mechanism, and the remainder is omitted.
• In STANDARD MODE, this command uses the vertical (paper feed direction) basic
calculation pitch (y).
• In PAGE MODE, this command acts differently depending on the start point:
(1) If the start point specified by ESC T is top left or bottom right, the command
uses the vertical (Paper feed direction) basic calculation pitch (y).
(2) If the start point specified by ESC T is top right or bottom left, the command
uses the horizontal (Perpendicular to the paper feed direction) basic calculation
pitch (x).
The maximum settable line feed width is 1016 mm (40 inches). A setting greater
than this maximum is trimmed to the maximum.
[Default]The initial value is not defined.
[Sample Program]Refer to Sample Program and Print Results for ESC 2.
— 10 —
ESC d n
[Function]Printing and feeding the paper by “n” lines
[Code]<1B>H<64>H<n>
[Range]0 n 255
[Outline]Prints data in the print buffer and feeds paper by “n” lines. Specified lines do not
remain.
[Caution]• After this command is executed, the beginning of the line is taken as the start position
for the next print.
• If [n × line feed width] exceeds approximately 1016 mm, this command feeds paper
by approximately 1016 mm (40 inches).
[Outline]Erases all data contained in the currently effective print area in PAGE MODE.
[Caution]• This command is only effective when PAGE MODE is selected.
• If the previously established print area overlaps the currently effective print area,
the overlapped data in the previously established area will be erased.
[See Also]Appendix 4.1 “Explanation on PAGE MODE”
ESC L, ESC W
— 12 —
ESC SP n
[Function]Setting the right spacing of the character
[Code]<1B>H<20>H<n>
[Range]0 n 255
[Outline]Sets the right spacing of character to [n × basic calculation pitch] inches.
[Caution]• If the horizontal magnification of character is 2 or more, the right spacing increases
with the magnification.
• Does not affect Kanji.
• The right spacing can be set separately for the STANDARD and PAGE MODES.
• The basic calculation pitch is set by GS P. Once defined, the right spacing is not
changed if the basic calculation pitch is changed by GS P.
• Fractions resulting from calculation are corrected with the minimum pitch of the
mechanism, and the remainder is omitted.
• In STANDARD MODE, this command uses the horizontal basic calculation pitch (x).
• In PAGE MODE, the basic calculation pitch used by this command depends on the
start point:
(1) If the start point specified by ESC T is top left or bottom right, the command
uses the horizontal basic calculation pitch (x).
(2) If the start point specified by ESC T is top right or bottom left, the command
uses the vertical basic calculation pitch (y).
• The maximum right spacing is capable of approximately 31.906 mm (255/203
inches). A setting greater than this maximum is trimmed to the maximum.
AAAAA← 0-dot space
AAAAA← 1-dot space
AAAAA← 12-dots space
— 13 —
ESC ! n
[Function]Collectively specifying the printing mode
[Code]<1B>H<21>H<n>
[Range]0 n 255
[Outline]Printing mode is assigned.
BitFunction
0Character FontFont A (12 × 24)Font B (9 × 17)
1Undefined——
2Undefined——
3EmphasisCanceledSpecified
4Double heightCanceledSpecified
5Double widthCanceledSpecified
6Undefined——
7UnderlineCanceledSpecified
[Caution]• With double height and double width being specified simultaneously, quadruple
characters are created.
• An underline is attached to the full character width, which, however, is not attached
to the part having been skipped by the horizontal tab (HT). Neither is it attached to
90°-right-turned characters.
• The underline width is as specified by the ESC – command. (The default setting is
1 dot width.)
• Setting by this command is invalid for Kanji except setting and canceling of enhanced
printing.
• In case characters with different vertical magnification ratios coexist on the same
line, they are printed on the same base line.
• ESC E, ESC M, ESC –, and GS ! can individually set or cancel the mode but the
command processed last is valid.
• Setting or cancelling of enhanced 3rd bit is valid for alphanumric and kana and
kanji. Other print mode is valid only for alphanumeric and kana characters.
[Default]This is a character code table specified with the value of “n”.
[Sample Program]
LPRINT CHR$(&H1B);"t";CHR$(0);
LPRINT "n=0 ";
LPRINT CHR$(C);
FOR C=&HB1 TO &HB5
NEXT C
LPRINT CHR$(&HA);
LPRINT CHR$(&H1B);"t";CHR$(1);
LPRINT "n=1 ";
FOR C=&HB1 TO &HB5
LPRINT CHR$(C);
NEXT C
LPRINT CHR$(&HA);
[Print Results]
n = 0
n= 9
← n = 0
← n = 9
— 24 —
ESC { n
[Function]Specifying/canceling the inverted characters