Every effort has been made to ensure that the information in thi s document i s compl et e,
accurate and up-to-date. Okidata assumes no responsibility for the results of errors beyond its
control. Okidata also cannot guarantee that changes in software and equipment made by other
manufacturers, and referred to in this handbook, will not affect the applicability of the
information in this manual. Mention of soft w are product s manuf act ured by other companies
does not necessarily constitute endorsement by Okidata.
OKIDATA and MICROLINE are registered trademarks of Oki Electric Industry Company, Ltd.;
marques déposées de Oki Electric Industry Company, Ltd. OKIDATA—Marca Registrada, Oki
Electric Industry Company, Ltd.
Epson is a registered trademark of Epson America, Inc.
IBM and PC are registered trademarks of International Business Machines Corporation.
Microsoft, MS-DOS and Windows are registered trademarks or trademarks of Microsoft Corporation
in the United States and other countries.
Contents
How To Use This Manual .........................................................................................................vii
How the Manual is Or ganized.....................................................................................vii
Conventions Used in this Manual...............................................................................viii
This Programmer’s Guide/Reference Manual is a supplement to the manuals for the various
model printers. It contains additional information on selecting printer drivers and on the printer
commands, as well as interfacing specifications.
How the Manual is Organized
Command Summary
Tabular listings of the commands for each emulat i on, w i t h ref erences t o t he page in t he manual
on which the description for the command appears.
Chapter 1: Printer Drivers
Selecting printer drivers.
Chapters 2 through 12 — Commands
• Chapter 2: Character Set Commands
• Chapter 3: Character Size & Spacing Commands
• Chapter 4: Character Style Commands
• Chapter 5: Custom Char act er Commands
• Chapter 6: Graphics Commands for 9-Pin Printers
• Chapter 7: Graphics Commands for 24-Pin Printers
• Chapter 8: Horizontal Control Comm ands
• Chapter 9: Vertical Control Commands
• Chapter 10: Bar Code Commands for 9-Pin Printers
• Chapter 11: Bar Code Commands for 24-Pin Printers
• Chapter 12: Miscellaneous Commands
Appendix A: InterfacingPin-out diagrams for the parallel and serial interfaces. It also incl udes wi ri ng di agrams f or
commonly used serial cable configurations.
Appendix B: Listing of TablesIncludes a complete listing of the tables in this manual.
How to Use this Manualvii
Conventions Used in this ManualThe following conventions are used in the command chapters of this manual:
•The emulation(s) to which each command appli es i s gi ven i n parent heses at t he end of the
heading for the command. The emulations (IBM = IBM Propri nter, E = Epson FX, and ML =
OKIDATA MICROLINE Standard) are descri bed i n C hapt er 1.
For example:
Proportional Spacing Commands (IBM/E/ML)
•The printer models to which each command appli es are gi ven i mmedi at el y bel ow t he
command heading, preceded by a check mark (
ML320 E/I, ML321 E/I = Models ML320 & ML321, Epson/IBM-CompatibleML320 Std., ML321 Std. = Models ML320 & ML 321, MI C ROLI N E Standard EmulationML320T, ML321T = Models ML320 Turbo & ML321 TurboML390T, ML391T = Models ML320 Turbo & ML321 TurboML520, ML521 = Models ML520 & ML521ML590, ML591 = Models ML590 and ML591
• Notes, which contain important informati on t hat you shoul d read, are set in italics.
For example:
Note:If you send a location value outside the set left or right margin, this command
will be ignored.
How to Use this Manualviii
Abbreviations & Acronyms
The following abbreviations and acronyms are used in this manual:
ASCIIAmerican Standard Codes for Information Interchange
CpiCharacters per inch
CplCharacters per line
CSFCut Sheet Feeder
DecDecimal
DLLDown Line Loading
DpiDots per inch
EEpson FX Emulation
E/IEpson/IBM Compatible Model
HexHexadecimal
HSDHigh Speed Draft
IBMIBM Proprinter Emulation
MLOKIDATA MICROLINE Standard Emulation
NLQNear Letter Quality
ROMRead Only Memory
RAMRandom Access Memory
Std.OKIDATA MICROLINE Standard Model
TOFTop of Form
UTLUtility
How to Use this Manualix
Command Summary
This summary is in four sections:
• IBM Commands
• Epson FX Commands
• Epson LQ Commands
• Okidata MICROLINE Standard Commands
Each is section arranged numerically by the deci mal val ue f or t he AS CI I command. The page
number given in the last column refers you to the explanation of the command in this manual.
The printer models which include that particular command are listed in the third column:
䊳Models ML320 and ML321 incorporate either the Epson FX and IBM Proprinter
emulations (designated as “E/I” in the table) or the OKIDATA MICROLINE Standard
emulation (designated as “Std.” in the table).
Note:If you’re not sure which version of the ML320 or ML321 printer you have, run the
Self Test (hold LF button while turning on the printer), then look at the first line
that prints: if you see EI, you have the Epson/IBM version; i f you see OKI , you
have the OKIDATA MICROLI N E St andard version.
䊳 Models ML 320 Turbo, ML321 Turbo, ML520 and ML521 i ncorporate the IBM Proprinter,
Epson FX and OKIDATA MICROLIN E St andard emulations.
Models ML 390 Turbo, ML391 Turbo, ML590 and ML 591 incorporate the IBM Proprinter, IBM
Proprinter AGM, and Epson LQ emulations.
SO14Begin double width printing li ne by lineML390T/391T,
DC1
17
DC218Cancel 20 cpiML390T/391T,
DC319Print suppress mode onML390T/391T,
DC4
20
CAN24CancelML390T/391T,
ESC SO
27 14
ESC SI
27 15
ESC DLE @ Pn A1 A2 P1 P2 P3 P
27 16 64 Pn A1 A2 P1 P2 P3 P
ESC DLE A m n1 ... n
27 16 65 m n1 ... n
ESC DLE B m n [data]
27 16 66 m n [data]
ESC DLE C P1 [data]
27 16 67 P
[data]
1
ESC DLE G n 1
27 16 71 n 49
ESC EM 1
27 25 49
ESC EM 2
27 25 50
ML590/591
ML590/591
SI15Select compressed pitchML390T/391T,
ML590/591
Print suppress mode off
ML390T/391T,
ML590/591
ML590/591
ML590/591
End double width printing line by l i ne
ML390T/391T,
ML590/591
ML590/591
Begin double width printing li ne by lineML390T/391T,
ML590/591
Select 20 cpi
ML390T/391T,
ML590/591
Set multiple print positionsML390T/391T,
4
4
Select bar code type and sizeML390T/391T,
8
8
Print bar code data
ML590/591
ML590/591
ML390T/391T,
ML590/591
Print Postnet bar code dataML390T/391T,
ML590/591
Set/reset raster graphicsML390/391T66
Select Bin 1 of Dual-Bin CSFML590/591126
Select Bin 2 of Dual-Bin CSFML590/591126
69
21
16
129
16
129
21
125
21
16
77
113122
113122
113,
124
Epson LQ Command Summaryxxvii
Epson LQ Command: ASCII
p
p
b
n
n3
p
DecimalFunctionApplies to Model(s)Page
ESC EM I
27 25 73
ESC EM R
27 25 82
ESC US 0
27 31 48
ESC US 1
27 31 49
ESC SP n
27 32 n
ESC ! n
27 33 n
ESC #
27 35
ESC $ Ln H
27 36 Ln H
ESC % 0
27 37 48
ESC % 1
27 37 49
ESC % 5 n
27 37 53 n
ESC & m n1 n2 d0 d1 d2 [data]
27 38 m n
1 n2 d0 d1 d2
[data]
ESC & NUL m n1 n2 d0 d1 d2 [data]
27 38 0 m n
1 n2 d0 d1 d2
[data]
ESC ( - Ln Hn Pn D1 D
27 40 45 Ln Hn Pn D1 D
ESC ( C 2 0 Lp H
27 40 67 40 48 Lp H
ESC ( G Ln Hn P
27 40 71 Ln Hn P
ESC ( U Ln Hn P
27 40 85 Ln Hn P
ESC ( V Ln Hn Lp H
27 40 86 Ln Hn Lp H
ESC ( ^ Ln Hn [data]
27 40 94 L
n Hn
[data]
ESC ( c 2 0 Lt Ht Lb H
27 40 99 50 48 Hn Lt Ht Lb H
ESC ( t Ln Hn Pn1 P
27 40 116 Ln Hn Pn1 Pn2 P
P
2
ESC ( v Ln Hn Lp H
27 40 118 Ln Hn Lp H
ESC * m n1 n2 [data]
27 42 n
1 n2
[data]
Insert sheet (Cut Sheet Feeder)ML390T/391T126
Eject sheet (Cut Sheet Feeder)ML390T/391T126
End double height printingML390T/391T,
ML590/591
Begin double height printingML390T/391T,
ML590/591
Set character spacing.ML390T/391T,
ML590/591
Combined print modeML390T/391T,
ML590/591
Cancel MSB control
ML390T/391T,
ML590/591
Set absolute dot positionML390T/391T,
n
n
ML590/591
Select standard character setML390T/391T ,
ML590/591
Select custom character set
ML390T/391T ,
ML590/591
Perform n/144" line feedML590/59188
Down line load charactersML390T/391T50
Down line load charactersML590/59150
Select score style: underline, overscore, or
2
strike through
2
ML390T/391T37
Set Page LengthML390T/391T86
p
Select graphics mode
n
n
Set increment of movementML390T/ 391T130
n
n
ML390T/391T,
ML590/591
Absolute position line feedML390T/391T98
p
Select All Character SetML390T/391T,
ML590/591
Set Page FormatML390T/391T98
b
Select character table
n3
ML390T/391T,
ML590/591
Relative position line feedML390T/391T97
p
Graphics select/printML390T/391T,
ML590/591
21
21
26
34
128
80
51
51
65
6
13
63
Epson LQ Command Summaryxxviii
Epson LQ Command: ASCII
DecimalFunctionApplies to Model(s)Page
ESC + n
27 43 n
ESC - 0
27 45 48
ESC - 1
27 45 49
ESC . Pc Pv Ph Pm Ln Hn [data]
27 46 P
c Pv Ph Pm Ln Hn
[data]
ESC / n
27 47 n
ESC 0
27 48
ESC 2
27 50
ESC 3 n
27 51 n
ESC 3 n
27 51 n
ESC 4
27 52
ESC 5
27 53
ESC 6
27 54
ESC 7
27 55
ESC 8
27 56
ESC 9
27 57
ESC : NUL n NUL
27 58 0 n 0
ESC <
27 60
ESC =
27 61
ESC >
27 62
ESC ? m n
27 63 m n
ESC @
27 64
ESC A n
27 65 n
ESC B NUL
27 66 0
Set line spacing to n/360"ML390T/391T,
92
ML590/591
Underline printing off
ML390T/391T,
36
ML590/591
Underline printing onML390T/391T,
36
ML590/591
Print Raster GraphicsML390T/391T,
66
ML590/591
Select vertical tab channel.ML390T/391T.
95
ml590/591
Set line spacing to 1/8"ML390T/ML391T90
Set line spacing to 1/6"
ML390T/ML391T,
90
ML590/591
Set line spacing to n/180"ML390T/ML391T92
Set line spacing to n/216"ML590/59192
Italic printing onML390T/391T35
Italic printing offML390T/391T35
Permit printing upper range control codesML390 T/ 391T,
13
ML590/591
Cancel printing upper range control codes
ML390T/391T ,
13
ML590/591
Paper-out sensor offML390T/391T,
128
ML590/591
Paper-out sensor onML390T/391T,
128
ML590/591
Copy ROM character set to RAM
character set
ML390T, ML391T,
ML590/591
Print uni-directional for one line onlyML390T, ML391T,
49
82
ML590/591
Set Most Significant Bit (MSB) to zeroML390T/391T,
128
ML590/591
Set MSB to 1ML390T/391T,
128
ML590/591
Reassign graphicsML390T, ML391T,
64
ML590/591
Initialize printer
ML390T/391T,
127
ML590/591
Set line spacing to n/60"ML390T/ML391T,
91
ML590/591
Clear vertical tabsML590/59194
Epson LQ Command Summaryxxix
Epson LQ Command: ASCII
DecimalFunctionApplies to Model(s)Page
ESC B n1 n2 ... nk NUL
27 66 n
1 n2
... nk 0
ESC C n
26 67 n
ESC C NUL n
27 67 0 n
ESC D NUL NUL
27 68 0 0
ESC D n1 n2 ... nk NUL
27 68 n
1 n2
... nk 0
ESC E
27 69
ESC F
27 70
ESC G
27 71
ESC H
27 72
ESC J n
27 74 n
ESC K Ln Hn [data]
27 75 L
n Hn
[data]
ESC L Ln Hn [data]
27 76 L
n Hn
[data]
ESC M
27 77
ESC N n
27 78 n
ESC O
27 79
ESC P
27 80
ESC Q n
27 81 n
ESC R n
27 82 n
ESC S 0
27 83 48
ESC S 1
27 83 49
ESC T
27 84
ESC U 0
27 85 48
ESC U 1
27 85 49
Set vertical tabsML390T/391T,
94
ML590/591
Set page length in lines.
ML390T/391T,
85
ML590/591
Set page length in inches.ML390T/391T,
85
ML590/591
Clear horizontal tab settings.ML390T/391T,
76
ML590/591
Set horizontal tabML590/59173
Emphasized printing onML390T/391T,
36
ML590/591
Emphasized printing off
ML390T/391T,
36
ML590/591
Enhanced printing onML390T/391T,
36
ML590/591
Enhanced printing offML390T/391T,
36
ML590/591
Execute n/180" line feed.ML390T/391T88
Begin single density graphicsML390T/391T,
62
ML590/591
Double density graphicsML390T/391T,
62
ML590/591
Select 12 cpi
ML390T/391T,
15
ML590/591
Skip over perforation onML390T/391T,
99
ML590/591
Skip over perforation offML390T/391T,
99
ML590/591
Select 10 cpi
ML390T/391T,
15
ML590/591
Set right marginML390T/391T,
70
ML590/591
Select international character/Code Page
set
Start superscript printingML390T/391T,
ML390T/391T,
ML590/591
10
20
ML590/591
Start subscript printingML390T/391T,
20
ML590/591
Stop superscript/ subscript printing
ML390T/391T,
20
ML590/591
Uni-directional printing offML390T/391T,
82
ML590/591
Uni-directional printing onML390T/391T,
82
ML590/591
Epson LQ Command Summaryxxx
Epson LQ Command: ASCII
p
p
DecimalFunctionApplies to Model(s)Page
ESC W 0
27 87 48
ESC W 1
27 87 49
ESC X p Pn Lp H
27 88 70 Pn Lp H
ESC Y Ln Hn [data]
27 89 L
n Hn
[data]
ESC Z Ln Hn [data]
27 90 L
n Hn
[data]
ESC [ n
27 91 n
ESC \ Ln H
27 92 Ln H
ESC ] n
27 93 n
ESC a 0
27 97 48
ESC a 1
27 97 49
ESC a 2
27 97 50
ESC a 3
27 97 51
ESC b m n1 n2 ... nk NUL
27 98 m n
1 n2
... nk 0
ESC c Lp H
27 99 Lp H
ESC g
27 103
ESC i 0
27 105 48
ESC i 1
27 105 49
ESC j n
27 106 n
ESC k n
27 107 n
ESC l n
27 108 n
ESC I 0
27 73 48
ESC I 1
27 73 49
ESC n P
27 110 P
End double width printingML390T/391T,
ML590/591
Begin double width printing
ML390T/391T,
ML590/591
Select character pitch/point sizeML390T/391T,
p
ML590/591
Double speed/double density grap hi csML390T/391T62
Quadruple density graphicsML390T/391T62
Set line spacing to n/360"ML390T/391T,
ML590/591
Set relative dot position
n
n
ML390T/391T,
ML590/591
Perform n/360" line feedML390T/391T,
ML590/591
Left justificationML390T/391T,
ML590/591
Center justification
ML390T/391T,
ML590/591
Right justificationML390T/391T,
ML590/591
Full (left and right) justificationML390T/391T,
ML590/591
Set vertical format unit (VFU)
ML390T/391T,
ML590/591
Set Horizontal Motion Index
p
ML390T/391T,
ML590/591
Select 15 cpiML390T/391T,
ML590/591
Incremental printing offML390T/391T82
Incremental printing onML390T/391T82
n/180" reverse line feedML390T/391T,
ML590/591
Specify typefaceML390T/391T30
Set left marginML390T/391T,
ML590/591
Cancel printing upper range control codes
ML390/391T,
ML590/591
Permit printing upper range control codesML390/391T,
ML590/591
Select Graphics Aspect RatioML390/391T,
n
n
ML590/591
21
21
17
92
80
88
83
83
83
83
95
27
15
89
70
13
13
65
Epson LQ Command Summaryxxxi
Epson LQ Command: ASCII
DecimalFunctionApplies to Model(s)Page
ESC p 0
27 112 48
ESC p 1
27 112 49
ESC q n
27 113 n
ESC r n
27 114 n
ESC s 0
27 115 48
ESC s 1
27 115 49
ESC t 0
27 116 48
ESC t 1
27 116 49
ESC t 2
27 116 50
ESC x n
27 120 n
ESC } NUL
27 125 0
DEL
127
Proportional spacing offML390T/391T,
25
ML590/591
Proportional spacing on
ML390T/391T,
25
ML590/591
Specify outline/shadowML390T/391T,
38
ML590/591
Select colorML590/591130
Half-speed printing offML390T/ML391T,
127
ML590/591
Half-speed printing onML390T/ML391T,
127
ML590/591
Select Epson Set 1
ML390T/391T ,
7
ML590/591
Select Epson Set 2ML390 T/ 391T ,
7
ML590/591
Select Custom Character SetML390T/391T ,
51
ML590/591
Specify print quality
ML390T/391T,
29
ML590/591
Software I-PrimeML390/391T,
131
ML590/591
Delete one characterML390T/ML391T,
127
ML590/591
Epson LQ Command Summaryxxxii
Okidata MICROLINE Standard Commands
ML Standard Command: ASCI I
DecimalFunctionApplies to Model(s)Page
Select graphics print mode
ETX
3
ETX STX
ETX ETX
ETX LF
3 10
ETX SO
3 14
ETX DC2
3 18
ETX DC4
3 20
VT n
11 n
DC117Print suppress mode offML320/321 Std.,
DC319Print suppress mode onML320/321 Std.,
DC4 SP1...SP1 n ... SP...SP ?
20 32...32 n ... 32...32 63
CAN
ESC ETX x1y1z1w1 ... x16y16z16w16 CR
27 3 x
1y1z1w1
... x16y16z16w16 13
ESC ETX 0 CR
27 3 48 13
ESC HT CR
27 9 13
End graphics print modeML320/321 Std.,
3 2
Store graphics data in one dot
3 3
column buffer
Graphics line feed with
carriage return, text setting
Graphics line feed with
carriage return, graphics
setting
Graphics line feed without
carriage return, text setting
Graphics line feed without
carriage return, graphics
setting
BS8BackspaceML320/321 Std.,
HT9Execute horizontal tabML320/321 Std.,
LF10Line feed (with carriage
return)
VT11Vertical tabML320/321 Std.,
Execute VFU vertical tabML320/321 Std.,
Form feed
FF
12
CR13Carriage returnML320/321 Std.,
Set vertical format unit (VFU)ML320/321 Std.,
Cancel
24
Set horizontal tab by dot
columns
Clear horizontal tabs set by
dot columns
Clear horizontal tab settings
ML320/321 Std.,
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
59
59
60
60
60
60
60
69
73
87
94
96
87
69
129
129
96
125
74
76
76
xxxiv
Okidata MICROLINE Standard Command Summary
ML Standard Command: ASCI I
DecimalFunctionApplies to Model(s)Page
ESC HT x1y1z1 ... x16y16z16 CR
27 9 x
... x16y16z16 13
1y1z1
ESC LF
27 10
ESC VT Hn L
27 11 Hn L
ESC DLE @ Pn a1 a2 P1 P2 P3 P
27 16 64 Pn a1 a2 P1 P2 P3 P
ESC DLE A m n1 ... n
27 16 65 m n1 ... n
ESC DLE B m n [data]
27 16 66 m n [data]
ESC DLE C P1 [data]
27 16 67 P
[data]
1
ESC DC2
27 18
ESC CAN
27 24
ESC US 0
27 31 48
ESC US 1
27 31 49
ESC ! n
27 33 n
ESC ! *
27 33 42
ESC ! /
27 33 47
ESC ! 0
27 33 48
ESC ! 1
27 33 49
ESC ! 2
27 33 50
ESC # 0
27 35 48
ESC # 3
27 35 51
ESC # Q
27 35 81
ESC $
27 36
ESC % 5 n
27 37 53 n
ESC % 9 n
27 37 57 n
Set horizontal tab by
characters
Reverse feed
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
Skip down selected number
n
of lines
n
Set multiple print positionsML320T/321T, ML520/52177
4
4
Select bar code type and sizeML320T/321T, ML520/521101-
8
8
ML320/321 Std.,
ML320T/321T, ML520/521
Print bar code dataML320T/321T, ML52 0/ 521101-
Print Postnet bar code dataML320T/321T, ML520/ 521
Graphics line feed without
carriage return)
ML320/321 Std.,
ML320T/321T, ML520/521
Initialize printerML320/321 Std.,
ML320T/321T, ML520/521
End double height printing
ML320/321 Std.,
ML320T/321T, ML520/521
Begin double height printingML320/321 Std.,
ML320T/321T, ML520/521
Select international character
set
Italics printing off
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
Italics printing onML320/321 Std.,
ML320T/321T, ML520/521
Select standard character setML320/ 321 St d. ,
ML320T/321T, ML520/521
Select block graphics
character set
ML320/321 Std.,
ML320T/321T
Select line character setML320/321 Std.,
ML320T/321T, ML520/521
Select HSD print modeML320/321 St d. ,
ML320T/321T, ML520/521
Select 20 cpiML320/321 Std.,
ML320T/321T, ML520/521
Double speed/ quadruple
density graphics
Copy ROM character set to
RAM character set
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
Perform n/144" feedML320/321 Std.,
ML320T/321T, ML520/521
Set spacing to n/144"ML320/321 Std.,
ML320T/321T, ML520/521
74
89
96
112
112
101,
112
87
127
21
21
9
35
35
8
8
8
29
17
55
45
88
90
Okidata MICROLINE Standard Command Summary
xxxv
ML Standard Command: ASCI I
DecimalFunctionApplies to Model(s)Page
ESC % A m n1 ... n
27 37 65 m n1 ... n
ESC % B n1 n2 n3 n
27 37 66 n1 n2 n3 n
ESC % C n1 n2 n
27 37 67 n1 n2 n
ESC % D m n1 ... n
27 37 68 m n1 ... n
ESC % E n1 n2 n3 n
27 37 69 n1 n2 n3 n
ESC % F n1 n2 n3 n
27 37 70 n1 n2 n3 n
ESC % R n1 n2 n3 n
27 37 82 n1 n2 n3 n
ESC % S 0
27 37 83 48
ESC % S 1
27 37 83 49
ESC & n1 n2 n3 n4 :
27 38 n
1 n2 n3 n4
58
ESC * n1 n2 :
27 42 n
1 n2
58
ESC -
27 45
ESC 0
27 48
ESC 1
27 49
ESC 2
27 50
ESC 3
27 51
ESC 5
27 53
ESC 6
27 54
ESC 7
27 55
ESC 8
27 56
ESC <
27 60
ESC =
27 61
ESC >
27 62
Down load ascender
11
characters
11
Indent from left margin
4
4
Set left marginML320/321 Std.,
3
3
Down load descender
11
characters
11
Move to rightML320/321 Std.,
4
4
Move to leftML320/321 Std.,
4
4
Set right margin
4
4
ML320/321 Std.,
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
Skip over perforation offML320/321 Std.,
ML320T/321T, ML520/521
Skip over perforation onML320/321 Std.,
ML320T/321T, ML520/521
Select print features
ML320/321 Std.,
ML320T/321T, ML520/521
Select graphics modeML320/321 Std.,
ML320T/321T, ML520/521
Uni-directional printing onML320/321 Std.,
ML320T/321T, ML520/521
Select Utility print mode
ML320/321 Std.,
ML320T/321T, ML520/521
Select NLQ print modeML320/321 Std.,
ML320T/321T, ML520/521
Select DLL in Utility modeML320/321 Std.,
ML320T/321T, ML520/521
Select NLQ Gothic font
ML320/321 Std.,
ML320T/321T, ML520/521
Set top of formML320/321 Std.,
ML320T/321T, ML520/521
Set spacing to 1/6"ML320/321 Std.,
ML320T/321T, ML520/521
Select DLL NLQ modeML320/321 Std.,
ML320T/321T, ML520/521
Set spacing to 1/8"ML320/321 Std.,
ML320T/321T, ML520/521
Half-speed printing on
ML320/321 Std.,
ML320T/321T, ML520/521
Uni-directional printing offML320/321 Std. ,
ML320T/321T, ML520/521
Half-speed printing offML320/321 Std.,
ML320T/321T, ML520/521
45
76
72
45
81
81
72
100
100
24
57
82
29
29
45
29
98
90
45
90
127
82
127
xxxvi
Okidata MICROLINE Standard Command Summary
ML Standard Command: ASCI I
p
p
ESC G Hn L
ESC [ T Ln Hn NUL NUL H
27 91 84 L
0 0 Hcp Lcp 0
n Hn
DecimalFunctionApplies to Model(s)Page
ESC ? n :
27 63 n 58
ESC C
27 67
ESC D
27 68
ESC E 0
27 69 48
ESC E 1
27 69 49
ESC F Hn L
27 70 Hn L
26 71 Hn L
ESC H
27 72
ESC J
27 74
ESC K
27 75
ESC L
27 76
ESC M
27 77
ESC N n
27 78 n
ESC P
27 80
ESC Q
27 81
ESC R
27 82
ESC S
27 83
ESC T
27 84
ESC V
27 86
ESC Y
27 89
ESC Z
27 90
L
NUL
c
c
ESC g
Carriage return/feed selectionML320/321 Std.,
ML320T/321T, ML520/521
Underline printing on
ML320/321 Std.,
ML320T/321T, ML520/521
Underline printing offML320/321 Std.,
ML320T/321T, ML520/521
Paper-out sensor onML320/321 Std.,
ML320T/321T, ML520/521
Paper-out sensor offML320/321 Std.,
ML320T/321T, ML520/521
Page length set in linesML320/321 Std.,
n
n
Page length set in inches
n
n
ML320T/321T, ML520/521
ML320/321 Std.,
ML320T/321T, ML520/521
Enhanced printing onML320/321 Std.,
ML320T/321T, ML520/521
Start superscript printingML320/321 Std.,
ML320T/321T, ML520/521
Stop superscript printing
ML320/321 Std.,
ML320T/321T, ML520/521
Start subscript printingML320/321 Std.,
ML320T/321T, ML520/521
Stop subscript printingML320/321 Std.,
ML320T/321T, ML520/521
Set intercharacter spacing
ML320/321 Std.,
ML320T/321T, ML520/521
Single density graphicsML320/321 Std.,
ML320T/321T, ML520/521
Single density graphicsML320/321 Std.,
ML320T/321T, ML520/521
Double density graphics
ML320/321 Std.,
ML320T/321T, ML520/521
Insert sheet (Cut Sheet Feeder)ML320/321 Std.,
ML320T/321T, ML520/521
Emphasized printing onML320/321 Std.,
ML320T/321T, ML520/521
Eject sheet (Cut Sheet Feeder)ML320/321 Std.,
ML320T/321T, ML520/521
Proportional spacing onML320/321 Std.,
ML320T/321T, ML520/521
Proportional spacing off
ML320/321 Std.,
ML320T/321T, ML520/521
Print from code pageML320T/321T, ML520/52111
Select 15 cpiML520/52115
27 103
87
36
36
128
128
85
85
36
20
20
20
20
26
55
55
55
126
36
126
25
25
Okidata MICROLINE Standard Command Summary
xxxvii
ML Standard Command: ASCI I
DecimalFunctionApplies to Model(s)Page
ESC I 0
27 105 48
ESC I 1
27 105 49
ESC I
27 108
ESC { n
27 123 n
ESC } NUL
27 125 0
FS28Select 12 cpiML320/321 Std.,
GS
29
RS30Select 10 cpiML320/321 Std.,
US31Begin double width printingML320/321 Std.,
Incremental printing onML320/321T82
Incremental printing offML320/321T82
Emphasized/enhanced
printing off
Change emulationML320/321 Std.,
ML320/321 Std.,
ML320T/321T, ML520/521
36
125
ML320T/321T, ML520/521
Software I-PrimeML320/321T,
131
ML520/521
15
ML320T/321T, ML520/521
Select 17.1 cpi
ML320/321 Std.,
15
ML320T/321T, ML520/521
15
ML320T/321T, ML520/521
21
ML320T/321T, ML520/521
xxxviii
Okidata MICROLINE Standard Command Summary
Chapter 1: Printer Drivers
kid
Usable Drivers
The tables below summarize usable drivers for each printer emulation. They are li s ted i n order
by decreasing compatibility as you go down the list: select one from as high up on the list as
possible, based on what is available from among the drivers supplied with your software. If you
don’t see one from near the top of the list, give the software manufacturer a call to see if they
have added any drivers to those supplied when you purchased your software.
Table 1: Printer Drivers for ML320 Epson/IBM & ML321 Epson/IBM
IBM Proprinter EmulationEpson FX Emulation
IBM Proprinter II
IBM Proprinter
IBM Graphics Printer
Table 2: Printer Drivers for ML320 MICROLINE Standard
IBM Proprinter EmulationIBM X24e AGM/XLe AGM EmulationEpson LQ Emulation
Okidata ML590/1 IBM
IBM Pro
IBM Proprinter X24/XL24
IBM Proprinter XL
rinter X24e/XL24e
Use this emulation only when you
have selected an IBM Proprinter
X24e/XL24e driver and you need to
use Epson LQ high-density graphics.
Because there are some differences in characteristics such as speed or access to various
features, you may wish to experiment with different drivers.
If you must select a driver that is not lis t ed in t he t abl e, be sure t o check it t horoughl y f or pri nt
features such as boldface, underline and changes in pitch. Don’ t be surpri sed i f bol df aced
items are printed twice, underlines are misplaced, wi de spaces are l eft bet w een l i nes or the
printer behaves chaotically (turn off the printer if t he lat t er occurs). These are al l charact eri st i cs
of an incompatible driver selection.
Okidata ML590/1 Epson
Epson LQ 850/1050
E
son LQ 860/2250 (use for color
printing)
Epson LQ 2500
Epson LQ 1500
Epson LQ
OKIDATA Software Drivers
Software Drivers Online
For fastest service, you can download the latest drivers for your printer directly through
• the Okidata WorldWide Web site: http://www.okidata.com
• the Okidata OKILINK
• CompuServe
GO PCHW
1.
2.
In Library #2, select “Printer Utilities.”
®
:
®
BBS: (609) 234-5344
Chapter 1: Working with Commercial Software2
Table 7: Available Drivers
Printer ModelsAvailable DriversIf you can not download the driver:
Microsoft Windows: 3.0, 3.1, 95
Microsoft Word (DOS): 5.0, 5.5, 6.0
WordPerfect (DOS): 5.1, 5.2, 6.0
To obtain a 3½" HD diskette containing these
drivers, call 1-800-OKIDATA.
ML320 Turbo
ML321 Turbo
ML390 Turbo
ML391 Turbo
ML520
ML521
Microsoft Windows 3.1x, 95,
NT 3.51
Microsoft Windows 3.1x, 95,
NT 3.51, NT 4.0
Microsoft Windows: 3.0, 3.1, 95
Microsoft Word (DOS): 5.0, 5.5, 6.0
WordPerfect (DOS): 5.1, 5.2, 6.0
To obtain a3½" HD diskette containing the
driver you need, send a written request to
OKIDATA
PO Box 4603
Trenton, NJ 08650-9852
Select one:
#MS-9267 for Windows 3.1x
#MS-9299 for Windows 95
#MS-9300 for Windows NT
To obtain a3½" HD diskette containing the
driver you need, send a written request to
OKIDATA
PO Box 4603
Trenton, NJ 08650-9852
Select one:
#MS-9351 for Windows 3.1x
#MS-9352 for Windows 95
#MS-9353 for Windows NT 3.51
#MS-9354 for Windows NT 4.0
To obtain a diskette containing all these
drivers, send a written request to
OKIDATA
PO Box 4603
Trenton, NJ 08650-9852
ML590
ML591
Select one:
#MS-8838 for 3½" HD diskette
#MS-8839 for 5¼" HD diskette
Microsoft Windows: 3.0, 3.1, 95
Microsoft Word (DOS): 5.0, 5.5, 6.0
WordPerfect (DOS): 5.1, 5.2, 6.0
Drivers are shipped with the printer
Chapter 1: Working with Commercial Software3
Software Driver Selection
Selecting a software printer driver is usually a part of the software application installation
process. Changing printers may require use of an external routine, or may be possible f rom
within the application through menu selection.
Note:Refer to your software documentation for information on installing printer drivers.
Embedded Commands
In some cases, commercial software packages will permit you to create and/or modify the
printer driver. Even if a driver specifically designed for the printer is available, this option can
provide additional room for customization.
Typically, the driver modification routine will present a list of operations with some method for
entering printer commands, permitting substitution, such as entering the italic command in
place of the underline command. It also permits modification of an existing driver to better fit
your printer. Driver modification does require a basic familiarity with your printer’s command
set, so you should study the control codes in the chapters which fol l ow t horoughl y bef ore
attempting it.
Some programs also permit you to control your printer directly through embedded commands.
Usage of these commands in programs can provide access to a wide range of printer
capabilities that are not ordinarily supported, or, in programs like older versions of Lotus 1-2-3,
printer commands can be entered as an initialization string to set the basic format for a
document.
Chapter 1: Working with Commercial Software4
Chapter 2: Character Set Commands
This chapter describes the character set commands for your printer, includi ng
• IBM Character Sets I, II, and III
• Epson Character Sets
• Microline Character Sets
• International Character Sets
• Code Page Character Sets
• Upper Range Control Codes
• Character Table Selection
Special character sets can be substituted for the standard ASCII characters to provide foreign
characters, line draw characters, non-printable characters suc h as back space (BS), form feed
(FF), vertical tab (VT), etc. One of the Epson Character Sets provi des italics characters.
This command selects IBM Character Set II in the IBM Proprinter emulation.
Chapter 2: Character Set Commands5
Select All Character Set [IBM Set III] Command (Epson LQ)
⻬ ML390 Turbo, ML391 Turbo ⻬ ML590, ML591
FunctionASCIIDecHex
Select All Character SetESC ( ^ Ln Hn [data]27 40 94 Ln Hn[data]1B 28 5E Ln Hn[data]
Use this command to engage the All Character Set (IBM Set III) and apply it to the data which
follows the command. This allows normally non-printabl e characters to print.
Parameters Ln and H
n
Parameters Ln and Hn are used to designate how many characters you wish to print using the All
Character set:
Number of characters = L
For fewer than 256 characters, substitute the number of characters for L
+ (Hn x 256)
n
and set Hn = 0. For
n
more than 256 characters, divide the number of characters by 256 and assign the whole
number result to H
and Hn can have any value from 0 to 255 decimal .
L
n
, then assign the remainder to Ln.
n
Print Data from IBM All Characters Set [IBM Set III] Command (IBM)
This command will print the amount of data you specify within the command, using the IBM
All Characters set (also known as Character Set III).
The IBM All Characters set contains only printable characters with the exception of decimal
codes 0 and 255, and gives you a broad range of graphi cs characters and other special
symbols. This set is also a handy debugging tool for programmers, si nce you can print out and
examine files that contain control codes and escape sequences.
In the above command, you must use paramet ers Ln and Hn to specify the total count of
characters to be printed. The total count is calculated as
ESC \ Ln Hn27 92 Ln Hn1B 5C Ln H
L
+ (Hn x 256)
n
n
If you are printing fewer than 256 characters, substitute the number of characters for the value
of L
and replace Hn with 0.
n
If you are printing 256 or more characters, divide the total number of charact ers you w i sh t o
print by 256. Replace H
with the whole number result and assign the remainder to Ln.
n
Chapter 2: Character Set Commands6
Print One Character from IBM All Character Set [IBM Set III] Command (IBM)
Print Specified Character from IBM Set IIIESC ^ n27 94 n1B 5E n
This command will print only the one character you specify within the command, using IBM
Character Set III (also known as the All Characters set).
When the printer receives this command, it will print the character “n” f rom I BM Ch aract er Set
III. The value of n can be from 0 to 255 decimal (00 to FF hexadecimal).
Epson Character Set Commands
Select Epson Set 1 [Slanted Characters] Command (Epson)
In the Epson emulation, this command specifies Epson Character Set 1 for the upper ASCII
range (decimal 128 to 256). Epson Character Set 1 contains slanted characters, equivalent to
italics.
Select Epson Set 2 [Graphics Characters] Command (Epson)
In the Epson emulation, this command specifies Epson Character Set 2 for the upper ASCII
range (decimal 128 to 256). Epson Character Set 2 contains graphics characters.
Chapter 2: Character Set Commands7
MICROLINE Character Set Commands
Select MICROLINE Standard Character Set Command (ML)
In the Microline emulation, use this command to specif y a set of bl ock graphics characters that
can be used for drawing simple images and bar graphs. This set of charact ers has t he st andard
ASCII characters decimal 32 through 12 7 and t he block graphics in the upper ASCII range,
decimal 128 through 255.
In the Microline emulation, use this command to specify the IBM (line graphics) symbol set
which is comparable to IBM Set II. This set of characters has the standard ASCII characters
decimal 32 through 127 and the line graphics in t he upper ASCII characters, decimal 128
through 255.
Chapter 2: Character Set Commands8
International Character Set Commands
These commands allow you to select special internat i onal charact er set s w hi ch repl ace
less-frequently used characters with symbols used in a variety of European languages or in the
publishing industry.
Select International Character Set Command (IBM/ML)
Select International Character SetESC R n27 82 n1B 52 n
This command is used to use characters from the specified international character set to replace
the standard characters. To access these characters, replace m in the command with the
appropriate value taken from column two in the t abl e bel ow . For t he ML39 0 Turbo and ML391
Turbo printers, substitute the value of n given in Table 3 to engage characters from the Code
Page indicated.
Table 9: Epson ESC R Command —
International Character Substitutions
Decimal Value of Character
Languagen3536386479919293949596123124125126
American0#$&@O[\]^-‘{|}~
British3£$&@O[\]^_`{|}~
Danish I4#$&@OÆØÅ^_`æØå~
Danish II10#$&ÉOÆØÅÜ_鿨åü
Dutch14£$&@O[IJ]^_`{ij}~
French1#$&àO
French Canadian13ü$ëàØâçêîïôéùèû
German2#$&§OÄÖÜ^_‘äöüß
Italian6#$&@O
Japanese8#$&@O[¥]^_`{|}~
Latin American12#$&àO¡Ñ¿é_üíñóû
Norwegian9#¤&ÉOÆØÅÜ_鿨åü
Publisher64#$&§O
This command permits you to select a Code Page charact er set and t o pri nt t he amount of dat a
you specify within the command from that Code Page set. It applies to both the IBM emulation
(all models listed) and the Okidata Microline emulation (Models ML320/321 Turbo and
ML520/521 only).
Parameters Ln and H
n
These parameters specify the total count of characters t o be pri nt ed. The t ot al count i s
calculated as
+ (Hn x 256)
L
n
If you are printing less than 256 characters, substitute the number of characters for the value of
and replace Hn with 0.
L
n
If you are printing 256 or more characters, divide the total number of charact ers you w i sh t o
print by 256. Replace L
with the whole number result and assign the remainder to Hn.
n
Parameters Hcp and L
cp
These parameters specify the Code Page set to be used when printing the characters as given in
the table below.
Table 11: IBM/ML ESC [ T Command —
Code Page Parameters
Hcp valueLcp valueCode Page Set
1181USA
382Multilingual
392Canadian Fr en ch
395Portugal
397Norway
416BRASCII*
417Abicomp*
*ML320/321 Turbo and ML390/391 Turbo only.
Chapter 2: Character Set Commands11
Assign Code Page Command (Epson)
⻬ ML320 Turbo, ML321 Turbo
FunctionASCIIDecHex
Assign Code Page to
Character Set
This command allows you to assign a Code Page charact er set ( s ee Apendix C) to Epson
Character Set 1 or Set 2, which you can then select using ESC t 0 or ESC t 1, respectively.
ESC ( t 3 0
P
n1 Pn2 Pn3
27 40 116 51 48
P
n1 Pn2 Pn3
1B 28 74 33 30
P
n1 Pn2 Pn3
Parameter P
n1
This parameter specifies which character set you are replacing with a Code Page set:
= 0: replaces Epson Character Set 1
P
n1
P
= 1: replaces Epson Character Set 2
n1
Parameters Pn2 and P
n3
These parameters specify the Code Page set assigned to the designated Epson Character Set, as
given in the table below.
In the Epson emulation, the ASCII characters f r om deci mal 128 through 159 are normally
interpreted as control codes and cannot be printed. I n some cases, yo u may w i sh t o st ore
custom characters in these locations.
The ESC 6 and ESC 7 commands allow you to print cust om charact ers st ored i n these areas and
then return to ”normal” printing. These commands are not necessary in the ML590 and ML591
printers.
The ESC I n command allows you to print custom charters stored in the following ASCII areas:
00H to 06H, 10H, 11H, 15H to 17H , 19H to 1AH, 1CH to 1FH, 80H to 86H, 90H, 91H, 95H
to 97H, 99H, 9AH, or 9CH to 9FH.
ESC 6
or
ESC I 1*
ESC 7
or
ESC I 0*
27 54
or
27 73 49*
27 55
or
27 73 48*
1B 36
or
1B 49 31*
1B 37
or
1B 49 30*
Select Code Page Set Command (Epson)
⻬ ML390 Turbo, ML391 Turbo⻬ ML590, ML591
FunctionASCIIDecHex
Select Code Page SetESC ( t Ln Hn Pn1 Pn2 P
Use this command to store any four code page sets from the t abl e bel ow , engaged using the
ESC t n command.
Parameters Ln and H
n
Parameters Ln and Hn are used to designate the number of bytes to follow in the subsequent
parameters, where
Number of bytes = L
L
and Hn can have any value from 0 to 255 decimal. G eneral l y, Ln is set to 3 and Hn is set to 0.
n
Parameter P
n1
Parameter Pn1 selects the table area in which the four code page sets will be stored. You can
assign it to hexadecimal 00, 01, 02, 03, 30, 31, 32, or 33.
Parameters Pn2 and P
n3
Parameters Pn2 and Pn3 determine which code page set will be used, as follows:
to store the PC-865 Norwegian code page set in tabl e area 03.
Chapter 2: Character Set Commands14
Chapter 3: Character Size & Spacing Commands
This chapter describes the commands used to set the size and spaci ng of charact ers pri nted:
• Pitch Setting Commands
• Superscript & Subscript Commands
• Double Width & Height Comma nds
• Combined Print Features Command
• Character Spacing Commands
Pitch Setting Commands
These commands are used to select the pitch in characters per inch (cpi ) used. For example, at
10 cpi, each character is 1/10" wide. The number of characters that will fit on a line depends
on the pitch you have selected and on wheth er you have a narrow carriage or a wide carriage
printer. You can also set pitch using the printer's front panel or the menu (see “Menu Mode” in
your printer manual).
Select Character Pitch/Point SizeESC X p Pn Lp Hp27 88 70 Pn Lp Hp1B 58 46 Pn Lp H
Use this command to place the printer in the scalable font mode and to select the character
pitch and the point size. Character pitch setting range is 5 to 20 characters per inch (cpi); point
size setting range is 8 to 64 points.
For the ML590 and ML591 printers, you can select any character pitch from 5 to 20 cpi for the
LQ Courier, LQ Roman and LQ Swiss typefaces. The G othi c, Orator, Prest i ge and Sw i ss Bold
typefaces will only print in point sizes 10, 10.5 and 21. The table below shows which typeface
will print in other sizes when these typefaces are selected.
p
Note:If you wish to use this command to print to an ML320/321 Turbo printer in a UN I X
environment, you must reboot the system after the command is ent ered.
Parameter Pn is used to set the character pitch. It can have any val ue f r om 0 t o 127 decimal for
ML320/321 Turbo and for ML590/591 print ers, or f rom 0 t o 255 f or ML390/ 391 Turbo.
Table 16: Epson ESC X Command — Character Pitch Settings for Pn Values
P
n
Character Pitc h
0Remains unchanged
1Proportional
18 (2 to 19)20 cpi
2018 cpi
21 (21 to 23)17.1 cpi
24 (24 to 29)15 cpi
30 (30 to 35)12 cpi
36 (36 to 41)10 cpi
42 (42 to 47)8.6 cpi
48 (48 to 59)7.5 cpi
60 (60 to 71)6 cpi
72 (72 to 127)5 cpi
Parameters Lp and H
p
Parameters Lp and Hp are used to set the point size according to the foll ow i ng equat i on:
Subtract 255 from 432: 432 - 255 = 177., t hen round t hi s val ue down to the nearest even
number, 176. Assign this value to L
.
p
.
p
Here is a sample BASIC program to test your calculated values:
ESC$ = CHR$(27)
LPRINT ESC$; "@";
LPRINT "This is a test of the Select Pitch and Point Size Command."
LPRINT "This is the default text mode."
LPRINT "The characters below should be the maximum character height of 216
ESC DLE F Pno Pn Lp Hp27 16 70 Pno Pn Lp Hp1B 10 46 Pno Pn Lp H
p
Use this OKI unique command to select print abl e f onts by charact er pi t ch and point size.
Parameter P
no
This parameter is used to give the number of bytes to follow in the subsequent parameters. It
can have any value from 0 to 255 decimal. General l y, a val ue of 3 i s assi gned t o P
Parameter P
n
.
no
Parameter Pn is used to set the character pitch. It can have the fol l owi ng val ues:
ML320 Turbo, ML321 Turbo: 0 1o 127
ML390 Turbo, ML391 Turbo: 0 to 255
ML590, ML591: 0 to 127
See "Table 16: Epson ESC X Command — Character Pitch Settings for P
Values," above.
n
Chapter 3: Character Size & Spacing Commands19
Parameters Lp and H
p
Parameters Lp and Hp are used to set the point size according to the foll ow i ng equat i on:
N
= [Lp + (Hp x 255] x 0.5
p
and Hp can have any value from 0 to 255 decimal .
L
p
See "Table 17: Epson ESC X Command — Point Si zes f or N
* This command is also valid for the ML390 Turbo, ML391 Turbo, ML590 and ML591 in Epson
LQ emulation; it duplicates the ESC w command.
Double height printing produces characters that are t w i ce as t all as normal si ze charact ers. i t
can be combined with double width and emphasized printing for an even more striking effect.
When you use double height printing, you will need to adjust the line spacing to accommodate
the taller characters.
Chapter 3: Character Size & Spacing Commands21
Double Width & Height Printing Commands
The double width & height comman ds al l ow you t o sel ect double width, double height, or
double width and double height pri nt i ng i n t he I BM emulat i on.
Table 19: IBM ESC [ @ Command — Character Width for n2 Values
Decimal Value of n
0Unchanged
1Standard
2Double
For example, to use double height characters wi t h doubl e t he normal l i ne spaci ng, w i t hout
changing the width of the characters use this BASI C st at ement:
This command lets you select print quality, character pitch, and several other printing features
with a single command. The values of the four variables (n
1 n2 n3 n4
are selected.
To calculate the value for each variable, first find the features you want in the Variable Values
table below. Next, add the corresponding val ues f r om col umn one for each variable. Then add
the appropriate factor for each variable taken from Tabl e 22.
Table 21: ML ESC & Command —
Print Features for n
, n2, n3 and n4 Values
1
) determine which features
Valuen
1
n
2
n
3
n
4
110 cpiCancel sup er/s ubs crip tsUtilityHSD
212 cpiSub scr i ptsNLQN/A
417.1 cp iSup er s cr ipt sCustom character sUnderlining
820 cpiEmp ha si ze dItalicsDouble height
16Double widthEnhancedN/AN/A
Table 22: ML ESC & Command —
Variable Factors for n1, n2, n3, n
VariableFactor
n
1
n
2
n
3
n
4
Here are some pointers on using this command:
• You don't have to use all four variables; use only t he ones t hat cont rol t he f eat ures you want
to change.
• You can enter the variables in any order.
32
64
96
112
4
• Be sure to add in the variable factor when calculat i ng the vari abl e val ues—this number tells
the printer which variable is which.
• You'll get unexpected results if you select incompatible features (e.g., if you pick both 10
and 12 cpi), or if you've added up the values incorrectly.
Chapter 3: Character Size & Spacing Commands24
For example, to set 10 cpi, emphasized, NLQ and un derl i ning usi ng t hi s command, you would
calculate the values for n
n
= 1 + 32 = 33
1
n
= 8 + 64 = 72
2
n
= 2 + 96 = 98
3
n
= 4 + 112 = 116
4
, n2, n3, and n4 as follows:
1
The resulting BASIC statement looks like this:LPRINT CHR$(27);”&”;CHR$(33);CHR$(72);CHR$(98);CHR$(116);”:”
Character Spacing CommandsThe character spacing commands include commands to turn proportional spacing on and off,
as well as commands for increasing the standard spacing betwee n characters at a fixed value.
In the ML320 E/I, ML321 E/I, ML320 Std., ML321 Std., ML320 Turbo, ML321 Turbo, ML520,
and ML521, proportional spacing is available only with Near Letter Quality (NLQ) and Utility
(UTL) printing.
In the ML390 Turbo, ML391 Turbo, ML59 0 and ML591, proportional spacing is available only
with Letter Quality (LQ) printing.
This command adjusts the space between letters to compensate f or t he varying w i dt hs of
individual characters. Unlike fixed spacing, w here al l characters are f ormed w i t hin a mat r i x of
uniform width at a specified pitch, proportional spacing gives more horizontal space to wide
characters, like w or M, and less to narrow characters, like I or f. The resulting print is more
attractive and easier to read than fixed-space printing.
Because the characters have different widths, proportionally spaced fonts have no fixed pitch;
therefore margin settings are only approximate unless your software specifically supports
proportional spacing.
You can also select proportional spacing using t he pri nt er menu or the f r ont panel buttons. In
addition, proportional spacing is one of the f eat ures avai l abl e t hrough t he composite command
in the Epson mode.
Chapter 3: Character Size & Spacing Commands25
Intercharacter Spacing Commands (IBM/E/ML)Note:Intercharacter spacing can NOT be set in the HSD and bit image graphics mo des.
* For the ML390 Turbo and ML391 Turbo, bit 7 is ignored.
ASCII: ESC V n
Dec: 27 86 n
Hex: 1B 56 n
ASCII: ESC SP n
Dec: 27 32 n
Hex: 1B 20 n
ASCII: ESC SP n
Dec: 27 32 n
Hex: 1B 20 n
ASCII: ESC SP n
Dec: 27 32 n
Hex: 1B 20 n
ASCII: ESC N n
Dec: 27 78 n
Hex: 1B 4E n
The standard spacing between characters is 3 dot s col umns. These commands are used to add
additional spacing between characters, added to the right of each character. The value is
expressed in dots; the number of dots per inch depends on t he current pri nt mode. The t able
below shows the amount of space added for each cpi setting.
Table 23: IBM ESC V and ESC SP & Epson ESC SP Commands —
Character Spacing (in Inches)
SettingAmount of space added
10 cpin/120"12 cpin/144"15 cpin/180"
17.1 cpin/206"20 cpin/240"
For example, to add 8/120" spacing to your printi ng at 10 cpi , use t hi s BASI C command:
Use High Speed Draft (HSD) or Utility (UTL) printing for drafts and other documents that you
want to print quickly. HSD is faster and its characters somewhat rougher than utility.
Near Letter Quality (NLQ) printing is slower than HSD and UTL, but the characters are crisper
and more like the characters produced by a typewriter. U se N LQ f or fi nal drafts and i mport ant
documents where appearance matters.
You can also use your printer’s front panel or the menu to set the print quality, but settings
made using the front panel are likely to be overridden by software applications.
To select the NLQ print mode in the Epson emulati on, you must send t w o commands: ESC x 1
and ESC k n. The ESC x 1 command must be sent to the printer first, followed by the ESC k n
command. Parameter n designates which font will be used as follows:
n=0: Courier NLQ
n=1: Sans Serif NLQ
Chapter 4: Character Style Commands29
Individual Print Mode & Font Commands for 24-Pin Printers (IBM/E)
⻬ ML390 Turbo, ML391 Turbo
FunctionASCIIDec.Hex.
Select Utility Print ModeESC x 027 120 481B 78 30
Select LQ Print ModeESC x 127 120 491B 78 31
Select LQ Print Mode & FontESC k n27 107 n1B 6B n
Use Utility printing for drafts and other documents that you want to print quickly.
Letter Quality (LQ) printing is slower than utility printing, but the characters are much crisper
and sharper. Use LQ for top-quality printing of final drafts and important documents, where
appearance matters.
You can also use your printer’s front panel or the menu to set the print quality, but settings
made using the front panel are likely to be overridden by software applications.
The ESC k n command allows you to select a specific font for the LQ mode. Substitute a value
for n from the table below.
Select Print Quality and Character SpacingESC I n27 73 n1B 49 n
This command allows you to select print quality and character spacing for resident fonts for all
models listed. It also allows you to select print quality and character spacing for downline
loadable (DLL) fonts for all but Models ML390 Turbo and ML391 Turbo. Substitute a value for
n from the table below.
Table 26: IBM ESC I Command —
Print Modes Coresponding to n Values for All 9-Pin Models
This command lets you use any combination of the features listed in the table below. The value
of n can range from 0 to 255. To determine the value of n, add up t he values for all the features
you wish to use. To turn off all these features and return to 10 cpi printing, substitute 0 for n.
For example, to print underlined italics at 12 cpi, assi gn n t he val ue of 193 ( 128 + 64 + 1) .
Each time you send this command, it sets or cancels t he values f or al l ni ne of t he feat ures it
controls (the eight features listed in the table, plus 10 cpi). This means that if you've requested
12 cpi underline italics, and then want to add emphasized printing to these features, you must
add 8 to 193 and resend the command as ESC ! 210. I f you send t he command ESC ! 8, it will
turn off all the other features as it turns on emphasized print.
To see the range of print styles you can produce wit h the ESC ! n command, run the following
BASIC program which prints a sample of each possi bl e combination. Please note that since the
program prints all 256 combinations, it will take a few minutes and about 12 pages for the
entire sample to print.
10FORI=0TO255
20 LPRINT:LPRINT
30 LPRINT CHR$(27);"!";CHR$(I);"ESC !";I;" selects this combination."
40 NEXT I
Italics printing is slanted, like this, and is used to lend emphasis to phrases, sentences, or entire
paragraphs.
Chapter 4: Character Style Commands35
ASCII: ESC 4
Dec: 27 52
Hex: 1B 34
ASCII: ESC 5
Dec: 27 53
Hex: 1B 35
ASCII: ESC ! /
Dec: 27 33 47
Hex: 1B 21 2F
ASCII: ESC ! *
Dec: 27 33 42
Hex: 1B 21 2A
If you intend to print an entire document in italics, you can use the printer menu to select
italics. You will find italics in the menu under the group “Font” and the setting “Style.” See
“Menu Mode” in your printer manual for more information on making changes in the menu
settings.
Your printer produces bold type by printing each dot of a character twice instead of once. In
emphasized printing, the pairs of dots are offset horizontally. In enhances printing, the pairs of
dots are offset vertically.
You can combine emphasized and enh anced printing for an especially bold effect. For
headlines, try using them in combination wit h dou bl e w i dt h charact ers; you can also combine
emphasized printing with double height ch aract ers.
The underline feature underscores all characters, i ncludi ng t he space character, but does not
underscore graphics or the space produced by any horizontal positioning command such as
horizontal tab.
In the Epson emulation, you can also use the Combined Print Mode (ESC ! n) command to
engage underlining.
The overscore feature prints a continuous li ne over al l charact ers, i ncl udi ng t he space
character, but does not overscore the space produce d by a horizontal tab command. This
feature is available only in the IBM emulati on.
Score Style Command (Epson)
⻬ ML390 Turbo, ML391 Turbo
FunctionASCIIDecimalHexadecimal
Select Score StyleESC ( - Ln H
Pn D1 D
2
This command lets you set underline, strike-through an d overscore styles: continuous, dashed,
single or double lines.
27 40 45 Ln H
n
Pn D1 D
n
2
1B 28 2D Ln H
Pn D1 D
2
n
Parameter Pn
Parameter Pn is set to 01 hex (1 dec, SOH ASCII).
Parameters Ln and H
n
Parameters Ln and Hn designate the quantity of data to be scored, according to the following
equation:
L
+ (Hn x 256)
n
and Hn are less than 3, the designated data will be dumped.
If L
n
Chapter 4: Character Style Commands37
Parameters D1 and D
2
Parameter D1 is used to set the type of score and parameter D2 is used to set the attributes, as
indicated in the table.
Table 33: Epson ESC ( - Command —
Score Styles for D1 and D2 Values
D1D2Score Style
11Continuous, single underline
21Continuous, single strike-through
31Continuous, single overscore
12Continuous, double underline
22Continuous, double strike-through
32Continuous, double overscore
15Dashed, single underline
25Dashed, single strike-through
35Dashed, single overscore
16Dashed, double underline
26Dashed, double strike-through
36Dashed, double overscore
Using a value of 0 for D2 will cancel the score mode.
Note:Scores can only be used for printing characters: they can't be used to print line graphi cs
The outline feature prints characters as outlines with hollow center. The shadow feature prints
characters with a shadow behind them. Combining the features produces outline characters
with a shadow behind them. These features can be used to produce more interesting and stylish
headings. They can be combined wit h emphai szed and/or enhanced printing, double width,
etc., for an even more striking effect.
Note:Outline and shadow can only be used for printing characters: they can't be used to
print line graphics.
Chapter 4: Character Style Commands38
Chapter 5: Custom Character Commands
Your printer's custom (down line loadable) character f eat ure enables you to design your own
characters and symbols, even entire character sets i f you choose, and download them from
your computer to the printer. You can design and store multiple characters. The actual
designing of these characters requires some work on your part and c an become tedious. We
strongly recommend using a commercial softw are package to help you create new characters
and download them to your printer. There are also packa ges t hat provi de character sets that
have already been designed for you.
This chapter describes the custom character commands for your printer, i ncludi ng
• ROM to RAM Copy Commands
• Down Line Loading Commands
• Custom Character Set Commands
• Select DLL Font Commands
The chapter is divided into two sections: one f or the 9-pi n pri nt ers and one f or the 24-pi n
printers.
Custom Character Commands: 9-Pin Printers
Designing a Custom Character for 9-Pin Printers
The technique of designing your own cust om characters is much like that of designing a
graphic image, but on a much smaller scale. You can desi gn characters in either Utility or Near
Letter Quality mode: simply activate the desired mode before you download the characters.
Begin by designing your character on a grid. The height of t he grid f or a normal charact er i s 7
dots, each corresponding to a pin on the printer's pri nt head. The w i dt h of t he gri d usable f or a
character is a maximum of 11 dots (the twelfth dot in the grid width is reserved as blank).
The 7-dot grid can be adjusted up or down several dot positions by using the attribute byte in
the print command. This byte specifies whether the character is an ascender (top 7 rows) or a
descender (bottom 7 rows). The attribut e byt e al so cont ains ot her i nf ormat i on about t he
character, as explained later.
The character's baseline lies below the seventh dot f r om t he top i f it i s an ascender, or below
the sixth dot from the top if it is a descender. The columns of the matrix to the left and right of
your character affect where it will appear in relation to the characters on either side of it. There
is one mandatory blank column at the end of t he charact er ( col umn 12). If you don't leave
blank columns, adjacent characters may app ear t o run right i nt o your charact er.
Chapter 5: Custom Character Commands39
Your arrangement of dots is translated into code that t ell s your pri nter t he exact l ocat ion of
each dot within each column. The example which follows illustrates how this works.
This character is 9 dots wide and is flush to the left. We'll print it in 10 cpi utility mode. Just
like 8-pin graphics, each byte specifies a dot column, and the value of each byte is determined
by adding up the values of its bits.
Note:In all print modes, you cannot place two dots next to each other hori zont al l y—you
must skip one column.
Now we need to give the commands that download this data to the printer.
Copy ROM Character Set to RAM Character SetESC $27 361B 24
This command copies a complete set of the characters resident in the printer to the area of its
memory reserved for custom characters. The new character will become part of this character
set. This makes it possible to mix standard characters with your custom ch aract ers w hen y ou
print.
Chapter 5: Custom Character Commands40
Down Line Load Characters Command for 9-Pin Printers (IBM)
Use this command with the ML520 or the ML521 printer to begi n downloading the characters.
1B 3D c
[data]
a
1 a2
1 c2
m n
Parameters c1 and c
2
These parameters specify the total count of characters t o be dow nl oaded. How these variables
are calculated depends on which mode is engaged: Utility printing or Near Letter Quality
(NLQ) printing.
For Utility printing:
value = (# of characters to be changed x 13) + 2
For NLQ printing:
value = (# of characters to be changed x 48) + 2
If the value obtained is less than 256, substitute the value for c
If the value obtained is 256 or more, divide the val ue by 256. Replace c
number result and assign the remainder to c
.
1
and replace c2 with 0.
1
with the whole
2
Parameter m
This parameter selects the print quality:
m = 20: Utility printing
m = 21: NLQ printing
Parameter n
This parameter specifies the ASCII value of the starting character in the set to be redefined
(characters must be redefined in sequence) and can be assi gned any value in the range 0 to
255.
Parameters a1 and a
2
These parameters designate the attributes of t he character.
Parameter a
1
Parameter a1 denotes whether the character is an ascender or descender:
a1 = 0: ascender
= 128: descender
a
1
Chapter 5: Custom Character Commands41
Here is a breakdown of the definitions for the various bit values for a
Bit b
:
7
= 0: ascender
b
7
b
= 1: descender
7
Note: If b
Bits b
6
Bits b
1
, b0 = 0, 0: No expansion to 12 dots high: b7 valid
b
1
b
, b0 = 0, 1: Selects line draw characters; data is expanded to a total height of 12
1
, b0 = 1, 0: Shaded character; data is expanded to a total height of 12 dots in two
b
1
, b0 = 1, 1: NUL is expanded to a total height of 12 dots in two passes: b7 ignored.
b
1
or b1 is 0, b7 is ignored.
0
, b5, b4, b3, b2: ignored
and b0:
dots in two passes: b
passes: b
ignored.
7
ignored.
7
:
1
Parameter a
2
Parameter a2 denotes the total width of the character in dots.
End the command with the data for the character calculated from your grid. If you're
downloading several characters, you only need one ESC & NUL command, and you only need
to include m and n once, but you must include a value f or paramet er a i n each set of character
data.
Chapter 5: Custom Character Commands42
Epson Custom Character Commands for 9-Pin Printers
Copy ROM to RAM Command for 9-Pin Printers (Epson)
⻬ ML320 E/I, ML321 E/I⻬ ML320 Turbo, ML321 Turbo
FunctionASCIIDecHex
Copy ROM Character Set
to RAM Character Set
This command is used with the ML320 E/I, ML321 E/I, ML320T, or ML321T printer to copy a
complete set of the characters resident in the printer to the area of its memory reserved for
custom characters. The new character will become part of this character set.
⻬ ML520, ML521
FunctionASCIIDecHex
Copy ROM Character Set
to RAM Character Set
This command is used with the ML520 or ML521 printer to copy a complete set of the
characters resident in the printer to the area of its memory reserved for custom characters. The
new character will become part of this character set. This makes it possible to mix standard
characters with your custom characters when you print.
Parameter n is used to specify the NLQ font to be used:
n = 0: NLQ Courier
n = 1: NLQ Sans Serif
ESC : NUL NUL NUL27 58 0 0 01B 3A 00 00 00
ESC : NUL n NUL27 58 0 n 01B 3A 0 n 0
Down Line Load Characters Command for 9-Pin Printers (Epson)
Use this command to begin downloadin g t he charact er( s ) .
Parameters n1 n
2
These parameters specify the range of characters to be replaced with new ones. Multiple
characters must be assigned to adjacent locations. Param eter n
will be replaced; parameter n
Custom characters can normally be assigned to deci mal l ocati ons 32 t o 126 and 160 to 255. If
IBM Character Set II is selected (ESC 6 command), charact ers can al so be assi gned to locations
128 to 159.
Parameter a
This parameter indicates how the character will be positioned within its grid as follows:
Ascenders: a is calculated as
last dot column of character + (first dot column x 16) + 128
ESC & NUL n1 n2 a
[data]
indicates the last character that will be replaced.
2
27 38 0 n1 n2 a
[data]
indicates the first character that
1
1B 26 00 n1 n2 a
[data]
Chapter 5: Custom Character Commands43
Descenders: a is calculated as
last dot column of character + (first dot column x 16)
Parameter a can be assigned any value in the range 0 to 255.
End the command with the data for the character calculat ed f r om yo ur gri d.
If you're downloading several characters, you o nl y need one ESC & NUL command, and you
only need to include n
and n2 once, but you must include a value for param eter a i n each set
1
of character data.
Custom Character Set On/Off Commands for 9-Pin Printers (Epson)
Select Standard Character SetESC % 027 37 481B 25 30
Select Custom Character SetESC % 127 37 491B 25 31
To switch from the standard character set to the custom character set , use t he ESC % 1
command.
To switch back to the standard character set, use the ESC % 0 com m and. Ot herw is e, t he
custom character set will remain in the printer's memory until one of the following happens:
you turn off the printer
you reset the printer with the ESC @ command
you overwrite them with new custom characters
you use the ESC : NUL NUL NUL command to overwrite them with the standard character set.
Chapter 5: Custom Character Commands44
Okidata MICROLINE Standard Custom Character Commands
for 9-Pi n Printers
Copy ROM Character Set to RAM Character SetESC $27 361B 24
This command copies a complete set of the characters resident in the printer to the area of its
memory reserved for custom characters. The new character will become part of this character
set. This makes it possible to mix standard characters with your custom ch aract ers w hen you go
to print.
Down Line Load Characters Commands for 9-Pin Printers (ML)
ESC % A m n1 ... n1127 37 65 m n1 ... n111B 25 41 m n1 ... n
ESC % D m n
... n1127 37 68 m n1 ... n111B 25 44 m n1 ... n
1
11
11
To begin downloading an ascender ch aract er, use t he ESC % A m n1 ... n11 command. This
command specifies that the new character will be an ascender.
To begin downloading a descender ch aract er, use t he ESC % D m n
... n11 command. This
1
command specifies that the new character will be a descender.
Parameter m
This parameter specifies the character that will be replaced by the custom character. Custom
characters can be assigned to decimal locations 32 t o 127 and 160 to 223.
Data n1 through n
11
n1 through n11 specify the data for the character, calculated from your grid.
Select DLL in Utility ModeESC 227 501B 32
Select DLL in Near Letter Quality ModeESC 727 551B 37
The ESC 2 command switches custom character printing on when the printer is set for the
Utility mode.
The ESC 7 command switches custom character printing on when the printer is set for the Near
Letter Quality (NLQ) print mode. NLQ custom characters are just like Utility custom characters,
except that overprinting is used to make them match the NLQ character set .
Once you have selected the Custom Character Set, it will remain in memory until the printer is
turned off. Any one of the following will also delete the Custom Character Set from the printer's
Chapter 5: Custom Character Commands45
memory:
• you reset the printer with the ESC CAN command
• you overwrite them with new custom characters
• you use the ESC $ command to overwrit e t hem w it h the Standard C haract er Set .
Custom Character Commands: 24-Pin Printers
Designing a Custom Character for 24-Pin Printers
The technique for designing your own custom charact ers i s much l i ke t hat of desi gni ng a
graphic image, but on a much smaller scale. You can desi gn characters in either Utility or LQ
mode: simply activate the desired mode before you downl oad the characters.
Begin by designing your character on a grid. The hei ght of t he gri d i s 24 dot s, each
corresponding to a pin on the printhead. The wi dt h of t he gri d, as w el l as the wi dt h of t he
character itself, depends on the print mode.
Table 35: Custom Character Commands —
Character/Grid Width for Print Modes (24-Pin Printers)
d0 = space to the left of the character
= width of the character itself
d
1
d
= space to the right of the character
2
Print ModeMax. Character Width (d1)Max. Total Grid Width (d0 + d1 + d2)
Utility15 dots18 dots
LQ37 dots42 dost
Proportional37 dots42 dots
Note:If the printer is in superscript or subscript mode, only the first two or last two bytes are
needed for each column.
Characters are designed on a grid made up of columns of 24 dots. Each column, in turn, is
divided into three 8-dot groups, and each 8-dot group is represented by a byte of data.
When designing a character, keep the intended use for t he character in mind. If the character is
to be included with text, leave the top and bot t om t w o row s of t he gri d bl ank, i n keeping w i t h
general font design standards. The character's basel ine occurs at the sixth dot from the bottom.
The columns of the grid to the left and right of your character affect where it will appear in
relation to the characters on either side. If you don't l eave bl ank col umns, adj acent characters
may appear to run right into your custom character.
Chapter 5: Custom Character Commands46
Your arrangement of dots is translated into code that t ell s t he print er the exact locat i ons of each
dot in each column. The example below show s how t hi s w orks.
128
64
32
Byte 1
Byte 2
Byte 3
The width of the grid in dots depends on the printi ng mode i n use. Thi s example character is 27
dots wide and has 4 blank columns on either side. We'll print it in 10 cpi Letter Quality. Since
the character is being printed in 24-pin mode, three bytes of data are required to specify a
single column. Just like high resolution 24-pin graphics, the first three bytes specify dot
positions for the second column, and so on up to the last column in which dots will appear.
The value of each byte is determined by adding up the values of its bits.
Note:The command up to parameter m need only be included once for each down loading
sequence. The following parameters apply to the specific characters, and must be
included for each individual character i n t he sequence.
Parameters ad
ad
1
2
These parameters specify the starting address of the character, as follows:
character address = ad
+ (ad2 x 256)
1
Parameter id
1
Here is a breakdown of the bit values for id1:
to b5 = Number of columns to be loaded (1 to 63)
b
0
b
= 0: Load to RAM
6
1: Copied from ROM character generator
= 0: Normal character
b
7
1: Elongated character
Parameter id
2
Here is a breakdown of the bit values for id2:
to b5 = Character width (1 to 63, proportional)
b
0
b
, b7 = 0, 0: Data for pins 19 to 24 copi ed t o pins 25 t o 30
6
0, 1: Data for pins 23, 24, duplicated f or pi ns 25, 26, 27, 28, 29, 30
1, 0: Underline
1, 1: No elongation
Parameters d1 d2 d3 d4 d
5
Each bit of the parameter bytes indicates whether the data in the specified column is identical
to the previous column or is new.
bit = 0: data is new
Chapter 5: Custom Character Commands48
bit = 1: data is a repeat of previous column
The parameters specify data repetition as follows:
: columns 1 to 8
d
1
d
: columns 9 to 16
2
d
: columns 17 to 24
3
: columns 25 to 32
d
4
d
: columns 33 to 40
5
Epson Custom Character Commands for 24-Pin Printers
First use the Copy ROM to RAM command to copy a com pl ete set of t he charact ers resi dent in
the printer ot the area of its memory reserved for custom characters. The new character you
designed will become part of this character set.
To begin downloading the custom character, use t he D ownl oad Custom Characters Command
to specify the range of characters that you will be replacing with new ones, to indicate how
you have positioned the character withi n it s gri d, and to supply t he dat a for t he charact er( s) ,
calculated from your grid(s).
To switch between the standard character set and y our cust om character set, use the
Custom
Character Set On/Off Command.
Copy ROM to RAM Command for 24-Pin Printers (Epson)
⻬ ML390 Turbo, ML391 Turbo⻬ ML590, ML591
FunctionASCIIDecHex
Copy ROM Character Set
ESC : NUL n NUL27 58 0 n 01B 3A 00 n 00
to RAM Character Set
This command is used to copy a complete set of the characters resident in the printer to the
area of its memory reserved for custom characters. The new character will become part of this
character set.
Chapter 5: Custom Character Commands49
Parameter n
Parameter n is used to specify the font to be used.
Table 36: Epson ESC : Command — Fonts for n Values
Value of nFontValue of nFont
0Roman6OCR-A
1Swiss7Orator
2Courier (default)8Orator-S
3Prestige122Swiss Bold
4Script124Letter Gothic
5OCR-B126Font set on Menu
Down Line Load Characters Commands for 24-Pin Printers (Epson)
⻬ ML390 Turbo, ML391 Turbo
FunctionASCIIDecHex
Load Custom CharactersESC & m n1 n
d0 d1 d2 [data]
2
27 38 m n
1 n2
d0 d1 d2 [data]
1B 26 m n
1 n2
d0 d1 d2 [data]
⻬ ML590, ML591
FunctionASCIIDecHex
Load Custom Characters
ESC & NUL m n
d0 d1 d2 [data]
1 n2
27 38 0 m n
1 n2
d0 d1 d2 [data]
1B 26 00 m n
d0 d1 d2 [data]
1 n2
Use these commands to begin downloading the c haract er( s) t o t he print er.
Parameter m
This parameter selects the available area in RAM. The only avai l abl e val ues/ l ocati ons are m = 0
or m = 128.
Parameters n1 n
2
These parameters specify the range of characters to be replaced with new ones. Multiple
characters must be assigned to adjacent locations.
Parameter n
Parameter n
Parameters d0 d1 d
indicates the first character that wil l be replaced: range 0 to 127.
1
indicates the last character that wil l be replaced: range 1 t o 127.
2
2
These parameters define the width of the character grid in dots as follows:
= width of space before the character
d
0
= width of the character
d
1
d
= width of space after the character
2
Follow these parameters with the data calculated from your grid as shown above in the section
“Designing a Custom Character for 24-Pin Printers.”
Chapter 5: Custom Character Commands50
Custom Character Set On/Off Command for 24-Pin Printers (Epson)
⻬ ML390 Turbo, ML391 Turbo⻬ ML590, ML591
FunctionASCIIDecHex
Select Standard Character SetESC % 027 37 01B 25 00
Select Custom Character SetESC % 127 37 11B 25 01
To switch from the standard character set to the custom character set , use t he ESC % 1
command.
To switch back to the standard character set, use the ESC % 0 com m and. Ot herw is e, t he
custom character set will remain in the printer's memory until one of the following happens:
• you turn off the printer
• you reset the printer with the ESC @ command
• you overwrite them with new custom characters
• you use the ESC : NUL NUL NUL command to overwri t e t hem w i t h t he standard charact er
set.
Load Custom Character Set into Upper ASCII Command for 24-Pin Printers (Epson)
⻬ ML390 Turbo, ML391 Turbo⻬ ML590, ML591
FunctionASCIIDecHex
Select Custom Character SetESC t 227 116 21B 74 02
This command loads the custom character set (decimal 0 t o 127) i nt o t he upper ASCII range
(128 to 255).
Chapter 5: Custom Character Commands51
Chapter 6: Graphics Commands for 9-Pin Printers
Overview
Your printhead has one column of pins. Images are created as the pins “fire,” striking the
ribbon against the paper to produce dots. Whit e spaces appear where the pins don't fire. In 8pin graphics, each column of dots is represented by a single byt e of dat a. Models ML320,
ML321, ML320 Turbo, ML321 Turbo, ML520, and ML521 use the 9-pin mode in cases where a
slightly higher resolution is required: it uses two byt es t o represent each dot col umn.
When you program a graphic image, your program has to descri be t he patt ern of dot s you w ant
to print. Graphics data, like all other data sent t o the printer, consi st s of a series of byt es. Each
of the eight bits in a byte of graphics data corresponds to one pin on the printhead. A bit's
value can be either 1 or 0. When the printer receives the data, i t i nterpret s a bi t wit h a val ue of
1 as a command to fire the corresponding pin. Bits t hat are set t o 0 don' t cause pi ns t o f i re.
You can picture the byte as a column of 8 bit s. I n 8-pi n graphi cs, t he body of dat a i s a seri es of
these columns lined up next to each other. Instead of sending the data to the printer bit by bit,
you'll probably want to convert this binary information into decimal or hexadecimal format for
use with your programming language. In the figure below we show how to determine the
decimal value for a given pattern of pins.
For optimum registration when printing graphics using bi-directional printing, use the Print
Registration item in the printer menu to fine-tune the alignment of the vertical bars which print
as part of the menu. Keep changing the setting until the lines of the vertical bar characters have
the straightest vertical column.
Chapter 6: Graphics Commands for 9-Pin Printers53
Programming Graphics in BASIC
One important thing to remember when you're programming graphics is not to include
extraneous line feeds in your programs. Using a semicolon after the data in an LPRINT
statement will keep the print position on the same line.
However, there is an additional complication: by default, BASIC assigns to all printers a
maximum line length of 80 characters. After the printer has recei ved 80 byt es of data, i t w ill
automatically perform a carriage return and line feed. Since graphics data typically consists of
many bytes, it's quite easy to exceed this limit. The resulting output will be garbled. You can
work around this problem by setting the line length to the maximum allowable value, 255. Put
one of these statements at the beginning of your program:
These graphics modes correspond to the 8-pin modes and are su pport ed by most current
DOS-based graphics software.
Parameters Ln and H
n
These parameters tell the printer how many bytes of graphics data to expect. Eight-pin graphics
have one byte of data per column. To calculate t he val ues f or L
and Hn, first determine how
n
many columns of dots there will be in your graphics image. Divide this number by 256 and
assign the whole number result to H
or 1B 51
Select Double Density GraphicsESC R27 821B 52
Select Double Speed &
ESC # Q27 35 811B 23 51
Quadruple Density Graphics
Use these commands to select the density of the printing that will be used: single density (60
dpi), double density (120 dpi), or quadruple density (240 dpi). The quadruple density selection
command also engages double speed.
Once you've selected the density you want t o use, you have to design your graphic image.
Begin by mapping out the pattern you want t o pri nt on a pi ece of graph paper. Here is a sample
pattern for a triangle:
Parameters Ln and H
n
These parameters tell the printer how many columns of data you'll be sending: 8-pin modes
have one byte of data per column. To calculate t he val ues, f i rst det ermi ne how many col umns
of dots there will be in your graphics image. Divide t his number by 256 and assign the whole
number to H
; assign the remainder to Ln.
n
In our triangle example, each triangle requires 16 columns. We'll be printing a row of 6
triangles, so the total number of columns in the image i s 6 x 16, or 96. D i vi di ng 96 by 256
gives a value of 0 for Hn with a remainder of 96, which we'll assign to Ln.
Next, we can write a BASIC statement t hat sends t he comman d begi n 8-pin graphics:
LPRINT CHR$(27);”*”;CHR$(3);CHR$(96);CHR$(0);
Note:Be sure to include the semicolon(;) at the end of this statement. That way, the printer
won't insert a carriage return and line feed before your graphics dat a.
The listing below is a BASIC program for the Epson emulation that will generate a row of six of
our triangles in quadruple density. To print the pattern at another density, change the value of
D in line 10 to one of the other density codes.
10 D=3 ‘Density code for quadruple density (Epson)
20 WIDTH “LPT1:”,255 ‘Set printer for maximum line width
30 LPRINT CHR$(27);”*”;CHR$(D);CHR$(96);CHR$(0);
40 REM CHR$(D) is the density; in this case D=3 for quadruple density
50 REM CHR$(96) and CHR$(0) indicate the number of columns
60 FOR I=1 TO 6 ‘Repeat triangle pattern six times
70 FOR J=1 TO 16 ‘Each triangle has 16 columns
80 READ A ‘Read the column
90 LPRINT CHR$(A); ‘Send the byte to the printer
100NEXTJ‘Nowprintthenextcolumn
110 RESTORE ‘Go back to the beginning of the DATA statements
120 NEXT I ‘Now print the next triangle
130 END
140 DATA 1,3,7,15,31,63,127,255,255,127,63,31,15,7,3,1
You can use this command to reassign any of the 8-pin gra phi cs modes t o o ne of t he graphi cs
commands (ESC K, ESC L, ESC Y, or ESC Z) .
Parameter m
This parameter designates which of the four commands you're redefining. Substitute one of the
four letters (K, L, Y, or Z) for m in the command.
Parameter n
This parameter designates the density of the mode you are reassi gni ng to t he redef i ned c ode.
Substitute the appropriate value (0 through 7) for the density you wish to select, as taken from
the 8-Pin Graphics Density Codes table earlier in this chapter.
When you are ready to print a graphics pattern, send the redefined command, followed by the
graphics data.
For example, the following BASIC statement reassi gns quadruple density to the command ESC
L:
This command permits use of all nine pins on the print head. I t operat es exact l y l i ke t he ESC *
command, except that dot columns are given tw o byt es each i nstead of one. The first byte for
each column represents the top eight pins, j ust like the ESC * command. The second byte is
128 if the bottom (9th) pin is to be fired, and zero if it's not to be fired.
Use this command to select the density and to define the speed and “word size.”
Parameter n
1
This parameter specifies the density. To calculate the value of n1, first select the dpi and density
you want, then determine the n
values for each from the table below. Ad d t hem t ogether, t hen
1
add 96 to the total.
1B 2A n
3A
1 n2
Chapter 6: Graphics Commands for 9-Pin Printers57
Table 38: ML ESC * Command —
Densities for n1 Values (9-Pin Printers)
Dots per inch/DensityValue of n
1
60 dpi1
72 dpi2
Single density4
Double density8
Quadruple density16
For example, for 60 dpi printing at quadruple density, t he val ue of n1 would be calculated as
follows:
n
= 1 + 16 + 96 = 113
1
Parameter n
2
This parameter specifies the speed of the printing and a word length of 8 bits. To calculate the
value of n
below. Next, select 7 or 8-bit graphics and determi ne the val ue of n
, first select the speed and determine the value of n2 for that speed from the table
2
for that word size from the
2
table. Add each of these two values together, then add 64 to the total.
Table 39: ML ESC * Command —
Speed & Word Sizes for n2 Values (9-Pin Printers)
Speed/Word SizeValue n
Normal speed0
Double speed8
7-bit graphics0
8-bit graphics16
2
For example, for double speed, 8-bit graphics, the value of n2 would be calculated as follows:
To begin printing graphics, you must first send t he ETX command. This is followed by graphics
data—bytes representing the individual dot columns you will be printing. The graphics data is
followed by the ETX STX command which ends graphics printing. The listing below is a BASIC
program that generates a row of six triangles in quadruple de nsi t y.
10 WIDTH “LPT1:,”255 ‘Set printer for maximum line width
30 REM CHR$(113) and CHR$(80) are the attribute codes for normal speed,
quadruple density graphics
40 REM CHR$(3) Begins graphics printing
50 FOR I=1 TO 6 ‘Repeat triangle pattern six times
60 FOR J=1 TO 16 ‘Each triangle has 16 columns
70 READ A ‘Read the column
80 LPRINT CHR$(A); ‘Send the byte to the printer
90 NEXT J ‘Now print the next column
100 RESTORE ‘Go back to the beginning of the DATA statements
110 NEXT I ‘Now print the next triangle
120 LPRINT CHR$(3);CHR$(2); ‘End graphics printing
130 END
140 DATA 128,192,224,240,248,252,254,255,255,254,252,248,240,224,192,128
If you are printing more than one line of graphics, you will need to use line feeds. In the
Okidata MICROLINE Standard emulat i on, your pri nt er has a vari et y of special purpose line feed
commands for use in graphics printing:
FunctionSettingASCIIDecHex
Graphics line feed
with carriage return
Graphics line feed
with carriage return
Graphics line feed
without carriage return
Graphics line feed
without carriage return
Stores graphics data
in one dot column buffer
The graphics setting is determined by whether you are using 7 or 8-bit graphics. In 7-bit
graphics mode, the graphics setting is 14/144”; in 8-bit graphics mode, it is 16/144”.
The text setting is determined by the current text line spacing, as set by the ESC 6 and ESC 8
commands.
TextETX LF3 1003 0A
GraphicsETX SO3 1403 0E
TextETX DC23 1803 12
GraphicsETX DC43 2003 14
N/AETX ETX3 303 03
Chapter 6: Graphics Commands for 9-Pin Printers60
Chapter 7: Graphics Commands for 24-Pin Printers
Overview
Your printhead has one column of pins. Images are created as the pins “fire,” st ri ki ng t he
ribbon against the paper to produce dots. White spaces appear where the pins don't f i re. I n 8pin graphics, each column of dots is represented by a single byte of dat a. I n the Epson LQ
mode, Models ML390 Turbo, ML391 Turbo, ML590 and ML591 support 24-pin graphics, in
which each dot column is represented by three bytes of data.
When you program a graphic image, your program has to describe the pattern of dots you want
to print. Graphics data, like all other dat a sent t o t he print er, consi st s of a seri es of byt es. Each
of the eight bits in a byte of graphics data corresponds to one pin on the printhead. A bit's
value can be either 1 or 0. When the printer receives the data, it i nt erprets a bi t w i t h a value of
1 as a command to fire the corresponding pin. Bits that are set t o 0 don' t cause pi ns t o fi r e.
You can picture the byte as a column of 8 bits. In 8-pin graphics, t he body of dat a i s a seri es of
these columns lined up next to each other. Instead of sending the dat a to t he pri nt er bi t by bi t ,
you'll probably want to convert this binary information into decimal or hexadecimal format for
use with your programming language. In the figure below we show how t o determi ne t he
decimal value for a given pattern of pins. For 24-pin graphics, you must perf orm thi s process a
total of three times.
Chapter 7: Graphics Commands for 24-Pin Printers61
For optimum registration when printing graphics using bi-directional printing, use the Print
Registration item in the printer menu to fine-tune the alignment of the vertical bars which print
as part of the menu. Keep changing the setting until the lines of the vertical bar characters have
the straightest vertical column.
Programming Graphics in BASIC
One important thing to remember when you're programming graphics is not to include
extraneous line feeds in your programs. Using a semicolon after the data in an LPRINT
statement will keep the print position on the same line.
However, there is an additional complication: by default, BASIC assigns to all printers a
maximum line length of 80 characters. After the printer has received 80 bytes of dat a, i t w il l
automatically perform a carriage return and line feed. Since graphics dat a t ypi cal l y consi st s of
many bytes, it's quite easy to exceed this limit. The resulting output will be garbled. You can
work around this problem by setting the line length to the maximum allowable value, 255. Put
one of these statements at the beginning of your program:
For parallel printers:
WIDTH “LPT1:”,255
For serial printers that have been opened as #1:
WIDTH #1,255
Graphics Density Selection Commands (IBM/E)
⻬ ML390 Turbo, ML391 Turbo⻬ ML590, ML591
FunctionASCIIDecHex
Begin Single Density
Graphics
Double Density
Graphics Command
Double Speed/
Double Density
Graphics Command
Quadruple Density
Graphics Command
These graphics modes correspond to the 8-pin modes and are supported by most current
DOS-based graphics software.
Parameters Ln and H
n
These parameters tell the printer how many bytes of graphics data to expect. Eight-pin graphics
have one byte of data per column. To calculate the values for L
many columns of dots there will be in your graphics image. Divide this number by 256 and
assign the whole number result to H