Tally Genicom T5023+ User Manual

Page 1
Programming Guide
T5023/5023+
Page 2
"All rights, including rights of translation by printing, copying or similar methods, even of parts, are reserved.
All rights, includingrightscreatedbypatentgrants or registrationof a utility mod­el or design, are reserved. Delivery subject to availability; right of technical mod­ifications reserved."
TRADEMARKS
Page 3

Contents

Preface..................................................................................................... 1
Conventions.............................................................................................. 1
Abbreviations ............................................................................................2
Use of the manual..................................................................................... 2
Contents of the manual............................................................................. 3
Short description of the document printer........................................... 7
Document printing point ............................................................................ 7
Options...................................................................................................... 8
Magnetic stripe reader (MSR)............................................................. 8
MICR...................................................................................................8
Feeder.................................................................................................8
Memory extension............................................................................... 8
System interface ....................................................................................... 9
Physical interface................................................................................ 9
Logical protocol................................................................................... 9
Application areas .................................................................................... 11
Programming interface (General)....................................................... 13
Encryptions/Codes.................................................................................. 13
ASCII code........................................................................................ 14
Activating the document printer functions......................................... 16
Print effects............................................................................................. 17
Print quality....................................................................................... 17
Fonts................................................................................................. 18
Font size / character density............................................................. 19
Highlighting text ................................................................................ 21
Page layout....................................................................................... 23
Character tables...................................................................................... 25
National character sets..................................................................... 26
Characters defined by the user in character tables .......................... 26
Graphics............................................................................................ 27
Document printer specifications.............................................................. 28
Document printing............................................................................. 29
Magnetic stripe processing............................................................... 30
Special features of the document processing................................... 31
T5023/5023+ - Programming Guide
Page 4
Contents
Standard commands.............................................................................33
Notes about command description..........................................................33
Description components....................................................................33
Coding of decimal command parameters .........................................34
Controlling the configuration of the printer ..............................................41
Initializing the printer.........................................................................42
Selecting unidirectional printing for one line......................................44
Switching the unidirectional printing mode on/ off ............................44
Setting the MSB to 1 .........................................................................46
Setting the MSB to 0.........................................................................47
Deleting the MSB specification ........................................................48
Printer offline.....................................................................................49
Printer online.....................................................................................49
Automatic single sheet feeder on/off.................................................50
Special character codes..........................................................................51
Carriage return..................................................................................51
Backspace of one character..............................................................53
Deleting a character..........................................................................54
Cancelling a line................................................................................54
Line feed commands...............................................................................55
Line feed ...........................................................................................56
Carrying out an n/ 180 inch line feed ................................................57
Determining 1/8 inch line spacing.....................................................58
Determining 1/6 inch line spacing.....................................................59
Determining n/180 inch line spacing.................................................60
Determining n/60 inch line spacing...................................................61
Determining n/360 inch line spacing.................................................63
Sheet ejection commands.......................................................................64
Sheet ejection ...................................................................................65
Determining the document length at n lines......................................66
Determining the document length at n inches...................................67
Vertical print control.................................................................................68
Setting the bottom margin.................................................................69
Function: ...........................................................................................69
Deleting the bottom margin ..............................................................70
Determining / deleting vertical tabs (channel 0) ...............................71
Determining / deleting vertical tabs for any channel .......................72
Selecting a vertical tab channel .......................................................73
Vertical tabulation .............................................................................73
T5023/5023+ - Programming Guide
Page 5
Contents
Paper control .................................................................................... 74
Horizontal print control ........................................................................... 75
Setting the left margin ...................................................................... 77
Setting the right margin ................................................................... 80
Setting the text alignment ............................................................... 82
Setting / deleting horizontal tabs ...................................................... 84
Horizontal tabulation ........................................................................ 85
Horizontal positioning (absolute) ...................................................... 86
Horizontal positioning (relative) ....................................................... 88
Determining the character spacing .................................................. 90
Print quality and character size............................................................... 92
Switching print quality (Draft/ LQ) ................................................... 94
Selecting the LQ type font ................................................................ 96
Switching proportional spacing on/off ............................................. 97
Selecting the character size 10 cpi (Pica) ........................................ 98
Selecting the character size 12 cpi (Elite) ........................................ 99
Selecting the character size 15 cpi ................................................ 100
Print modes........................................................................................... 101
Switching on condensed print ........................................................ 102
Switching on condensed print ........................................................ 103
Switching off condensed print ....................................................... 104
Switching on elongated print for one line ...................................... 105
Switching on elongated print for one line ....................................... 106
Switching off elongated print .......................................................... 107
Switching elongated print on/off .................................................... 108
Enable/Disable Double Character Height....................................... 109
Switching on bold print ................................................................... 110
Switching off bold print ................................................................... 111
Switching on double impact print .................................................. 112
Switching off double impact print ................................................... 113
Switching underlining on/off ........................................................... 114
Switching on superscript/subscript ................................................ 115
Switching off superscript/subscript ................................................ 116
Selection of combined print mode ................................................. 117
Non- executable commands ............................................................... 120
Signal tone...................................................................................... 120
Switching half- rate printing on/off .................................................. 121
Selecting the print colour ............................................................... 121
T5023/5023+ - Programming Guide
Page 6
Contents
Character set commands .................................................................. 123
Character set selection .........................................................................124
Definition of characters..........................................................................133
Notes on the use of user defined characters.........................................145
Syntax of the character set commands................................................. 147
Switching on italic print ........................................................................147
Switching off italic print ................................................................... 148
Selecting the character set.............................................................. 149
Selecting a national character set...................................................150
Switching on/off the character set defined by the user ..................151
Switching on extended character set ............................................152
Switching off extended character set ............................................153
Copying the character set into the RAM .........................................154
Transferring the character definition ............................................... 155
Graphics commands........................................................................... 157
Graphics modes....................................................................................159
Mode of operation of the graphics commands......................................160
Syntax of the graphics commands........................................................ 163
Selecting the graphics mode .......................................................... 163
Switching on the ’single density’ graphics mode ...........................168
Switching on the ’double density’ graphics mode .........................169
Switching on the ’double density and double rate’ graphics mode .170
Switching on the ’quadruple density’ graphics mode......................171
Reassigning graphics commands ..................................................172
Additional commands (Printer).......................................................... 173
Structure of the additional commands...................................................174
General ...........................................................................................174
Transfer of user data.......................................................................176
Reaction to incorrect parameters....................................................176
Responses .....................................................................................176
Notes on the command description.................................................178
Important notes on document processing ............................................179
Character box .................................................................................180
Horizontal positioning......................................................................182
Vertical positioning.......................................................................... 185
Basic commands for document processing ..........................................189
Paper feed of the document............................................................ 190
Selection of type fonts/ character sets............................................ 191
T5023/5023+ - Programming Guide
Page 7
Contents
Absolute vertical positioning ........................................................... 194
Relative vertical positioning backwards.......................................... 196
Requesting the document width...................................................... 197
Document edge detection............................................................... 198
Activating passbook processing...................................................... 199
Specification of the horizontal leading edge ................................... 200
Mode switch- over for handling end of paper.................................. 202
Dual station control......................................................................... 205
Switching on/off Multi Part .............................................................. 206
Controlling the MSR / MICR functions .................................................. 207
Position and measurements for MSR magnetic stripes.................. 208
Parameter block MSR..................................................................... 210
Reading a MSR track...................................................................... 212
Writing a MSR track........................................................................ 215
Deleting a MSR track...................................................................... 217
The MICR Read Process................................................................ 218
Activate parameter command MICR............................................... 221
Reading command MICR................................................................ 222
Status and error messages................................................................... 223
Notes on the printer status.............................................................. 224
Setting control points/ initiating the control cycle ............................ 226
Setting control point II ..................................................................... 228
Global printer status........................................................................ 230
Special printer messages................................................................ 231
Printing unit parameters.................................................................. 233
Electronic Journal Functions................................................................. 235
Change between Document and Journal Printing .......................... 235
Application examples......................................................................... 237
Processing of a blank form ................................................................... 238
Type area........................................................................................ 239
Print effects..................................................................................... 241
Program steps (annotated)............................................................. 243
Program (pseudo code).................................................................. 250
Document processing ........................................................................... 254
Document structure ........................................................................ 255
Print positions ................................................................................. 256
Program steps (annotated)............................................................. 258
Program (pseudo code).................................................................. 262
T5023/5023+ - Programming Guide
Page 8
Contents
Passbook processing with MSR............................................................265
Passbook data ................................................................................266
Program steps (annotated) .............................................................267
Program (pseudo code) ..................................................................270
Loadable Firmware/Character Generators........................................273
Activating the Load Function.................................................................274
Load Functions: General.......................................................................275
Sequence of a Load Process..........................................................276
Module Identification.......................................................................277
ESCAPE Sequences (Bootstrap Loader)..............................................279
Switch-over to the Load Function....................................................279
Exiting the Load Function................................................................280
Request Module ID/Data ID ............................................................281
Loading character generators ............................................................... 284
Indicate "Ready to load character generator" .................................284
Loading the Character Generator ................................................... 285
Loading the Firmware............................................................................ 286
Indicate ’Ready to load’...................................................................286
Loading the Firmware .....................................................................286
Length of the Transfer...........................................................................287
Reading E-Journal Data..................................................................289
Control of Asian Character Sets........................................................ 291
Pre-setting of the Character Set ESC [ n $ q..............................294
Specific Operating System Dependencies ....................................... 295
Windows NT Drivers..............................................................................295
Appendix..............................................................................................297
Command table.....................................................................................297
Command table for Epson ANSI emulation ....................................297
Definition of barcode printing for T5023..........................................302
Loader commands ..........................................................................304
E-Journal commands......................................................................304
Character Sets ......................................................................................305
Code Page 437...............................................................................307
ISO 8859-2 Latin No. 2 ...................................................................308
ISO 8859-5 Cyrillic..........................................................................309
ISO 8859-7 Greek...........................................................................310
ISO 8859-8 Hebrew ........................................................................311
T5023/5023+ - Programming Guide
Page 9
Contents
ISO 8859-9 Latin No. 5................................................................... 312
ISO 8859-15.................................................................................... 313
OCR-A ............................................................................................ 314
OCR-B ............................................................................................ 315
Code Page ISO 2............................................................................ 316
Code Page 775 Latin / Baltic .......................................................... 317
Code Page 850 Latin 1 ................................................................... 318
Code Page 852 Latin 2 ................................................................... 319
Code Page 855............................................................................... 320
Code Page 857 Latin 5 ................................................................... 321
PC Code Page 858......................................................................... 322
Code Page 860 (Portugal).............................................................. 323
Code Page 866 Latin/Cyrillic........................................................... 324
Code Page 869 Latin/Greek ........................................................... 325
Thailand Character Set (customer specific).................................... 326
1250 Windows Latin 2..................................................................... 327
1251 Windows Cyrillic..................................................................... 328
1252 Windows Latin 1..................................................................... 329
1253 Windows Greek...................................................................... 330
1254 Windows Latin 5..................................................................... 331
1255 Windows Hebrew................................................................... 332
1256 Windows Arabic..................................................................... 333
1257 Windows Baltic Rim ............................................................... 334
Chinese Characters in the Passbook/Document Printer....................... 335
Printer: One-byte mode................................................................... 335
Printer: Two-byte mode................................................................... 336
GB 2312-80 / GB 5007 / GB 5199.................................................. 342
Font number.................................................................................... 342
Available Character Generators for the document printer .............. 343
IBM Emulations..................................................................................... 345
IBM 4722 Emulation........................................................................ 345
IBM Proprinter XL24 Emulation ...................................................... 348
Range of Commands for the ProprinterXL24 and 4722.................. 349
Olivetti PR50 Emulation ........................................................................ 353
General........................................................................................... 353
Emulation........................................................................................ 353
Initialization parameter.................................................................... 353
Range of Commands for the OLIVETTI PR50................................ 353
Character Sets for the Olivetti Emulation........................................ 355
T5023/5023+ - Programming Guide
Page 10
Contents
Paper Specifications..............................................................................356
Reference Lines..............................................................................356
Error messages.....................................................................................359
Status messages.............................................................................359
Status messages (Bootstrap loader activated) ..............................360
Malfunctions ...................................................................................361
Description of the physical interface......................................................367
General ...........................................................................................367
Handshaking protocols....................................................................367
Interface data serial interface..........................................................369
Interface data external Centronics interface ................................... 375
Glossary...............................................................................................385
Index.....................................................................................................387
T5023/5023+ - Programming Guide
Page 11

Preface

i
This programming manual describes in the main the instruction set of the multi­functional flat bed printer. The document printer is a workstation printer with one printingpoint and is used to process documents and passbooks. The printercan be fitted with a magnetic stripe reader (MSR) as an option.
This manual is intended for all users, who wish to create their own programs, for example, for document or passbook processing . Detailed technical data, ope­rating information (for example, connecting the printer, insertingthe paper, etc.), and maintenance instructions are in a separate operating instruction.
Fault elimination information is in the appendix of this manual.

Conventions

Following conventions are made in this manual:
Courier System outputs, such as error messages, informati-
on, notes, file extracts Courier Bold Example of user inputs – Indicates a list.
l
„“
J
Indicates a specific sequence must be followed.
Refers to other chapters or sections.
Marks functions which have to be preferred. All
functions without this sign are only mentioned for
compatibility reasons, they should only be used by
exception.
General informations, notes and tips.
Warning notes, which have absolutely to be followed.
T5023/5023+ - Programming Guide 1
Page 12
Abbreviations Preface

Abbreviations

APA graphics All Points Addressable graphics APR Automatic Passbook Reader CS Character Set DQ Draft Qualitiy IF Interface LQ Letter Quality MSR Magnetic Stripe Reader MICR Magnetic Ink Character Recognition CSI Control Sequence Introducer LSB Least Significant Bit MSB Most Significant Bit OCR Optical Character Recognition printer fonts

Use of the manual

This manual describes printer programming for various document processing applications.
All program examples in this manual are independent of programming langua­ges (pseudo code). Particulars for the conversion of pseudo code instructions into a programming language (special BASIC dialects, COBOL, C, etc.) will not be dealt with here. Likewise, particulars of the communication protocol between the document printer and the
2
connected computer are not taken into account.
T5023/5023+ - Programming Guide
Page 13
Preface Contents of the manual

Contents of the manual

Chapter “Short description of the document printer“
This chapter briefly lists the hardware components of the document printer and outlines the application areas of the printer.
Chapter “Programming interface (General)”
This chapter outlines the basic principle of logical communication between an applicationand the printer via ESC sequences. The functions of the multifunctio­nal document printer are described using examples.
Chapter “Standard commands”
All the Epson- compatible control commands of the document printer are descri­bed here. Exceptions are the character set and graphics commands, which will be explained in subsequent chapters.
In particular, the commands for the following application areas are described: – Controlling the configuration of the printer
Setting the page and line constants – Vertical and horizontal tabulation – Setting the print quality and the character size
Highlightingparts of the text by settinga suitableprint mode(e. g. bold print, un-
derlining, superscript, subscript, etc.).
Chapter “Character set commands”
The emphasisof this chapter is on the setting of characters defined by the user with the description of the relevant commands. In addition, the commands for switching overbetween character setsare described (forexample, standard character set, gra­phics character set, national character sets)
.
Chapter “Graphics commands”
This chapter describes commands used to print drawings, diagrams or pictures as dot graphics. The basic principle is to encrypt the individual picture dots as a series of numbers and to transfer them to the printer.
T5023/5023+ - Programming Guide 3
Page 14
Contents of the manual Preface
Chapter “Additional commands”
This chapter explains special control commands for document processing or for processing ZeKoSa data. An important application area for the commands des­cribed here is the processing of passbooks. This also contains important infor­mation on processing documents using horizontal and vertical print positioning.
Chapter “Application examples”
A small program example of command functions normally belongs to the com­mand descriptions in the chapters “Standard commands”, “Character set com­mands”, etc.
The chapter “Application examples” uses more complex operations to explain the use of specific commands in connection with:
Text processing with the document printer – Passbook processing with MSR.
Individual program steps are annotated in detail and the program structure is presented in the form of a pseudo code.
Chapter “Loadable Firmware/Character Generators”
Firmware and character generators of the document printer are stored in a pro­grammable memory with FLASH technology. The chapter "Loadable Firmware/ Character Generators" describes the sequence of load processes and the bootstrap loader ESC sequences.
Chapter “Controlling Asian Character Sets”
Asiancharacter setsmust bemade availablefor thespecified printersto prepare the document printer for its usage in the Asian area. This chapter provides a de­scription of the control of the Asian character sets.
Chapter “Specific Operating System Dependencies”
This chapter describes specific operating system dependecies.
Chapter “Glossary“
Special terms are explained in this chapter.
4
T5023/5023+ - Programming Guide
Page 15
Preface Contents of the manual
Appendix
The appendix of this product manual contains the following information:
List of all document printer commands – Character set tables – Printable document and paper versions/ paper specification – Table of error messages
Description of the physical interface
Chapter “Index“
Facilitates searching for selected terms.
T5023/5023+ - Programming Guide 5
Page 16
Contents of the manual Preface
6
T5023/5023+ - Programming Guide
Page 17

Short description of the document printer

The document printer has a document printing point with which single documents, multiple documents (sets of forms) and passbookscan be processed. The printer canalso be equippedwitha magneticstripereader (MSR), a magnetic ink card rea-
der (MICR) or a single sheet feeder as an option.

Document printing point

The term ’document’ includes all single documents, for example, cheques, un­printed DIN A4 papers (blank documents), forms of various sizes or passbooks.
All documents are fed by the document printer over a flat bed according to the principle of single- sheet processing, are processed and ejected again. The pro­cessing of a document is begun when each single document is put forward.
The form feed of the documents can be freely selected. The feeding of the docu­ments is supported by an automatic alignment. The print characters can be positio­ned relative to all the document edges.
The following provides a comprehensive list of the characteristics of the docu­ment printing point:
90 printing points with 10 characters/ inch – Automatic document alignment – Automatic print head adjustment – Automatic document edge detection – Print head with 24 needles – 2 print modes (LQ, Draft) – ’24- bit’ and ’8- bit’ graphics – The print rate is dependent on the horizontal density of the character font
selected in each case. There are two different print rates for the print modes LQ (Letter Quality) and Draft. The document printer can also process type fonts, print qualities or multi- phase characters, which vary from the pixel data structure of the standard character sets. More than two print rates are possible due to the respective character font.
T5023/5023+ - Programming Guide 7
Page 18
Options Short description of the document printer

Options

Magnetic stripe reader (MSR)

As an option, the document printer can be delivered with a magnetic stripe rea­der (MSR device) for passbooks. This enables reading and updating from the magnetic stripe on passbooks depending on certain recording modes (DIN / IBM). It is possible to changebetween various recording modes via the program.

MICR

Magnetic ink character reader for the fonts CMC7 and E13B.

Feeder

Single sheet feeder for 500 sheets A4.

Memory extension

The memory extension is necessary e.g. for journal data or asiatic fonts.
8
T5023/5023+ - Programming Guide
Page 19
Short description of the document printer System interface

System interface

Data, which activates the functions of the printer is transferred through the sy­stem interface. The interfaces has the following characteristics:
the physical c onnection – the logic protocol (command sequences)
The characteristics are selected via the operating panel.

Physical interface

Two interfaces are available: – internal interface (RS232) – optional (external) interface (Centronics, LAN, etc. in combinationwith a cor-
respondent additonal logic).

Logical protocol

Several protocols (emulations) areavailable. Dependent on the loadedfirmware configuration the following selection is possible:
Firmware configuration ’5023_STD’
l
Epson ANSI
l
IBM 4722
l
Proprinter XL24
Firmware configuration ’5023_OLI’
l
Epson ANSI
l
Olivetti
l
Proprinter XL24
T5023/5023+ - Programming Guide 9
Page 20
System interface Short description of the document printer
Epson ANSI
The manual describes detailed this emulation. As all functions of the printer are supported optimal, this emulation should be used for the relisation of new appli­cations. Also this emulation can be used for the removal of the following printers:
EPSON ESC P –ND90 – HPR 4904 – HPR 4905
IBM 4722, Proprinter XL 24, Olivetti
This emulations copy printers of other producers (partially with restrictions). In this manual only the command table, specialities, parameter settings and possi­ble incompabilities are described.
10
T5023/5023+ - Programming Guide
Page 21
Short description of the document printer Application areas

Application areas

The processing of single/multiple documents and passbooks allows the use of the document printer in the following areas:
Industry and commerce:
Delivery notes – Freight and customs papers – Invoices – Envelopes
Public authorities:
Application forms – Filing cards –Taxcards – Motor vehicle papers – Driving licences
Banks, Insurances and Services:
Passbooks – Cheques – Transfers – Medical certificates – Application forms
Magnetic stripe writing and reading equipment is available for use in banks as an
.
option
T5023/5023+ - Programming Guide 11
Page 22
Application areas Short description of the document printer
12
T5023/5023+ - Programming Guide
Page 23

Programming interface (General)

This chapter contains general information on how the functions of the document printer can be activated by a user program, i. e., how the document printer can beprogrammed. This chapter also explainsthe functionswhich can be activated by means of the program in a short, comprehensive summary.

Encryptions/Codes

The print functions of the document printer are initiated from aprogram in which uniquenumeric encryptions (codes)representing charactersand commandsare transmitted from the computer to the printer. The individual codes stand for prin­table characters (letters, numbers, punctuation marks, mathematical symbols) or control codes, which cause certain actions (for example, document ejection, deletion of characters, carriage return).
T5023/5023+ - Programming Guide 13
Page 24
Encryptions/Codes Programming interface (General)

ASCII code

A code table specifies how the printable characters and control commands, for example, for document ejection and carriage return are encrypted binarily in the computer or printer. The encryption is expressed by a corresponding hexadeci­mal or decimal number. A certain character then lies in hexadecimalnotation or in the decimal representation, for example, in the range hex 00 to hex FF or de­cimal 0 to decimal 255 (8- bit encryption).
Examples:
Character Meaning Decimal Hex
A a 4 LF ESC
With the document printer and with most computers the basis for the encryptions is the code system ASCII ( A merican S tandard C ode for I nformation I nterchange), which only differs in certain characters for special foreign languages (national ASCII table). The ASCII code is encrypted via 7 bits, whereby 128 different meanings are possible
.
Letter big A Letter small a Number 4 Line Feed Escape
65 97 52 10 27
41 61 34 0A 1B
Escape sequences / CSI sequences
As the ASCII table provides fewer control codes than print functions, the commands for the printer normally consist of a sequenceof two or more ASCII characters. Such a code sequence is always preceded by the encryption of the control code ESC (Es­cape) (ASCII code 27 (decimal) or 1B (hexadecimal). This signals to the printer that the encryptions following ESC are to be interpreted as commands for
the printer. There are two kinds of code sequences for the document printer: – ESC ...
Code sequences, which begin with ESC or the appropriate encryption, are called ESC sequences.
CSI ... = ESC [ ...
Code sequences introduced with CSI (Control Sequence Introducer) are called CSI sequences. CSI sequences are introduced with encryptions of the character sequence “ESC [” and concluded with the encryption of two
14
T5023/5023+ - Programming Guide
Page 25
Programming interface (General) Encryptions/Codes
characters depending on the command I (= Intermediate Character) and F (= Final Character). The CSI sequences are used to control special docu­ment printer functions for document and MSR processing (see “document printer specifications” in this chapter and the chapter “Additional com­mands”).
Examples (ESC sequences):
ESC
Meaning ASCII encryption
sequence
ESC 4 ESC 5 ESC 0 ESC C 60
Examples (CSI sequences, here without encryptions):
Italic print on Italic print off Deleting bottom margin
Setting the document length to 60 lines
CSI Parameter I F Meaning
ESC [
%
Deleting of MSR track
r
(no parameters)
ESC [ n
$
Activating passbook processing
t
decimal hexadecimal decimal hexadecimal decimal hexadecimal decimal hexadecimal
:2752 :1B34 :2753 :1B35 :2779 :1B4F :276760 :1B433C
T5023/5023+ - Programming Guide 15
Page 26
Encryptions/Codes Programming interface (General)
i

Activating the document printer functions

Thecontrolcodes or ESC or CSI sequences must beaddressedtothe printer directly and uniquely via corresponding program commands. Depending on the respective programming language, this is, e. g., via PRINT or WRITE instructions.
Example: Three lines are to be printed. Lines 1 and 3 are printed in normal print, line 2 in
italic print.
Pseudo code:
BEGIN
PRINTLF(" first line") PRINT(ESC 4) PRINTLF(" second line") PRINT(ESC 5) PRINTLF(" third line")
END
Conversion into BASIC
10 LPRINT "first line" 20 LPRINT CHR$(27);" 4"; 30 LPRINT "second line" 40 LPRINT CHR$(27);" 5"; 50 LPRINT "third line"
Result:
In this manual the program examples are depicted exclusively in the form of a pseudo code and the control codes or code series are given in decimal ASCII encryption or directly as characters. The correspon­ding information must then be converted into the appropriate pro­gramming language.
16
:
T5023/5023+ - Programming Guide
Page 27
Programming interface (General) Print effects

Print effects

The design of a print product is dependent on the print quality, type font, type size or character width and highlighting text, e. g., by underlining or bold print.

Print quality

Theprint quality is characterized bythe density of the print characters and bythe print rate. The document printer provides two print qualities:
LQ mode (Letter Quality)
The LQ mode has the higher print quality and lower print rate.
DQ mode (Draft Quality)
The DQ mode has a lower print quality, but a higher print rate.
Example:
The print quality can be selected by means of the corresponding ESC se­quences via a program or the menu.
T5023/5023+ - Programming Guide 17
Page 28
Print effects Programming interface (General)

Fonts

In addition to the DQ font for drafts, the default fonts Roman, Sans Serif, OCR A (OCR A1 Eurobanking) and OCR B (OCR B1 Eurobanking), as well as the cha­racter set ISO 8859 with the following versions are available for Letter Quality (LQ mode):
East Europe – Cyrillic –Greece –Hebrew –Turkey
The DQ, Roman and Sans Serif fonts are selected via corresponding ESC se­quences in the program.
The OCR- A, OCR- B and ISO 8859 fonts, as well as all special, non- Epson­compatible fonts, can only be selected via CSI sequences. The character fonts thus selected are treated like normal LQ type fonts, this means that all standard commands (print quality, character size, print type) are also effective for these fonts.
Example (fonts in Letter Quality):
18
T5023/5023+ - Programming Guide
Page 29
Programming interface (General) Print effects

Font size / character density

The width of a printed character is expressed in ’characters per inch’ (cpi) and is often called ’character density’, for example
10 characters per inch = 10 cpi
The document printer can print in the character widths 10, 12 and 15 pitch. Each individual character is then the same width.
Example:
The font size can also be influenced by proportional type, as well as by elonga­ted or condensed print.
Proportional type
With proportional type each character takes up a different amount of space ac­cordingto its size(for example, ’I’takes up lessspace than ’B’or ’t’ lessthan ’g’). Texts in proportional type are normally shorter than in normal print.
Example:
Elongated print
With elongated print, each character is represented in double width. It is possi­ble, for example, to highlight page headings in a text.
Example:
T5023/5023+ - Programming Guide 19
Page 30
Print effects Programming interface (General)
Condensed print
If printing takes place in 10 or 12 pitch in condensed print, each character can be reduced to 60% of its width in normal print.
Example:
20
T5023/5023+ - Programming Guide
Page 31
Programming interface (General) Print effects

Highlighting text

The following print functions of the document printer can be influenced by corre­sponding ESC sequences:
Double impact print/ bold print – Underlining – Superscript/ subscript – Double Superscript
Double impact print / bold print
With double impact print (= vertical bold print) theprint head goes over each line twice. The paper is transported 1/180 inch after the first print and the same cha­racters are printed again v ertically and slightly displaced.
Withbold print (also called horizontalbold print)each dotof a character is printed twice,whereby the second dotis displacedslightly to the right of the first dot prin­ted.
Indouble impactprint, the space between the dotsis filledup, in (horizontal)bold print, the lines ofa character areintensified. Bold and double impact print can be combined so that particularly bold characters result.
Example:
Underlining
Certain parts of a text can be highlighted by switching the underlining mode on and off.
Example:
T5023/5023+ - Programming Guide 21
Page 32
Print effects Programming interface (General)
Superscript / subscript
Footnotes,equation or special text designs are possibleby switchingsuperscript and subscript on and off.
Example::
22
T5023/5023+ - Programming Guide
Page 33
Programming interface (General) Print effects

Page layout

By means of appropriate ESC sequences thepage design can be influenced or the text output controlled on the basisof pre- printed forms. This includes, for ex­ample:
Setting and deleting horizontal and vertical tabs – Setting the width of a printed page – Setting the line spacing – Presenting a text flush left, flush right, centered or with margin justification.
Example (setting page constants):
T5023/5023+ - Programming Guide 23
Page 34
Print effects Programming interface (General)
Example (Text adjustment):
Example (line spacing)
24
:
T5023/5023+ - Programming Guide
Page 35
Programming interface (General) Character tables
i

Character tables

Two areas are differentiated with the printable characters in a code table: – Area with the basic character set of each type font (Draft standard type, Ro-
man, Sans Serif). This area is also called the ’basic c haracter table’. The characters of the basic character table are encryptedin ASCII by the co­des hex 20 to hex 7F (decimal 32 to 127).
Area with italic characters, special characters, graphics characters or cha-
racters defined by the user. This area is also called the ’upper character ta­ble’. The characters in the upper character table are encrypted in ASCII with the codes hex 80 to hex FF (decimal 128 to 255).
The italic character set contains a basic character table (hex 20 to hex 7F) and an italic character table (hex A0 to hex FF). The area hex 80 to hex 9F is not utilized. In the graphics character set the upper character table contains special graphics characters in the area hex A0 to hex FF. In the extended graphics set the upper c haracter table additionally contains characters in the area hex 80 to hex 9F.
It is possible to switch over the various character sets at any time via a program by means of appropriate ESC or CSI sequences.
The program can be switched to different fontpages by ESC se­quences. You can find the available codepages in the appendix.
T5023/5023+ - Programming Guide 25
Page 36
Character tables Programming interface (General)

National character sets

Byselecting a national character set, characters used in other languages are ad­ditionally available to the user. The selection of national character sets results via an ESC sequence or via the operating panel of the printer. These characters replace in each case the corresponding encrypted characters in the basic cha­racter table.
Examples:
Code Basic
character
5B 60 7C
Ä , :
Italy Japan Norway
. ù ò
[ ` |
Æ é o

Characters defined by the user in character tables

Symbols stored in character tables are printed on the basis of the respective character code and the assigned dot pattern.
Example:
By means of certain ESC sequences any dot patterns can be defined anew and assigned to a code of the basic charac ter table. For example, a new alphabet, symbols specific to a subject or individual graphics characters can thus be pro­duced and printed instead of the standard character in each case.
The definition of such characters specific to the user will be dealt with in a sepa­rate section. In principle the production of a new character or symbol is the pro­duction of a graphics pattern, for which the printer needs exact details as to
26
T5023/5023+ - Programming Guide
Page 37
Programming interface (General) Character tables
where each dot is to be printed.
Characters defined by the user are copied by means of ESC sequences into the me­mory of the document printer. It is possible to switch over at will between the normal character set and that defined by the user.

Graphics

Viathe document printersimple pictures and/ or diagrams can first be presented on the basis of standard or graphics characters or symbols defined by the user on the one hand and the formatting possibilities (for example, line spacing, tabs, highlighting)on the other hand. The structure of such semi- graphics can be con­trolled by programs with corresponding ESC sequences. The production of se­mi- graphics on the basis of character sets is, in principle, the connecting of individual characters over several lines.
Example:
By switching over to a graphics mode special graphics commands become available through which drawings, diagrams or pictures can be printed as dot graphics. Each picture dot is encrypted as a number sequence and transferred to the printer. The appearance of dot graphics can be influenced by setting the dot density, whereby a maximum density of 180 x 360 dots per inch is possible. The document printer works in various graphics modes. A graphics mode is identified by the number of needles addressed during printing (8 or 24) and the horizontal dot spacing (60 to 360 dots per inch).
The production of dot graphics is in principle the connecting of dot data over se­veral lines. The line spacing can be set in such a way that no spaces arise bet­ween the lines in a picture.
T5023/5023+ - Programming Guide 27
Page 38
Document printer specifications Programming interface (General)

Document printer specifications

Business procedures or transactions in a financial institution involve a series of manual and program activities, e. g., the insertion and removal of documents and passbooks or theentry of depositsand withdrawals, bank code and account number. These processes are supported by special banking periphery and the appropriate programs. The printer processing includes, for example, voucher prints on documents and passbooks.
Standardly or optionally the document printer has features with which – documents or passbooks can be processed – magnetic stripes can be read and written on.
Additional special commands are available for programming: – positioning commands – control signals – control of the MSR functions – special functions.
The analysis of the document printer responses, which provide information about the present status of the printer or contain data on the program, is also re­levant here:
status of the printer after the appearance of exceptional conditions like errors,
operating interruptions or operating panel entries (status signals of the printer, which can appropriately be acted upon in the program)
receiving requested data.
28
T5023/5023+ - Programming Guide
Page 39
Programming interface (General) Document printer specifications

Document printing

For documents (DIN A4 sheets, standard forms) or passbooks the logical struc­ture of a document must be considered.
Example (passbook constants):
Page heading area
1
(is not printed during a passbook transaction)
2 Area with lines for logging deposits and withdrawals 3 Last printable line 4 Footer area
(is not printed during a passbook transaction).
T5023/5023+ - Programming Guide 29
Page 40
Document printer specifications Programming interface (General)

Magnetic stripe processing

The device called MSR is used for processing magnetic stripes on passbooks. The MSR equipment allows an automatic reading and updating of data in en­crypted form.
In what form the appropriate data is encrypted on a MSR magnetic stripe de­pends on the respective recording mode (DIN/IBM).
Example (magnetic stripe on the back of a passbook):
1 Inside of passbook 2 Back of passbook 3 Mangetic stripe
Here the magnetic stripe could contain the following information:
Next or last line to be printed in the passbook – Account number of the customer – Balance (credit) of the customer.
Via the reading of the magnetic stripe, the entry of this data becomes unneces­sary. The values for the line number and the balance are updated on the magne­tic stripe before the printing of the passbook line.
30
T5023/5023+ - Programming Guide
Page 41
Programming interface (General) Document printer specifications

Special features of the document processing

When processing documents, in contrast to the normal processing of single sheets or continuous forms, the varying sizes of the documents and the docu­ment feeding mode must be considered.
Insertion and ejection of documents
In principle there are two possibilities for controlling the insertion and ejection of documents.
One possibility is that the printer initiates an insertion automatically at a holding position (set if necessary by appropriate commands), when adocument is fed in by the user. When the first print or positioning command for this document is re­cognized, it will be drawn in and transported to the correct processing position. If the document printer receives print instructions and no document is available, the user will be requested to insert a document by a flashing LED indicator and the LCD display on the operating panel.
The ejection of a document can be initiated by a form feed command. Using a special CSI command, documents can also be drawn in explicitly to the
base of the first print line and processed; or documents only fed in can be ejec­ted. Thus insertion and ejection procedures can be secured by means of sepa­rate control cycles in the program.
T5023/5023+ - Programming Guide 31
Page 42
Document printer specifications Programming interface (General)
32
T5023/5023+ - Programming Guide
Page 43

Standard commands

This chapter describes all Epson- compatible commands (ESC s equences). Commands for changing character sets (see “Character set commands”) and commands with which graphics can be created (see “Graphics commands”) are not included here. Special commands (CSI sequences) for document proces­sing or for processing MSR data are described in the chapter “Additional com­mands”.

Notes about command description

The following first explains how the respective ESC sequence for a command is described and of which components this description consists. An explanation re­garding the interpretation of the pseudo code instructions in the program ex­amples then follows. A note is then given on how the commands normally behave when incorrect command parameters are transmitted.
All notes given in this section also apply for the “Character set commands“ chap­terand “Graphicscommands” chapterand withvariations also for the “Additional commands“ chapter.

Description components

The description of the standard commands is divided into the following compon-
ents:
Command name with ASCII coding in hexadecimal and decimal encryption – Description of func tion and usage – Additional notes on requirements, options and connections with other com-
mands
Normally each command description is concluded with a short example
through which the usage and effect of the command is demonstrated.
T5023/5023+ - Programming Guide 33
Page 44
Notes about command description Standard commands
Example of a formal command description (command syntax):
ESC
27
1B
Q
Command name/ESC sequence
R
Decimal encryption according to ASCII table
Hexadecimal encryption according to ASCII table
A 65 41
(n)
n n
ASCII character Decimal Hexadecimal
Q R

Coding of decimal command parameters

All command parameters n or n1, n2, etc. in the ESC sequences of the Epson­compatible commands must be transferred to the document printer in binary co­ded form and not as ASCII characters. Several parameters are simply transfer­red consecutively without separation characters (e. g. space or comma). The binary coding of a paramater must be implemented in the user programm by me­ans of a corresponding ASCII coding in hexadecimal or decimal encryption. In the command syntax parameter values to be coded binarily are bracketedin the first line (for example, (n) or (n1), (n2) (n3)...). In the subsequent lines with the hexadecimalor decimal encryption of the command, the parameter descriptions n, n1, etc. are repeated without brackets as variables for concrete values. Which values a parameter can have are specified in the subsequent function descripti­on.
34
T5023/5023+ - Programming Guide
Page 45
Standard commands Notes about command description
i
Example:
Determining the document length at n inches
Q
ESC
27
1B
Function: ESC C NUL( n) sets the document length at n inches (absolute document
lengthindependent ofthe line spacing). The valuen must be between1 (inch) and 22 (inches).
Parameter value of n must be encrypted binarily
Q R
Note on which values the parameter n can have
In contrast to the ESC sequences of the standard, character set and graphics commands for the document printer- specific additional com­mands (CSI sequences), the command parameters n, n1, etc. are co­ded as ASCII values. For example, three bytes are transferred for a three- figure parameter value n = 123 (see “Additional commands” chapter).
A 65 41
(n)
n n
ASCII character Decimal Hexadecimal
R
Program examples
All instructions in the program examples to demonstrate the standard control commands are represented independently of a certain programming language. This is done by formulating the program lines in a colloquial pseudo code. In practice,this pseudo code,depending onthe programming languageused, must be converted into the appropriate program instructions.
T5023/5023+ - Programming Guide 35
Page 46
Notes about command description Standard commands
Example:
BEGIN
PRINTLF("Print page with bottom margin") CALL LINE PRINT PRINT(char(27),"O") PRINTLF("Print page without bottom margin") CALL LINE PRINT
END
BEGIN LINE PRINT
SETN=0
REPEAT
SETN=N+1 PRINTLF("Line", N,"after title") UNTIL N = 6
END LINE PRINT
Explanation of the pseudo code instructions:
Function Coding
1
Instructionblock
2
Loop
3
Alternative
4
Initializing
5
Changing variable value
6
Subprogram call
7
Printing without line feed
7
Printing with line feed
7
Control characters
8
Evaluation of printer response
BEGIN/END REPEAT/UNTIL
abort criterion
IF...THEN...ELSE ... SET variable = value SET variable = variable +/- value CALL subprogram name PRINT (arguments) PRINTLF (arguments) char(x) or char(a,...,n) GET (arguments)
(read data)
(Further explanations on 1, 2, ... , 8 see next pages)
36
T5023/5023+ - Programming Guide
Page 47
Standard commands Notes about command description
1 When defining subprograms, after BEGIN and END the subprogram
name is specified (for example, BEGIN LINE PRINT ... END LINE PRINT).
The instruction within REPEAT ... UNTIL (loop body) are executed until the
2
abort criterion specified after UNTIL is fulfilled (for example, REPEAT ... UNTIL N = 6). This pseudo code instruction is defined here in such a way that the loop body is not executed if the abort criterion is already fulfilled before the first loop run.
3 (for example, IF N = 50 THEN BEGIN ... END or IF n = 50 THEN CALL
NEWPAGEELSEN=N+1)
4
(for example, SET N=0) (for example, SET N=N+1)
5
(for example, CALL LINE PRINT)
6 7 The data transmission from the program to the document printer is to
be symbolized by means of the procedures PRINT and PRINTLF. Depending on the arguments, these are control commands (character(...)) or alphanumeric or numeric user data.
No carriage return (CR) is executed via the procedure PRINT. A line feed (LF) and also a carriage return (CR) are defined via the procedure PRINTLF. Depending on whether the printer parameter ’AUTO- CR + LF’ (= CR- HANDLING in the document printer menu) i s activated or not, the real conversion of the PRINTLF procedure must be programmed
accordingly.
T5023/5023+ - Programming Guide 37
Page 48
Notes about command description Standard commands
The following values occur as arguments of PRINT and PRINTLF:
Argument Meaning
"x"
Code of a printable character x from the sequence ESC
... x ...
character (x)
character (a, b,..., n) "text" A, B, C,..., N
or counter,page,
pass, etc.
x:=
decimal encryption of an ASCII value or x := value of a parameter n, m, etc., which is to be coded binarily char( a), char( b), ..., char( n) string of text/character chain
numeric or alphanumeric variables in the form of capital letters or speaking names such as “counter”, “page”, etc.
On ’x’: For example, C as printable character can be specified directly by means of ’C’
in the sequence ESC C NUL (n) or by means of char (67), whereby 67 is the decimal ASCII encryption of C.
Examples on char( x): – char( 27) with 27 = decimal encryption of ESC – char(4)with4=valueofn
for example, from the sequence ESC C NUL (n)
The procedure GET (arguments) should symbolize the data transmis-
8
sion from the document printer to the program. This procedure is only relevant for the description of certain CSI sequences in the “Additional commands” chapter, with which responses from the printer can be eva­luated.
Examples:
The command for line feed is LF and is encrypteddecimally according to the ASCII coding by ’10’. Equivalent to this are the pseudocode instructions:
PRINT("This is a line", char(10)) PRINTLF("This is a line")
38
T5023/5023+ - Programming Guide
Page 49
Standard commands Notes about command description
Setting the document length (for example, 6 inches = ESC C NULL 6):
PRINT( char(27,67,0,6)) or PRINT( char(27),"C", char(0), char(6))
Initializing the printer after printing with line feed:
PRINT("text", char(10), char(27),"@") or PRINT("text") PRINT(char( 10)) PRINT(char( 27),"@") or PRINTLF("text") PRINT(char(27),"@")
Printing variable values:
SET counter = 0 REPEAT
SET counter = counter + 1 PRINTLF("This is the line",counter)
UNTIL counter = 10
Enlarging the line spacing successively (n/ 180 inch by means of ESC 3 (n)):
SETN=0 REPEAT
SETN=N+1 PRINT(char(27),"3",char(N))
(" Line spacing", N,"/180 inch")
PRINT
UNTIL N = 20
Printing a blank
line:
PRINTLF()
T5023/5023+ - Programming Guide 39
Page 50
Notes about command description Standard commands
i
Reaction to incorrect parameters or incorrect syntax
Normally incorrect parameters n, n1, etc. are automatically replaced by the re­spective default value (for example, if the specified value range is exceeded). Commands with parameters which are within the specified value range, but inf­ringe on the set conditions, are ignored (for example, if horizontal absolute posi­tioning is attempted outside the possible print area).
Exceptions to these rules are specified separately with the corresponding com­mand description, if necessary.
An exact description of the printable areas and the definition of horizon­taland vertical positionsis containedin the section“Notes fordocument processing” in the chapter “Additional commands”.
40
T5023/5023+ - Programming Guide
Page 51
Standard commands Controlling the configuration of the printer
i

Controlling the configuration of the printer

The status of the printer can be controlled from a program irrespective of the data to be printed via the following control commands:
Command Function
ESC @ Initializing the printer ESC < Selecting unidirectional printing for one line ESC U (n) Unidirectional printing mode on/ off one line ESC > Setting the 8th bit of incoming data (MSB = 1) ESC = Deleting the 8th bit of incoming data (MSB = 0) ESC # Terminating control of the 8th bit (= delete MSB
specification) DC3 Switching printer off logically (Offline) DC1 Switching printer on logically (Online) ESC EM (n) Setting the automatic single sheet feeder mode on/off
Onsome computers the MSB value (Most SignificantBit)is always constant
1. In practice that would mean that in the character table only characters from the range of 80h to FFh could be addressed and then only italic or gra­phics characters or characters defined by the user could be printed.
J
J
The 8th bit can be deleted using the command ESC = . Therefore, cha­racters from the basic character table (range from 20h to 7Fh) can also be printed.
On the other hand, for computers which can only transfer 7- bit data (MSB value always constant 0), the 8th bit can be set to 1 by ESC >. Then it is also possible to address italic or graphics characters, or cha­racters defined by the user.
T5023/5023+ - Programming Guide 41
Page 52
Controlling the configuration of the printer Standard commands

Initializing the printer

ESC
27
1B
Function: Via ESC @ the printer can be reset by the program to certain operating conditi-
ons (initializing of software). ESC @ resets the printer to the default values and deletes all the print data of the current line out of the print buffer, which were transmitted prior to the command.
The following actions will be executed: – set line spacing to 6 lines per inch – set the document format and the right and bottom margins to the default va-
lues (the current vertical position is defined as the new line 1)
set the left margin to the value which has been set in the emulation menu
(adjustable via the operating panel)
set the character spacingto the value which has been set in the emulation
menu (adjustable via the operating panel)
set the print quality and type font to the value which has been set in the emu-
lation menu (adjustable via the operating panel) – delete vertical tabs and select channel 0 – switch off elongated, bold, double impact and italic print – delete MSB specification
@ 64 40
ASCII character Decimal Hexadecimal
set additional character spacing to 0 – delete superscript or subscript – switch off underlining – adjust printing flush lef
42
t.
T5023/5023+ - Programming Guide
Page 53
Standard commands Controlling the configuration of the printer
i
When initializingor defining printer parameters for certain applications, the following cases are to be differentiated:
Parameters, which are specified by means of their default value – Parameters, which are set by corresponding ESC sequences (do-
cument length, type font, character width, etc.)
Parameters, which are reset to their default value by means of the
command ESC @.
All default values of the document printer are listed in the appendix of this ma­nual.If the printeris initializedvia ESC @ at any vertical position on a document, undesired results can occur during subsequent actions (current vertical position is new line 1). For this reason ESC @ is not recommended for initializing para­meters within a document.
T5023/5023+ - Programming Guide 43
Page 54
Controlling the configuration of the printer Standard commands

Selecting unidirectional printing for one line

ESC
27
1B
Function: Via ESC < the next printing line is printed from right to left. This command will be
cancelled automatically by a carriage return (CR).
<
60
3C
ASCII character Decimal Hexadecimal

Switching the unidirectional printing mode on/ off

ESC
27
1B
Function: Normally printing is bidirectional (optimal printing path). Unidirectional printing
(printing in only one direction) is sensible, for example, in order to ensure a pre­cise positioning of the characters when printing a text or graphics, thus to produ­ce a neat print format.
ESC U (n) activates or deactivates unidirectional printing, by which n serves as an on/ off switch:
n=1
U 85 55
activates the mode (unidirectional on),
(n)
n n
ASCII character Decimal Hexadecimal
n=0deactivates the mode (unidirectional off).
Example: Afterprinting three lines, a change is to take place between bidirectionaland uni-
directional printing. Bidirectional printing begins.
44
T5023/5023+ - Programming Guide
Page 55
Standard commands Controlling the configuration of the printer
BEGIN
PRINT(char(27),"U",char(0)) <-- bidirectional on
PRINTLF("bidirectional printing") PRINTLF("bidirectional printing") PRINTLF("bidirectional printing")
PRINT(char(27),"U",char(1)) <-- bidirectional off
PRINTLF()
PRINTLF("unidirectional printing") PRINTLF("unidirectional printing") PRINTLF("unidirectional printing")
END
Result:
T5023/5023+ - Programming Guide 45
Page 56
Controlling the configuration of the printer Standard commands
i

Setting the MSB to 1

ESC
27
1B
Function: ESC > sets the most significant bit (MSB) of all incoming data to 1. Thus it is pos-
sible to print italic or graphics characters or characters defined by the user for programs on computers, which only transfer 7- bit data (access to character ta­ble range from hex 80 to hex FF).
The MSB setting via ESC > is deleted by the following ESC seuences: – ESC @ (Initializing the printer) – ESC = (Deleting the most significant bit) – ESC # (Deleting the MSB specification).
> 62
3E
ASCII character Decimal Hexadecimal
46
T5023/5023+ - Programming Guide
Page 57
Standard commands Controlling the configuration of the printer
i

Setting the MSB to 0.

ESC
27
1B
Function:
ESC = sets the most s ignificant bit (MSB) of all incoming data to 0 (zero). Thus it is possible to print characters of the standard code table even for programs on compu­ters which only transfer 7- bit data.
The MSB setting via ESC = is deleted by the following ESC seuences: – ESC @ (Initializing the printer) – ESC > (Setting the most significant bit) – ESC # (Deleting the MSB specification)
=
61
3D
ASCII character Decimal Hexadecimal
.
T5023/5023+ - Programming Guide 47
Page 58
Controlling the configuration of the printer Standard commands
i

Deleting the MSB specification

ESC
27
1B
Function: ESC # cancels the MSB specification (deletingor setting the most significant bit)
resulting from ESC =
An MSB specification resulting from ESC = or ESC > is also cancelled, when the printer is initialized with software (see ESC @).
# 35 23
or ESC >.
ASCII character Decimal Hexadecimal
48
T5023/5023+ - Programming Guide
Page 59
Standard commands Controlling the configuration of the printer

Printer offline

DC3
19 13
Function: DC3 (device control 3) switches the printer offline (printer inactive) until a DC1
code (printer online) is received. In no way can the printer be reactivated via the STOP key.
ASCII character Decimal Hexadecimal

Printer online

DC1
17 11
Function: DC1 (device control 1) switches the printer back online after it has previously
been switched offline by a DC3 code. If the printer was switched off via the STOP key, it cannot be switched online
again using this command.
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 49
Page 60
Controlling the configuration of the printer Standard commands
i

Automatic single sheet feeder on/off

ASC II Decimal Hexadecimal Function
0 48 30 Switches single sheet feeder off 1 49 31 Selects feeder compartment 1
(only if 2 feeder compartments are available)
2 50 32 Selects feeder compartment 2
(only if 2 feeder compartments are
available) 4 52 34 Switches single sheet feeder on R 82 52 Ejects one sheet without pulling in a
new one.
Sincethe automatic single sheet feeder is not available for the document printer, all other parameters (n = R) are ignored except for one.
Instead of ESC EM R (= sheet ejection) use the FF (Form Feed) com­mand to do without the ESC EM command altogether in an application.
50
T5023/5023+ - Programming Guide
Page 61
Standard commands Special character codes

Special character codes

In this chapter the following commands are described:
Command Function
CR Carriage Return BS Backspace of one character DEL Deleting a character CAN Canceling a line

Carriage return

J J
CR
13
0D
Function: After CR (carriage return) the data containedin the buffer is printed and the print
head is returned logically to the left edge. If CR, according to the setting, for example, on the operating panel, is only inter-
preted as CR, the print head is returned on the same line. If necessary, an addi­tional line feed must be achieved by subsequently pressing LF (line feed, see section “Line feed commands” in this chapter).
If CR, according to presetting, is interpreted as CR + LF, a line feed is added after execution of the carriage return.
Example:
A demonstration of the effect of CR commands depending on presetprinter parame-
.
ters
BEGIN
PRINT("Test line", char(13)) PRINT("Test line", char(13)) PRINT("Test line", char(13))
END
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 51
Page 62
Special character codes Standard commands
Result: – CR without line feed
CR with line feed
52
T5023/5023+ - Programming Guide
Page 63
Standard commands Special character codes

Backspace of one character

BS
8
08
Function: After each BS character (backspace) the print head is moved logically one cha-
racter to the left. Thus characters can be printed one upon the other. If this command is received immediately following graphics printing, the print
head will return to the position in which it was before the start of graphics prin­ting.
In the following cases the BS command is ignored: – the print head is at the left edge – the previous character is an HT character (horizontal tab as column limit) – a command for an absolute or relative point positioning of the print head was
received beforehand (ESC $ (n1) (n2) or ESC \ (n1) (n2))
–withESC a (n) a text adjustment other than flush left was selected(i. e. cen-
tered, flush right or margin justification).
Example:
With BS the mathematical signs for ’corresponds to’ and ’unequal’ are to be produ­ced.
ASCII character Decimal Hexadecimal
BEGIN
PRINTLF("corresponds to: ","=", char(8)," ^") PRINTLF("unequal: ","=",char(8),"/")
END
Result:
T5023/5023+ - Programming Guide 53
Page 64
Special character codes Standard commands

Deleting a character

DEL
127
7F
Function: DEL (Delete) deletes the previous text character in the buffer as long as it has
not yet been printed. The control codes remain unchanged.
ASCII character Decimal Hexadecimal

Cancelling a line

CAN
24 18
Function: CAN (Cancel) cancels in the printing buffer the whole text of one print line prior
to this code, but not the control codes.
ASCII character Decimal Hexadecimal
54
T5023/5023+ - Programming Guide
Page 65
Standard commands Line feed commands

Line feed commands

The standard line spacing amounts to six lines per inch, i. e. the line spacing is 1/ 6 inch.
The line spacing can be changed using the following commands, whereby the smal­lest unit for the line spacing is 1/ 180 inch. The corresponding line feed is carried out depending on the set line spacing:
Command Function
LF ESC J (n) ESC 0 ESC 2 ESC 3 (n) ESC A (n) ESC + (n)
Line feed Carrying out an n/180 inch line feed Determining 1/8 inch line spacing Determining 1/6 inch line spacing Determining 1/180 inch line spacing Determining1/60inchlinespacing Determining 1/360 inch line spacing
J J J J J J
T5023/5023+ - Programming Guide 55
Page 66
Line feed commands Standard commands
i

Line feed

LF
10
0A
Function:
OnreceiptofthecommandLF (line feed) the data contained in the buffer is printed and the paper transported one line further according to the current line spacing
If after LF thelogical bottom edge of the sheet is exceeded (depen-
ding on the set document format), the document is ejected.
If a bottom margin set using ESCN(n)is exceeded, the document
is also ejected.
The horizontal position is
ASCII character Decimal Hexadecimal
.
set back to the left margin (CR).
56
T5023/5023+ - Programming Guide
Page 67
Standard commands Line feed commands

Carrying out an n/ 180 inch line feed

ESC
27
1B
Function: ESC J (n) transports the paper n/ 180 inchon. A value between 0 and 255 must
be given for n. This command produces an immediate line feed, but does not ef­fect a carriage return (no CR with positioning of the print head at the beginning of the line).
ESC J (n) has no influenceon the current line spacing, which results, for examp­le, by means of LF (line feed).
Example:
A demonstration of the difference between a normal line feed and an n/ 180 inch” feed.
BEGIN
PRINTLF("This is the first line") PRINT("Second line") PRINT( char(27),"J", char(5))¨ PRINTLF("with the rest displaced by 5/180 inch") PRINTLF("Now it continues normally")
END
J
74
4A
(n)
n n
ASCII character Decimal Hexadecimal
5/180 inch
Result:
T5023/5023+ - Programming Guide 57
Page 68
Line feed commands Standard commands
i

Determining 1/8 inch line spacing

ESC
27
1B
Function: ESC 0 sets the line spacing to 1/8 inch for the subsequent line feed commands.
The 0 is the ASCII character for the figure zero and not the ASCII code 0
The line spacing set by ESC 0 is cancelled, if – the printer is initialized a new (ESC @) – a different line spacing is set by means of ESC 2, ESC 3 (n) or ESC
Example:
A demonstrationof the difference between the standard line feed (1/ 6 inch) and the 1/8 inch line spacing. The printer begins with the standard line feed.
BEGIN
PRINTLF("This is the first print line") PRINTLF("This is the second print line") PRINTLF()
PRINT(char(27),"0") <-- 1/8 inch
PRINTLF("This is the first print line") PRINTLF("This is the second print line")
END
A(n)
0 48 30
.
ASCII character Decimal Hexadecimal
..
Result:
58
T5023/5023+ - Programming Guide
Page 69
Standard commands Line feed commands

Determining 1/6 inch line spacing

ESC
27
1B
Function: ESC 2 sets the line spacing to 1/ 6 inch for the subsequent line feed commands.
This value is the effective default value when the printer is switched on. The 2 is the ASCII character for the figure two and not the ASCII code 2.
Example: see ESC 0.
2 50 32
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 59
Page 70
Line feed commands Standard commands

Determining n/180 inch line spacing

ESC
27
1B
Function: ESC 3 (n) sets the line spacing to n/ 180 inch for the subsequent line feed com-
mands. A value between 0 and 255 inclusive must be given for n. The 3 is the ASCII character for the figure three and not the ASCII code 3. Example: A demonstration of the printout for n = 1 to 20 with a measuring unit of
line spacing
BEGIN
END
Result:
.
SETN=0 REPEAT
SETN=N+1 PRINT( char(27),"3", char(N)) PRINTLF( N,"/180 inch line spacing")
UNTILN=20
3 51 33
(n)
n n
ASCII character Decimal Hexadecimal
n/180 inch
60
T5023/5023+ - Programming Guide
Page 71
Standard commands Line feed commands

Determining n/60 inch line spacing

ESC
27
1B
A 65 41
(n)
n n
ASCII character Decimal Hexadecimal
Function:
ESCA(n)sets the linespacing to n/60 inchforthe subsequentlinefeed commands. A value between 0 and 127 inclusive must be given for n (0 = no feed)
.
Example:
Ademonstrationof the printoutusing four n- values(0, 3, 5, 18) witha measuring unit of n/ 60 inch line spacing. 6 lines are printed for each n.
BEGIN
SETloop=0 REPEAT
SETloop=loop+1 SETN=0
N=3 N=5
N=18 CASE OF loop PRINT( char(27),"A", char(N)) <-- N = spacing SET line = 0 REPEAT
SETline=line+1 PRINTLF( N,"/60 inch line spacing")
UNTIL line = 6
UNTIL loop = 4 PRINT( char(27),"@") <-Initializing the printer PRINTLF()
END
T5023/5023+ - Programming Guide 61
Page 72
Line feed commands Standard commands
Result:
62
T5023/5023+ - Programming Guide
Page 73
Standard commands Line feed commands
i

Determining n/360 inch line spacing

ESC
27
1B
Function: ESC + (n) sets the line spacing to n/ 360 inch for the subsequent line feed com-
mands (LF). A value between 0 and 255 inclusive must be given for n.
As the document printer can only execute line feeds in a matrix of min. 1/180 inch, an uneven value for n (1, 3, 5, ...) leads to a rounding-off error of 1/360 inch.
+
43
2B
(n)
n n
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 63
Page 74
Sheet ejection commands Standard commands
i

Sheet ejection commands

The length of a document can be set directlyor indirectly and the document ejec­ted using the following commands:
Command Function
FF Sheet ejection ESC C (n) Determining the document length in lines ESC C NUL (n) Determining the document length in inches
Using ESCC(n)or ESC C NUL (n) the document length depending on the size of the document to be processed is set for the document.
On the basis of the document length thus set, the bottom margin (see ESCN(n)) can be set and the actual area to beprinted on a document can be determined.
64
T5023/5023+ - Programming Guide
Page 75
Standard commands Sheet ejection commands
i

Sheet ejection

FF
12
0C
Function: After FF all the data still contained in the printing buffer is printed and subse-
quently the current document ejected. After the ejection the current logical position of the print line (distance between
the upper edge of the document and the base line of the print line) is identical to the insertion position set via the operating panel (value between 10/ 60 and 80/ 60 inch) if print data is transmitted without a previous insertion command. Howe­ver, a document will not be requested until print jobs are available!
The insertion position can be set in the document printer menu by selecting the menu item TOF- POS (see the Operating Manual). The default value is 3/ 6 inch.Manual
If a further FF ora series of FFs immediately followan FF, these will not be executed.
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 65
Page 76
Sheet ejection commands Standard commands
i

Determining the document length at n lines

ESC
27
1B
Function: ESC C (n) sets the document length at n lines in the selected line spacing. A va-
luebetween 1 and 127 must be given for n. The actual physical document length is then determined by the respective current line spacing.
It should be noted that the respective document length (n lines line spacing) must not exceed the length of the document.
The current line,in which the print head is located on receipt of the command, is fixed as the starting position of the document. A bottom margin set by means of ESCN(n)is cancelled (see the corresponding command description in the “Ver­tical print control” section).
If the print head is positioned beyond the edge of the paper (for examp­le, for a document length of 12 inches), the printerissues an error mes­sage(PAPER LENGTH). If a bottom margin is set logicallyon thepaper via ESC N (n) (for example, at 9 inches) and this margin is exceeded, a form feed (FF) is executed.
C 67 43
(n)
n n
ASCII character Decimal Hexadecimal
66
T5023/5023+ - Programming Guide
Page 77
Standard commands Sheet ejection commands
i

Determining the document length at n inches

ESC
27
1B
Function: ESCCNUL(n)sets thedocument length at n inches (absolute documentlength
independent of the line spacing). The value of n must lie between 1 (inch) and 50 (inches) inclusive.
The value n (inches) must be selected so that the length of the paper format is not exceeded. If the format is exceeded by a corresponding n, the printer auto­matically sets the maximum permitted format height as the current document length.
The current line, in which the print head is located on receipt of the command, is fixed as the starting position of the document. The bottom margin, possibly de­termined by ESCN(n), is cancelled by ESC C NUL (n).
If the print head is positioned beyond the edge of the paper (for examp­le, for a document length of 12 inches), the printerissues an error mes­sage(PAPER LENGTH). If a bottom margin is set logicallyon thepaper via ESCN(n)(for example, at 9 inches) and this margin is exceeded, a form feed (FF) is executed.
C 67 43
NUL
0
00
(n)
n n
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 67
Page 78
Vertical print control Standard commands
i

Vertical print con trol

This section describes the commands for setting vertically arranged document positions (end of document and vertical tabs). An automatic end of document and feeding on certain lines are thus possible without the corresponding printing of blank lines.
The data of vertical tabs is allocated to channels,which are numbered from 0 to 7.
Command Function
ESC N (n) Setting the bottom margin ESC O Deleting the bottom margin ESC B ... NUL Determining/ deleting vertical tabs ESC b (c) ... NUL Determining/ deleting vertical tabs in channels ESC / (c) VT Verticaltabulation ESC EM n Paper control
A difference must be made between the vertical leading edges ’upper leading edge’ and ’lower leading edge’. The vertical leading edges are defined in the chapter “Additional commands”.
Selecting a vertical tab channels
Setting vertical tabs is possible in two ways: – upto16fixedtabs(ESC B) up to 8 tab groups (channels 0 to 7) with up to 16 tabs respectively
In this case it is possible to switch over to a certain tab group depending on the application before the printing of a document (ESC /) and thereby the structure of different types of document can be controlled flexibly.
If tabs already set are to be reset, the old tab values for the corresponding chan­nel must be deleted beforehand.
Whensetting verticaltabs, the appropriate absolute lineposition iscalculated on the basis of the currently set line spacing. Even if the line spacing is altered at intervals,the line position of a tab remains unchanged. If necessary,when chan­ging the line spacing, the old tab values must be deleted and set anew.
If no vertical tabs are defined, a tabulation command in a vertical direction is carried out as a line feed
68
.
T5023/5023+ - Programming Guide
(ESC b).
Page 79
Standard commands Vertical print control

Setting the bottom margin

ESC
27
1B
N 78
4E
(n)
n n
ASCII character Decimal Hexadecimal

Function: ESC N (n) sets a bottom margin of n lines in the currently valid line spacing. The

standard document length (presetting of the printer) or the document length set by ESC C (document length in lines) or by ESC C NUL (document length in inches) serves as the basis.
Avaluebetween0 and 127can be selectedforn.The margin resulting from thismust be smaller than the document length.
When the bottom margin is reached, a document ejection is automatically start-
ed.
T5023/5023+ - Programming Guide 69
Page 80
Vertical print control Standard commands
i
Subsequent alterations to the line spacing have no influence on the
set margin area. If necessary, after a change in the line spacing the bottom margin setting must be deleted (ESC O) and then reset using ESC N.
Aset bottom marginis automatically cancelled, when the document
length is altered using ESC C or ESC C NUL.

Deleting the bottom margin

ESC
27
1B
Function: A bottom margin determined by ESC N or by the setting of the printer is deleted
using ESC O .
O
79
4F
ASCII character Decimal Hexadecimal
70
T5023/5023+ - Programming Guide
Page 81
Standard commands Vertical print control
i

Determining / deleting vertical tabs (channel 0)

ESC
27 1B
Function: – Setting tabs
Using ESC B ... NUL up to 16 vertical tabs can be determinedin the relevant line spacing. Subsequent alterations in the line spacing do not affect this.
The tab values are entered asn1, n2 (number of lines), etc. from 1 up to and including 255 in ascending order. The sign NUL marks the end of the com­mand.
Deleting tabs
Via ESC B NUL the set tabs are deleted (NUL characters directly after
ESC B).
B 66 42
–UsingESC B ... NUL the tabs are set in channel 0. If more than one set of tabs is to be defined, this must occur via
A vertical tab jump occurs via the command VT (for ASCII decimal
(n1)
n1 n1
ESC b (smallb).
11, hex 0B).
(n2)
n2 n2
...
NUL ... ...
ASCII character
0
Decimal
00
Hexadecimal
T5023/5023+ - Programming Guide 71
Page 82
Vertical print control Standard commands
i

Determining / deleting vertical tabs for any channel

ESC
27
1B
Function: – Setting tabs
ESC b (c) ... NUL has (in principle) the same function as ESC B ... NUL.By means of the variable c (a number between 0 and 7) a certain channel for vertical tabs can be selected additionally. Thus it is possible to define eight different tab groups, each with up to 16 vertical tabs.
The change between the tab channels occurs via the command ESC / (c), whereby c identifies the corresponding channel number.
Deleting the tabs for one channel
Via ESC b (c) NUL the tabs set in channel c (0 to 7) are deleted (NUL cha­racters directly after ESC b (c)).
b 98 62
If vertical tabs were set using ESC B ... NUL , channel 0 is occu-
pied.
Before tab values for a channel can be altered, these values must
be previously deleted in the appropriate channel (for example, ’De­leting tabs in channel 0’ using ESC b 0 NUL or ESC B NUL).
(c)
c c
(n1)
n1 n1
...
NUL ... ...
ASCII character
0
Decimal
00
Hexadecimal
72
T5023/5023+ - Programming Guide
Page 83
Standard commands Vertical print control
i

Selecting a vertical tab channel

ESC
27
1B
Function: Via ESC / (c) a vertical tab channel c can be selected. The values 0 to 7 (= chan-
nel 0 to channel 7) are permitted for c. For all subsequently entered VT commands (Vertical tabulation)the paper feed
will then be controlled by the valid tabs in the current channel.
47
2F
/
(c)
c c
ASCII character Decimal Hexadecimal

Vertical tabulation

VT
11
0B
Function:
After VT all the data contained in the buffer is printed and the paper transported to the next tab in the current channel.
A channel can be selected via ESC / (channel number). – If no c hannel has been selected, the vertical tabs are accepted in
channel 0.
ASCII character Decimal Hexadecimal
If no vertical tabs are set in the standard channel 0 nor in a selected
channel 1 to 7, the paper is only transported one line on after VT (Line feed).
T5023/5023+ - Programming Guide 73
Page 84
Vertical print control Standard commands
i

Paper control

ESC
27
1B
Parameter: n=0 Deactivates the mode n=1 Selects the feeder compartment 1 n=2 Selects the feeder compartment 1 n=4 Selects the feeder compartment 1 n=R Ejection
This command is only to be used if a single sheet feeder is installed. If the feeder is activated and no document has be fed by the operator, a document will be fed from the paper supply automatically when a print or line feed command is received.
EM
25 19
n n n
ASCII character Decimal Hexadecimal
74
T5023/5023+ - Programming Guide
Page 85
Standard commands Horizontal print control

Horizontal print control

This section describes the commands for setting horizontally arranged docu­ment positions (left or right margin and horizontal tabs). The following functions are possible:
automatic end of line, i. e. automatic carriage return with line feed when a
certain column position is reached
feeding at certain column positions without the corresponding printing of
blank spaces
feeding to any (dot) positions of a line.
Command Function
ESC l (n) Determining the left margin ESC Q (n) Determining the right margin ESC a (n) Determining the text adjustment ESC D (n1) (n2) ... NUL Determining/ deleting horizontal tabs HT Horizontal tabulation ESC $ (n1) (n2) Horizontal positioning (absolute) ESC \ (n1) (n2) Horizontal positioning (relative) ESC SP (n) Determining the character spacing
J J
J J J
When positioning the print head horizontally, a distinction must be made bet­ween the horizontal leading edge on the left and on the right. For example, with horizontal leading edge on the left, print position 0 can be the same as the left edge of the document or, after ESC l (n), displaced to the right by the v alue n. Dependences during horizontal print positioning are described in more detail in the “Additional commands” chapter.
When setting the left and right margins or the horizontal tabs the appropriate ab­solute column position is calculated on the basis of the currently set character size (10, 12, 15 c pi, elongated or condensed print). Even if the character size is altered at intervals, the absolute column position remains unchanged. If neces­sary, when changing the charac ter size the old margin or tab values must be de­leted and reset.
The lengthof the lines depends on the distance between the left (ESC l) and the right(ESC Q)margins. The adjustmentof thetext can be selected flushleft, flush
T5023/5023+ - Programming Guide 75
Page 86
Horizontal print control Standard commands
right, centered or with margin justification (ESC a). Feeding to a certain position on a line is specified in dots and calculated either
startingfrom theleft margin(ESC $, 1 dot = 1/60inch) or starting from the current print position (ESC \ , 1 dot = 1/180 inch or 1/120 inch).
76
T5023/5023+ - Programming Guide
Page 87
Standard commands Horizontal print control

Setting the left margin

ESC
27
1B
Function: Using ESC l (n) the horizontal ’print position 0’ can be influenced, that is to say,
a left margin can be set. The left margin (absolute distance from the left edge of the document) is determined by means of the value of n and the currently valid character width. A value between 0 and 160 can be selected for n. The margin resulting from this must not, however, be wider than 8 inches. If the left margin width is defined as greater than 8 inches, the command is ignored.
n = 0: print position 0 = left edge of document n > 0: print position 0 = left edge of document + n
I
108
6C
(n)
n n
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 77
Page 88
Horizontal print control Standard commands
i
The absolute margin position is dependent on the set character
size (10, 12 or 15 cpi) and the print mode (condensed, elongated, normal). With proportional spacing the left margin is determined ac­cording to the character size 10 cpi. Subsequent alterations to the character size have no influence on the set margin.
The distance between the left and right margins must be at least 10
cpi.
ESC l (n) should be entered at the beginning of a print line as
ESC l (n) deletes all the previously entered characters and tabs in the same print line.
Example:
First of all, the left document margin will be set using ESC l (n) for several values of n. Subsequently, the effect of the current character size on the left margin will be de­monstrated.
BEGIN
SETN=6 REPEAT
SETN=N+1
PRINT(char(27),"1",char(N)) <-- Setting left margin
PRINTLF("Left margin",N - 1,"columns") UNTIL N = 10 PRINTLF()
12 cpi character
PRINT(char(27),"M") <-- (ESC M)
PRINT(char(27),"l",char(10)) <-- Setting left margin
PRINTLF("Left margin 9 columns (12 cpi)")
PRINT(char(27),"W",char(1) <-- Switching on elongated PRINTLF("Left margin unchanged") print(ESC SO)
PRINT(char(27),"l",char(10)) <-- Setting left margin
PRINTLF("margin 9 columns (elongated)")
PRINT(char(27),"l",char(160)) <-- Left margin PRINTLF("margin ignored") >8inch
PRINTLF("not printed",char(27),"1",char(10),"printed")
END
78
T5023/5023+ - Programming Guide
Page 89
Standard commands Horizontal print control
Result (reduced in size):
Result (original size):
T5023/5023+ - Programming Guide 79
Page 90
Horizontal print control Standard commands

Setting the right margin

ESC
27
1B
Q 81 51
(n)
n n
ASCII character Decimal Hexadecimal
Function: ESC Q (n) influences the last horizontal print position,that is to say, a right mar-
gin can be set. The right margin is determined by means of the value of n and the current valid character width. A value between 0 and 255 can be selected for n.
The nthcolumn will then not be printed.
If a text line exceeds the right margin, a carriage return with a line feed is automati­cally executed (even within a word). So many characters are printed in one line until the space between the left and right margins is used up. Printing is then continued on a new print line
80
.
T5023/5023+ - Programming Guide
Page 91
Standard commands Horizontal print control
i
The absolute margin position is dependent on the set character
size (10, 12 or 15 cpi) and the print mode (condensed, elongated, normal). With proportional spacing, the right margin is determined according to the character size 10 cpi. Subsequent alterations to the character size have no influence on the set margin.
The distance between the left and right margins must be at least
two 2/10“(two characters with 10 cpi).
ESC Q ( n) should be entered at the beginning of a print line, as
ESC Q (n) deletes all the previously entered characters and tabs in the same print line.
Example:
Ademonstrationofwhateffecta rightmarginhason the carriage return and linefeed. (For the influence of the current character size on the right margin compare with con­trol command for “Setting the left margin”).
BEGIN
SETN=30 REPEAT
SETN=N+4 PRINT(char(27),"Q",char(N)) <-- Setting the right PRINT("Line length equal to the distance") margin PRINTLF(" between left and right margins")
UNTIL N = 42
END
Result:
T5023/5023+ - Programming Guide 81
Page 92
Horizontal print control Standard commands

Setting the text alignment

ESC
27
1B
Function: ESC a (n) sets the following text alignments depending on n (0 ... 3): – flush left : n = 0 (default value) – centered : n = 1 – flushright:n=2 – margin justification : n = 3
The adjustment takes place after the output of the following control commands: – CR (Carriage return, is output implicitly, for example, by the print command
PRINTLF)
LF (Line feed, is output implicitly, for example, by the print command PRINT
LF) – VT (Vertical tabulation) – FF (Form feed)
a 97 61
(n)
n n
ASCII character Decimal Hexadecimal
After an additional command (ESC [ ...) With margin justification the text is aligned flush left and flush right. Thereby the
word spacing and the character spacing are increased, if necessary. The divisi­on of a text into print lines tak es place automatically. Therefore LF or CR com­mands, for example, via the print command PRINTLF, should only be used within a margin justification text in order to set a paragraph in the text.
82
T5023/5023+ - Programming Guide
Page 93
Standard commands Horizontal print control
i
After switching on or initializing the printer (ESC @) the text align-
ment is flush left (n = 0).
In most programming languages there are print commands, which,
after the output of the printed text, automatically carry out the CR or LF command (for example, PRINTLF).
The control commands HT (Horizontal tabulation) and BS
(Backspace) are without effect with centered and flush right text ali­gnment or with margin justification.
ESC a (n) should be enter ed at the beginning of a print line, as
ESC a (n)deletes all thepreviously entered characters in the same print line.
T5023/5023+ - Programming Guide 83
Page 94
Horizontal print control Standard commands
i

Setting / deleting horizontal tabs

ESC
27
1B
Function: – Setting tabs
Using ESC D ... NUL up to 32 columnpositions in the current characterwidth can be set as horizontal tabs.
The tab values are specified as n1, n2, etc. between 1 and 137 inclusive in ascending order. Tab positions, which exceed the right margin, are ignored. The sign NUL marks the end of the command.
Using ESC D NUL the set tabs are deleted (NUL sign directly after ESC D)
D 68 44
A horizontal tab jump takes place via the command HT (for ASCII
The absolute tab position is dependent on the set character size
With condensed print the spacing of the tabs amounts to 60 % of
(n1)
n1 n1
decimal 9 and hex 09).
(10, 12 or 15 cpi) and the print mode (condensed, elongated, nor­mal). With proportional spacing the tab positions are set according to the character size 10 cpi. Subsequent alterations to the charac­ter size do not affect the absolute tab positions.
the character width, with elongated print double the normal charac­ter spacing.
(n2)
n2 n2
...
NUL ... ...
ASCII character
0
Decimal
00
Hexadecimal
.
After switching on the printer or after initializing (ESC @) the tabs
are set at a spacing of eight 10-cpi characters.
84
T5023/5023+ - Programming Guide
Page 95
Standard commands Horizontal print control
i

Horizontal tabulation

HT
9
09
Function: Using HT the print head is set to the next tab position.
After positioning on the last (right) tab position the HT command has no effect. This also applies if all the tab positions were deleted using ESC D NUL.
After switching on the printer or after initializing (ESC @) the tabs
are set at a spacing of eight 10-cpi characters.
The tab positions are set using the command ESC D and deleted
using ESC D NUL.
With centered and flush right text adjustment or with margin justifi-
cation (ESC a (n))theHT command is ignored.
Various programs and computers convert the HT command into
corresponding blank spaces instead of passing the command di­rectly to the document printer.
ASCII character Decimal Hexadecimal
T5023/5023+ - Programming Guide 85
Page 96
Horizontal print control Standard commands
i

Horizontal positioning (absolute)

ESC
27
1B
Function: By means of ESC $ (n) (m) the print head is moved horizontally to a position
which is calculated independently of the current character size from the values n and m relativeto the previouslyset “logical left” margin (leftmargin of sheet set using ESC l (n)).The distanceof the print head fromthe left sheetmargin results from the following formula:
A value between 0 and 255 for n and a value between 0 and 3 for m can be sel­ected. (m 256 + n) may not be more than 816.
ESC $ (n) (m) is ignored if the specified position exceeds the logical right margin set using ESC Q (n).
Example:
$ 36 24
(m 256 + n) / 60 inch
(n)
n n
(m)
m m
ASCII character Decimal Hexadecimal
The distance of the text from the left sheet edge is increasedstep- by- step.
BEGIN
SETN=60 REPEAT
SETN=N+30 PRINT(char(27),"$",char(N,0)) PRINT("Distance from left sheet edge") PRINTLF(N/60,"inch")
UNTIL N = 180
END
86
T5023/5023+ - Programming Guide
Page 97
Standard commands Horizontal print control
Result (reduced in size):
Result (Original size):
T5023/5023+ - Programming Guide 87
Page 98
Horizontal print control Standard commands
i

Horizontal positioning (relative)

ESC
27
1B
Function: Via ESC \ (n) (m) the printhead is displaced horizontally to a position relative to
the current print position. The position is calculated depending on the selected print quality (Draft or LQ) from the values n and m using the following formula:
(m 256 + n) / 120 inch (Draft) (m 256 + n) / 180 inch (LQ)
ESC \ (n) (m) is ignored if the specified position exceeds the right mar­gin set using ESC Q (n).
92
5C
\
(n)
n n
(m)
m m
ASCII character Decimal Hexadecimal
88
T5023/5023+ - Programming Guide
Page 99
Standard commands Horizontal print control
Example:
At the beginning the Draft print quality is set.
BEGIN
PRINT("Displacement") PRINT(char(27),"\",char(180,0)) PRINTLF("by 1.5 inches") PRINT(char(27),"x",char(1)) <-- LQ-mode PRINT("Displacement") PRINT(char(27),"\",char(180,0)) PRINTLF("by 1 inch")
END
Result:
T5023/5023+ - Programming Guide 89
Page 100
Horizontal print control Standard commands
i

Determining the character spacing

ESC
27
1B
Function: Using ESC SP (n) the normal distance between two print characters can be
increased. The additional character spacing is calculated depending on the sel­ected print quality (Draft or LQ) from the value of n using the following formula:
n /120 inch (Draft) n /180 inch (LQ)
n can accept values between 0 and 127.
After switching on or initializing the printer (ESC @) n has the value 0.
SP
32 20
(n)
n n
ASCII character Decimal Hexadecimal
90
T5023/5023+ - Programming Guide
Loading...