Epson Graphics

 BBS: Inland Empire Archive
Date: 03-07-93 (15:35)             Number: 326
From: DIK COATES                   Refer#: NONE
  To: DIRK RACKLEY                  Recvd: NO  
Subj: Epson Graphics                 Conf: (2) Quik_Bas
>   Looking for some code or someone familiar with epson compatible printer
>proramming. I have written a program that makes modifications to NASA
You should try to obtain copies of the printer manuals... but here are some
basics...  For an FX85/185... common old type

the pin values are as listed below:

128  o    x   o   x     To have the printer print a dot with the top pin
 64  o    o   o   o     (EX 1), you would instruct it to print the value
 32  o    o   o   o     128, similarly for it to print the middle two pins
 16  o    o   x   o     (EX 2), you would have to instruct it to print
  8  o    o   x   o     the value 24 (16 + 8).  This latter instruction
  4  o    o   o   x     would cause pins 16 and 8 to fire.  Instructing it
  2  o    o   o   x     to fire the pins shown in EX 3 you would issue the
  1  o    o   o   o     instruction 134.

         EX1 EX2 EX3

The number of printer head columns is based on the printing mode, and must
be declared.  The various modes are as follows:

Mode   Density   Code Using  Description       Available in
                 <ESC> Key                       IBM Mode
  0    single        K       60/480/816            Yes
  1    LS Dble       L       120/960/1632          Yes
  2    HS Dble       Y       120/960/1632          Yes
  3    Quad          Z       240/1920/3264         Yes
  4    CRTI          na      80/640/1088            No
  5    Plotr         na      72/576/979             No
  6    CRTII         na      90/720/1224            No
  7    DDP           na      144/1152/1958          No

Note:  LS and HS denotes low speed and high speed, respectively.  Quad
       is quadruple density.  Plotr is  one-to-one and is used for
       plotting.  DDP is dual-density plotter and has twice the density
       of mode 5. na- not available

       Description is given as the following:
       n1/n2/n3, where n1 is dots per inch
                       n2 is dots per 8 inch line
                       n3 is dots per 13.6 inch line

The number of columns is declared using one of the following:
  LPRINT mode n1 n2
  LPRINT <ESC>mode n1 n2

The numbers n1 and n2 represent the number of columns reserved for
graphics and must be less than those specified for the mode.  If the
number of graphics columns is defined by ngraphcol%, then, the
number n1 is the value obtained by the function ngraphcol% MOD 256, and
the value n2 is obtained by the function ngraphcol% \ 256 (int div).
If n2 is zero, it must be declared as 0.

The line spacing that the printer advances horizontally is declared by
using <ESC>"A".  This converts the line spacing from the number of pins
used for graphics (8) to the number of pins on the print head (9).  The
typical printer has 6 lines per inch, and 12 dot spaces per line (3 are
used for spaces between lines). 6 lines * 12 = 72 horizontal dot spaces
per inch.  <ESC>"A" is used as follows:

  LPRINT <ESC>"A" n1 where n1 is the number of spaces (<72) per the
                     printer advances with each CR-LF.

So much for the basics of Epson 9 pin printers...

To print something in graphics, the following pseudo code must be used,
the CHR$(27) is the same as <ESC>:

  WIDTH LPRINT 255                       'disable CR-LF sequence
  LPRINT CHR$(27) "A" CHR$(7)            'line spacing set to 7/72 inches
  LPRINT CHR$(27) "K" CHR$(120) CHR$(2); 'mode 0, 632 columns -->NOTE ';'

  LPRINT CHR$(n1) CHR$(n2) CHR$(n3) CHR$(n4) CHR$(n5) CHR$(n6);   'data

  LPRINT CHR$(27) "@"                    'this resets the printer

Note:  the n1, n2, n3,... represent the pin patterns noted above.  A ';'
       must be added because the mode and number of columns declaration
       must be made for each new line.

Since you've been tryin' it for a year, an extra couple of weeks to dabble
with the above won't make much difference!

With a 24 pin printer, the procedure is similar to the above, except that
the 24 pins are broken into 3 groups of 8 pins... the same pin numbering
method is used and the data passed represents the pins for the top 8,
mid 8, and bottom 8...

The modes for an LQ1050 (I assume other 24 pin Epson's are similar) are as

Mode   Density   Num.of Pins  Horiz.Density
  0    single        8            60
  1    double        8           120
  2    HS Dble       8           120
  3    Quad          8           240
  4    CRTI          8            80
  6    CRTII         8            90
 32    single       24            60
 33    double       24           120
 38    CRTIII       24            90
 39    triple       24           180
 40    hex          24           360

and the method of declaring the number of graphics columns is as follows:
  LPRINT CHR$(27) "*" CHR$(mode) CHR$(n1) CHR$(n2) data....;

Hoping the above will get you started... thought I could do it in a couple
of lines, but nearly a book... suggest that you review the manual that came
with the printer, or try to scrounge one!  Will leave the conversion of
data to printer info to you... or others on the board...

>will be pumped through Dik Coats curve routine for intermediate points.
>( Thanks Dik hope you dont mind if I slice and dice ).

If I did, wouldn't have posted it!  Good luck, Dik, Oshawa, Canada

... Backup aborted:  Please remove disk #92 and start over.
___ Blue Wave/QWK v2.10

--- Maximus 2.01wb
 * Origin: Durham Systems (ONLINE!) (1:229/110)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET