ZX-News #27
08 апреля 1997

Exchange of experience - Control characters and sequence of control characters in the standard printers Epson.

<b>Exchange of experience</b> - Control characters and sequence of control characters in the standard printers Epson.
               EXCHANGE OF EXPERIENCE



               (C) Yuri Buravtsov (OneSOFT)

                        812/01.14


           Control characters
AND SEQUENCE OF GOVERNORS OF SYMBOLS

            THE STANDARD EPSON


  In the connection with PC printer receives
from PC-alphanumeric characters and symbols, which are called 
managers. Control characters perform in the device returns

carriage, linefeed, transfer format,
Return to step etc.


  Since the set of control characters is not enough to 
implement all the functions printer uses the escape sequence. 
Each sequence starts with ESC (27 dec or 1B hex). Control 
characters and escape sequences form a set of control commands. 
If the printer receives sequence, which in this version

ROM, the printer is not recognized, then this sequence is 
ignored. 


  Using escape sequences allows the programmer to manage
following properties printer:

 - The active position of the print

   head;
 - Print density of horizontal;
 - Tabulation of horizontal;
 - Border-line horizontal;
 - Print density in the vertical;
 - The length format;
 - Border vertical format;
 - Tabulation of the vertical;
 - Identification device;
 - Downloadable znakogenera
   torus;
 - Change the print modes graphics

   information;
 - The mode index;
 - Print mode with high quality.


  1. "None" denotes Code NUL. The team is used as the end 
Tabulation of positions and some control sequences.



  2. "Call" is denoted by code BEL, that
is sounding a buzzer.


  3. "Return to step" denotes the code
BS. According to this code print data nahodyayuiesya in the 
buffer line, and then the print head moves one character to the 
left. 


  4. "Horizontal tab" denotes the code HT. Print head moves to 
the position of horizontal tab pre-installed by

ESC "D" n1 ... nk 0. Ignored if not
defined tab stops or cancellation of pre-defined.

Note. Horizontal position taboo
            lostopov on paper

            varies

            horizontal density ne
            Chutney characters.


  5. "Newline" denotes the code
LF. Prints all data in the
buffer line, and the paper moves on
one row forward. Cancels the enhanced printing, set by the code 
of SO. 


  6. "Vertical Tab" denotes
Code VT. Prints all data from the buffer
line, followed by the paper moving
until the next vertical tab position, sequencing ESC
"B" n1 ... nk 0.


  If the position is not vertical tab
were installed, the code acts as VT LF.


  Cancels the enhanced printing, set by the code of SO.


  7. Translation format "denotes Code
FF. Printed contents of the buffer line and
Paper moves to the first line in the following format in 
accordance with its pre-set length. 


  8. "Carriage Return" denotes the code
CR. Printed contents of the buffer line, and
the print head returns to position
first character of next line. If the
No data buffer, the head does not move.


  9. "Advanced Printing" is denoted by SO or code sequence ESC 
SO. Prints of characters in one line with the increase their 
width in half. 


  10. "Padded printing" denotes
Code SI or sequence ESC SI.
Prints characters in one line mode
condensed print. When you enter the code in the SO
condensed print mode, the characters are printed compression 
and expansion. 


  11. Select Device Code designated DC1. Puts the printer into 
a state of readiness to receive data. 


  12. "Cancellation of compacted Print
denotes Code DC2. Cancels condensed printing mode is set by the 
code SI.



  13. "Cancellation of the device selection"
designated code DC3. Puts the printer
in the state are not ready to receive data.
Annihilated by all the data taken printer, except DC1.


  14. "Cancellation of the expanded Print
designated code DC4. Cancels
expanded printing set code
SO.


  15. "Cancellation of the line in the buffer memory designated 
code CAN. Void All the data previously placed in

string buffer.


  16. "The expansion of the control commands" denotes code ESC. 
Increases number of control commands.



  17. Delete previous character buffer "denotes the source 
culling. Removes prior to her character in the print buffer.

Does not extend to control characters.


  18. "The vertical density of 3,175 mm"
denotes the sequence ESC "0".
Sets the distance between rows
3,175 mm.


  19. "The vertical density of 2,54 mm"
denotes the sequence ESC "1".
Sets the distance between rows
2,54 mm.


  20. "The vertical density of 4,23 mm"
denotes the sequence ESC "2".
Sets the distance between rows
4,23 mm.


  21. "The distance between rows nx0, 118
mm "(0 <= n <= 255) denotes the sequence ESC" 3 "n. Sets the 
spacing between lines of equal nx0, 118 mm (Fold 1 / 3 the 
distance between the punches print needles). For n = 1 or n = 2 
is possible inaccurate presentation of paper and a 
superposition of two lines.



  22. "Extending the character set" is denoted by a sequence 
ESC "6". Allowed to print characters with decimal codes 128 ... 
159, 255. 


  23. "Cancellation of the expansion of recruitment
Symbol denotes the sequence
ESC "7." Forbidden to print characters with decimal codes 128 
... 159, 255. 


  24. "Disabling the sensor end of the Paper
denotes the sequence ESC "8."
Blocks the search for the end of the paper and allow
printer to print on (for example, the paper roll type).


  25. "Including signaling the end of the paper" denotes a 
sequence of ESC "9". Reverses the action of the management team

ESC "8."


  26. "The choice of characters character generator"
denotes the sequence ESC "%" m
0 (seen in normal print). When
m = 0 or 48 selectable character generator
from ROM. For m = 1 or 49 is selected from the character 
generator that is loaded by the user and a specific sequence of 
ESC "'". 


  27. "Writing is defined that" denotes a sequence of ESC "'" 0 
nm a p1 p2 ... p11 (0 <= n, m <= 255). Describes

constants p1 ... p11 configuration symbol
feed instead of characters having a position with the n to m 
code table. If you load a single character, then n = m. 
Constant "A" is an attribute of downloadable characters, which 
includes vertical and horizontal determinants described

symbol. Vertical determinant (MSB attribute) indicates the use 
of nine points in the vertical. When using the nine points the 
determinant of the vertical reset to zero. If the ninth the 
point is not used, vertical determinant is set to one. Example 
pictures and descriptions of the character "H" is shown in Fig. 
1. 


      Example images and descriptions SYMBOL "H" IN THE MATRIX


                                > The attribute "a"



                            8A 00 82 7C 82 10 00 10 82 7C 82 00


                             Fig. 1

Note. The command is executed, if ne
            print mode switch is on

            printer is set to

            "Normal density".


  28. "Installing the eight-graphics mode" denotes a sequence 
of ESC "*" m n1 n2 p1 p2 ... Relevance data bits in the 
eight-graphic mode pins the print head is shown in Fig. 2. 
Establishes eight-bit graphics print mode with the parameters 
given by m: 


  m = 0 or 48 - the normal density (60

               dots per inch (25.4 mm));

               normal speed (1080

               points / s);

  m = 1 or 49 - double density (120 then
               points per inch) reduced

               speed (540 points / s);

  m = 2 or 50 - double the density, the normal
               radial velocity;

  m = 3 or 51 - quadruple density

               (240 dots per inch); pony
               nounced velocity;

  m = 4 or 52 - graphics ELT1 (80 points on

               inch);

  m = 5 or 53 - graphics plotter

               (72 dots per inch);

  m = 6 or 54 - graphics ELT11 (90 points on

               inch);

  p1 p2 ... - The graphical information;

  n1 n2 ... - The volume of graphic information
               tion:

          n1 - balance graphics information
               deformation;

          n2 - number of total blocks (256

               bytes) of graphic information
               mation.

COMPLIANCE If the number of data bits

     In the eight-column graph
   Graphics mode virtually informaIGLAM PRINT HEAD function to 
determine 

                           as X, then n1 =

                           = X-256n2, and n2 =

      *  1-st byte

      *  2-byte


                  Fig. 3


  Sets devyatibitny graphic
print mode with normal and double density. Density is given by 
"a": 


  a = 0 - 60 dots per inch;

  a = 1 - 120 dpi;

  n1 n2 - the amount of graphic information

          (See ESC "*").


  Data m11, m12, m21, m22 ... mk1, mk2 -
graphics, where mk1 - is used to actuate the eight
upper needles and mk2 - the lower (ninth) needle
printhead.


  30. "Copying the contents of ROM to RAM"
denotes the sequence ESC ":"
NUL NUL NUL. Copies the character set KOI-8 in the area of 
​​downloadable character generator. Cancels all previous 
user-defined characters. 


  31. "Printing in the same direction" denotes a sequence of 
ESC "<". Blocks bidirectional printing one line. 


  32. "Set the top bit" denotes the sequence ESC ">". Causes
in character mode printing setup highest bit of all subsequent 
data bytes. 


  33. Reset MSB "denotes
sequence ESC "=". Causes a
character mode printing dumping older
bits of next byte of data.


  34. Cancel ESC ">" and ESC "=" denotes a sequence of ESC "#". 
Cancels the action sequences ESC ">" and ESC "=".



  35. "Printing with an underline" denotes a sequence of ESC 
"-" n (n = 0, 1, 48, 49). Sets or cancels underline mode (0 - 
OFF, 1 - ON). 


  36. "Setting up the printer to its original state" denotes 
the sequence ESC "@". Causes the printer to its original state, 
the contents of buffer is cleared. 


  37. "Selecting the print mode" is denoted by
sequence ESC "!" n (0 <= n <= 255).
Changes the print modes displayed in
Table. 1, the appointment of bit constant "n" in
sequences are shown in Table. 2.


                                 Table 1

     Assigning Parameters "n" TEAM

          "Select Print Mode"

n Adv Double-distinguished-sealing with a step

   sured lennaya nennaya 2,117 mm

 0
 1 **
 2
 3 **
 4 **
 5 **
 6 **
 7 ** **
 8 **
 9 ** **
10 **
11 ** **
12 **
13 ** **
14 **
15 ** **
16 **
17 ** **
18 **
19 ** **
20 ** **
21 ** **
22 ** **
23 ** **
24 ** **
25 ** ** **
26 ** **
27 ** ** **
28 ** **
29 ** ** **
30 ** **
31 ** ** **
32 **
33 ** **
34 **
35 ** **
36 ** **
37 ** **
38 ** **
39 ** **
40 ** **
41 ** ** **
42 ** **
43 ** ** **
44 ** **
45 ** ** **
46 ** **
47 ** ** **
48 ** **
49 ** ** **
50 ** **
51 ** ** **
52 ** ** **
53 ** ** **
54 ** ** **
55 ** ** **
56 ** ** **
57 ** ** ** **
58 ** ** **
59 ** ** ** **
60 ** ** **
61 ** ** ** **
62 ** ** **
63 ** ** ** **



                                                       Table 3

   PURPOSE BIT CONSTANT "n" COMMAND "Select Print Mode"

Bit 7 6 5 4 3 2 1 0

 1 Always Double-Adv distinguished compaction Always Step

      0 sured printing LIMITED 0 2.117 mm

            print print print

 Step 0

                                                      2,54 mm



  38. "The distance between rows nx0, 353
mm "denotes a sequence of ESC
"A" n (0 <= n <= 85). Set line spacing to equal nx0, 353 mm.


  39. "Setting the vertical tabulostopov" denotes the sequence
ESC "B" n1 ... nk NUL (1 <= k <= 32). Sets up to 32 
tabulostopov in the specified format. 


  40. "Set the length of format strings"
denotes the sequence ESC "C" n
(1 <= n <= 125). Sets the length of the format in
lines. The length of the format is stored in memory
printer as an absolute value equal to the product of the 
current interval between the lines of a specified number of 
lines. Therefore, this length format after installation does 
not depend on changes spacing between lines.



  41. "Setting the horizontal tabulostopov" denotes the sequence
ESC "D" n1 ... nk NUL (1 <= n <= length of the field,
1 <= k <= 32). Sets horizontal tab positions. When you change 
the width of the character does not change the position of the 
horizontal tab.



  42. "Set in bold print" denotes a sequence of ESC
"E". Causes subsequent printing characters
in bold.


  43. "Cancellation of the regime in bold print" denotes a 
sequence of ESC "F". Cancels the printing in bold. 


  44. "Selection of a double printing" denotes
sequence ESC "G". Causes
double print follow-up data. In the double printing after 
printing one line of paper is moving at 0,118 mm (1 / 215 
inches) and is re-printing. 


  45. "Cancellation of double printing" denotes a sequence of 
ESC "H". Cancels the double printing. 


  46. "Quick Print mode" denotes a sequence of ESC "i" n. Sets 
or resets the mode of rapid printing depending on the "n":



  n = 0 or 48 - normal mode;

  n = 1 or 49 - faster printing.


  47. "Moving paper nx0, 118 mm
(0 <= n <= 255) "denotes a sequence of ESC" J "n. Moves the 
paper to nx0, 118 mm.



  48. "Return of paper on nx0, 188 mm" denotes a sequence of 
ESC "j" n (0 <= n <= 255). Paper is fed back to

nx0, 118 mm.


  49. "Graphic print mode with a normal density" denotes a 
sequence of ESC "K" n1 n2 p1 p2 ... Establishes eight-bit 
graphics mode printing with normal density. Values

n1, n2, p1, p2 are defined as in the ESC "*".


  50. "Graphic print mode with a double
density "denotes a sequence of ESC" L "n1 n2 p1 p2 ... Set 
eight-bit graphics mode printing double density. The values 
​​n1, n2, p1, p2 are defined as in the ESC "*".



  51. "Setting the horizontal density
Print 2,117 mm (1 / 12 inch) "denotes
sequence ESC "M". Sets
normal print mode with a step of 2,117 mm.


  52. "Skipping rebate" denotes a sequence of ESC "N" n (1 <= n 
<= 125). Determines the number of rows (n), which follows skip 
when moving the paper in the bottom of each format, to move to

the first line of the new format.


  If the switch is auto-translation strings
by a carriage return is switched on, then blocked printing
distance of 25,4 mm from the end of the paper.


  Function persists as long as
will change the length of the sequence format ESC "C" n.


  53. Reset check rebate "is denoted by
sequence ESC "O". Cancels
action commands ESC "N" n.


  54. "Setting the horizontal density
Print with step 2,54 mm (1 / 10 inch) "denotes a sequence of 
ESC" P ". Sets the horizontal print density in increments of 
2,54 mm. 


  55. "Set the maximum line length" denotes the sequence ESC
"Q" n (1 <= n <= 255). Sets the maximum string length (or the 
right border print margins) depending on the number of

print columns (n) and introduced at the beginning
line. "N" depends on the set print mode.


  56. "The choice of standard character sets"
denotes the sequence ESC "R"
n. All data will be printed on a set of codes
table specified by the parameter "n":


  n = 10 - code table KOI-8

         GOST 19768-74;

  n = 11 - code table KOI-7N1

         GOST 27463-74;

  n = 12 - code table KOI-7N2

         GOST 27463-87;

  n = 13 - combined code table;

  n = 14 - code table PC;

  n = 15 - additional code table

         PC.


  57. Mode index "denoted
sequence ESC "S" n. All data
introduced as a degree or as an index:


  n = 0 or 48 - the upper index

               (Exponentiation);

  n = 1 or 49 - the lower index. Four
               small signs of the index can

               reproduced accurately.


  58. Reset mode index "denotes a sequence of ESC" T ". Cancels 
the index. 


  59. "The direction of printing" denotes a sequence of ESC "V" 
n. Determines the direction of printing: 


  n = 0 or 48 - printing in both directions
               tions;

  n = 1 or 49 - remain in the bottom of the UNE DATA
               governance. Acts on

               all subsequent lines.


  60. "Enable / disable advanced printing"
denotes the sequence ESC "W"
n. Sets or clears extended mode printing:


  n = 0 or 48 - mode for an extended Print

               canceled;

  n = 1 or 49 - all data will be printed as a result
               regime extended printing.


  61. "Eight-bit graphics mode
double the density and velocity "denotes
sequence ESC "Y" n1 n2 p1 p2 ...
Provides eight-bit graphics mode printing with dual-density 
double speed. The values ​​n1, n2, p1, p2 are defined as in the 
ESC "*". 


  62. "Eight-bit graphics mode
quad density "denotes a sequence of ESC" Z "n1 n2 p1 p2 ...
Establishes eight-bit graphics mode printing quadruple density. 
The values ​​n1, n2, p1, p2 are defined as in ESC "*".



  63. "Setting the left of the free field"
denotes the sequence ESC "l"
n. Sets the left a free field width (n) character (0 <= n <= 
255). 


  64. "Printing with high quality"
denotes the sequence ESC "x"
n. Sets or resets the print mode with high quality:


  n = 0 or 48 - canceled;

  n = 1 or 49 - is set.


  65. "Selection of the vertical track" denotes a sequence of 
ESC "/" n. Selects one of the vertical tracks, a value of "n" 
(0 <= n <= 7). 


  However, all these listed codes can be described in the 
passport for your printer, even though my printer passport was 
extremely old, so I had to use another. 


        __________________________







Other articles:

Ot edition - A new newspaper in the BBS - XA-Xafon.

Lit.stranichka - Diary. Don loud. (Continued)

Macros - Programming language MACROS-text editor, IS-Edit.

Exchange of experience - Control characters and sequence of control characters in the standard printers Epson.

Ads - Advertisements and announcements ...

List BBS - A list of BBS. Opened a new Creative Station.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Entry - a new newspaper.
thoughts on the topic - On the "treacherous" attack on the USSR, Germany, 06/22/1941: By the day Fuhrer.

В этот день...   4 May