"All rights, including rights of translation by printing, copying or similar methods,
even of parts, are reserved.
All rights, includingrightscreatedbypatentgrants or registrationof a utility model or design, are reserved. Delivery subject to availability; right of technical modifications reserved."
TRADEMARKS
All names of hardware and software products mentioned in this manual are trade names and/
or trademarks of their respective manufactores.
This programming manual describes in the main the instruction set of the multifunctional 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, operating 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:
CourierSystem outputs, such as error messages, informati-
on, notes, file extracts
Courier BoldExample 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 Guide1
Page 12
AbbreviationsPreface
Abbreviations
APA graphicsAll Points Addressable graphics
APRAutomatic Passbook Reader
CSCharacter Set
DQDraft Qualitiy
IFInterface
LQLetter Quality
MSRMagnetic Stripe Reader
MICRMagnetic Ink Character Recognition
CSIControl Sequence Introducer
LSBLeast Significant Bit
MSBMost Significant Bit
OCROptical 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 languages (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
PrefaceContents 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 multifunctional document printer are described using examples.
Chapter “Standard commands”
All the Epson- compatible control commands of the document printer are described 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, graphics 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 Guide3
Page 14
Contents of the manualPreface
Chapter “Additional commands”
This chapter explains special control commands for document processing or for
processing ZeKoSa data. An important application area for the commands described here is the processing of passbooks. This also contains important information on processing documents using horizontal and vertical print positioning.
Chapter “Application examples”
A small program example of command functions normally belongs to the command descriptions in the chapters “Standard commands”, “Character set commands”, 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 programmable 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 description 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
PrefaceContents 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 Guide5
Page 16
Contents of the manualPreface
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, unprinted 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 processing 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 documents is supported by an automatic alignment. The print characters can be positioned relative to all the document edges.
The following provides a comprehensive list of the characteristics of the document 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 Guide7
Page 18
OptionsShort description of the document printer
Options
Magnetic stripe reader (MSR)
As an option, the document printer can be delivered with a magnetic stripe reader (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 printerSystem interface
System interface
Data, which activates the functions of the printer is transferred through the system 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 Guide9
Page 20
System interfaceShort 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 applications. 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 possible incompabilities are described.
10
T5023/5023+ - Programming Guide
Page 21
Short description of the document printerApplication 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 Guide11
Page 22
Application areasShort 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 printable 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 Guide13
Page 24
Encryptions/CodesProgramming 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 hexadecimal 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 decimal 0 to decimal 255 (8- bit encryption).
Examples:
CharacterMeaningDecimalHex
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 (Escape) (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 document printer functions for document and MSR processing (see “document
printer specifications” in this chapter and the chapter “Additional commands”).
Examples (ESC sequences):
ESC
MeaningASCII 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
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")
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 corresponding information must then be converted into the appropriate programming 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 sequences via a program or the menu.
T5023/5023+ - Programming Guide17
Page 28
Print effectsProgramming 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 character 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 sequences in the program.
The OCR- A, OCR- B and ISO 8859 fonts, as well as all special, non- Epsoncompatible 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 elongated or condensed print.
Proportional type
With proportional type each character takes up a different amount of space accordingto 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 possible, for example, to highlight page headings in a text.
Example:
T5023/5023+ - Programming Guide19
Page 30
Print effectsProgramming 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 corresponding ESC sequences:
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 characters 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 printed.
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 Guide21
Page 32
Print effectsProgramming 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 example:
–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 Guide23
Page 34
Print effectsProgramming 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 codes 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 table’.
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 sequences. You can find the available codepages in the appendix.
T5023/5023+ - Programming Guide25
Page 36
Character tablesProgramming interface (General)
National character sets
Byselecting a national character set, characters used in other languages are additionally 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 character table.
Examples:
CodeBasic
character
5B
60
7C
Ä
,
:
ItalyJapanNorway
.
ù
ò
[
`
|
Æ
é
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 produced 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 separate section. In principle the production of a new character or symbol is the production 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 memory 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 controlled by programs with corresponding ESC sequences. The production of semi- 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 several lines. The line spacing can be set in such a way that no spaces arise between the lines in a picture.
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 relevant 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)
The device called MSR is used for processing magnetic stripes on passbooks.
The MSR equipment allows an automatic reading and updating of data in encrypted form.
In what form the appropriate data is encrypted on a MSR magnetic stripe depends on the respective recording mode (DIN/IBM).
Example (magnetic stripe on the back of a passbook):
1Inside of passbook
2Back of passbook
3Mangetic 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 unnecessary. The values for the line number and the balance are updated on the magnetic stripe before the printing of the passbook line.
When processing documents, in contrast to the normal processing of single
sheets or continuous forms, the varying sizes of the documents and the document 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 recognized, 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 ejected. Thus insertion and ejection procedures can be secured by means of separate control cycles in the program.
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 processing or for processing MSR data are described in the chapter “Additional commands”.
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 regarding the interpretation of the pseudo code instructions in the program examples 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“ chapterand “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 Guide33
Page 44
Notes about command descriptionStandard 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
QR
Coding of decimal command parameters
All command parameters n or n1, n2, etc. in the ESC sequences of the Epsoncompatible commands must be transferred to the document printer in binary coded form and not as ASCII characters. Several parameters are simply transferred consecutively without separation characters (e. g. space or comma). The
binary coding of a paramater must be implemented in the user programm by means 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 description.
34
T5023/5023+ - Programming Guide
Page 45
Standard commandsNotes 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
QR
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 commands (CSI sequences), the command parameters n, n1, etc. are coded 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 Guide35
Page 46
Notes about command descriptionStandard 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:
FunctionCoding
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 commandsNotes about command description
1When 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
7The 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 Guide37
Page 48
Notes about command descriptionStandard commands
The following values occur as arguments of PRINT and PRINTLF:
ArgumentMeaning
"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 evaluated.
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 commandsNotes 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 Guide39
Page 50
Notes about command descriptionStandard commands
i
Reaction to incorrect parameters or incorrect syntax
Normally incorrect parameters n, n1, etc. are automatically replaced by the respective default value (for example, if the specified value range is exceeded).
Commands with parameters which are within the specified value range, but infringe on the set conditions, are ignored (for example, if horizontal absolute positioning is attempted outside the possible print area).
Exceptions to these rules are specified separately with the corresponding command description, if necessary.
An exact description of the printable areas and the definition of horizontaland vertical positionsis containedin the section“Notes fordocument
processing” in the chapter “Additional commands”.
40
T5023/5023+ - Programming Guide
Page 51
Standard commandsControlling 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:
CommandFunction
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)
DC3Switching printer off logically (Offline)
DC1Switching 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 graphics characters or characters defined by the user could be printed.
J
J
The 8th bit can be deleted using the command ESC = . Therefore, characters 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 characters defined by the user.
T5023/5023+ - Programming Guide41
Page 52
Controlling the configuration of the printerStandard 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 commandsControlling 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 manual.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 parameters within a document.
T5023/5023+ - Programming Guide43
Page 54
Controlling the configuration of the printerStandard 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 precise positioning of the characters when printing a text or graphics, thus to produce 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-
Controlling the configuration of the printerStandard 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 table 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 commandsControlling 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 computers 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 Guide47
Page 58
Controlling the configuration of the printerStandard 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 commandsControlling 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 Guide49
Page 60
Controlling the configuration of the printerStandard commands
i
Automatic single sheet feeder on/off
ASC IIDecimalHexadecimalFunction
04830Switches single sheet feeder off
14931Selects feeder compartment 1
(only if 2 feeder compartments are
available)
25032Selects feeder compartment 2
(only if 2 feeder compartments are
available)
45234Switches single sheet feeder on
R8252Ejects 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) command to do without the ESC EM command altogether in an application.
50
T5023/5023+ - Programming Guide
Page 61
Standard commandsSpecial character codes
Special character codes
In this chapter the following commands are described:
CommandFunction
CRCarriage Return
BSBackspace of one character
DELDeleting a character
CANCanceling a line
Carriage return
JJ
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 additional 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-
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 printing.
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 produced.
ASCII character
Decimal
Hexadecimal
BEGIN
PRINTLF("corresponds to: ","=", char(8)," ^")
PRINTLF("unequal: ","=",char(8),"/")
END
Result:
T5023/5023+ - Programming Guide53
Page 64
Special character codesStandard 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 commandsLine 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 smallest unit for the line spacing is 1/ 180 inch. The corresponding line feed is carried out
depending on the set line spacing:
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
JJJJJJ
T5023/5023+ - Programming Guide55
Page 66
Line feed commandsStandard 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 commandsLine 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 effect 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 example, 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 Guide57
Page 68
Line feed commandsStandard 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 commandsLine 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 Guide59
Page 70
Line feed commandsStandard 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 commandsLine 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 Guide61
Page 72
Line feed commandsStandard commands
Result:
62
T5023/5023+ - Programming Guide
Page 73
Standard commandsLine 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 Guide63
Page 74
Sheet ejection commandsStandard commands
i
Sheet ejection commands
The length of a document can be set directlyor indirectly and the document ejected using the following commands:
CommandFunction
FFSheet 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 commandsSheet 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. However, 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 Guide65
Page 76
Sheet ejection commandsStandard 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 “Vertical print control” section).
If the print head is positioned beyond the edge of the paper (for example, for a document length of 12 inches), the printerissues an error message(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 commandsSheet 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 automatically 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 determined by ESCN(n), is cancelled by ESC C NUL (n).
If the print head is positioned beyond the edge of the paper (for example, for a document length of 12 inches), the printerissues an error message(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 Guide67
Page 78
Vertical print controlStandard 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.
CommandFunction
ESC N (n)Setting the bottom margin
ESC ODeleting the bottom margin
ESC B ... NULDetermining/ deleting vertical tabs
ESC b (c) ... NULDetermining/ deleting vertical tabs in channels
ESC / (c)
VTVerticaltabulation
ESC EM nPaper 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 channel 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 changing 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 commandsVertical 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 Guide69
Page 80
Vertical print controlStandard 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 commandsVertical 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 command.
–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 Guide71
Page 82
Vertical print controlStandard 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 characters 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, ’Deleting 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 commandsVertical 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 Guide73
Page 84
Vertical print controlStandard 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 commandsHorizontal print control
Horizontal print control
This section describes the commands for setting horizontally arranged document 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.
CommandFunction
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) ... NULDetermining/ deleting horizontal tabs
HTHorizontal tabulation
ESC $ (n1) (n2)Horizontal positioning (absolute)
ESC \ (n1) (n2)Horizontal positioning (relative)
ESC SP (n)Determining the character spacing
JJ
JJJ
When positioning the print head horizontally, a distinction must be made between 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 absolute 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 necessary, when changing the charac ter size the old margin or tab values must be deleted 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 Guide75
Page 86
Horizontal print controlStandard 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 commandsHorizontal 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 Guide77
Page 88
Horizontal print controlStandard 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 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 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 demonstrated.
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
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 automatically 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 commandsHorizontal 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 control 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 Guide81
Page 92
Horizontal print controlStandard 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 division of a text into print lines tak es place automatically. Therefore LF or CR commands, 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 commandsHorizontal 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 alignment 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 Guide83
Page 94
Horizontal print controlStandard 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, normal). With proportional spacing the tab positions are set according
to the character size 10 cpi. Subsequent alterations to the character size do not affect the absolute tab positions.
the character width, with elongated print double the normal character 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 commandsHorizontal 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 directly to the document printer.
ASCII character
Decimal
Hexadecimal
T5023/5023+ - Programming Guide85
Page 96
Horizontal print controlStandard 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 selected. (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 commandsHorizontal print control
Result (reduced in size):
Result (Original size):
T5023/5023+ - Programming Guide87
Page 98
Horizontal print controlStandard 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 margin set using ESC Q (n).
Function:
Using ESC SP (n) the normal distance between two print characters can be
increased. The additional character spacing is calculated depending on the selected 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...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.