#Amy to printer route?
6 messages in this thread
I have never quite understood or seen clearly explained just how the amy
communicates with a printer. Specifically, when from BASIC I send the line:
LPRINT chr$(27);chr$(77);chr$(15)
I expect an ESC M to be sent to the printer. In the case of my PowerType in
PM mode, that should set the left margin to the value which follows, in this
case 15.
Now, my driver in this case is the Epson Jx-80, since that is what Okidata
recommended for this printer. The escape code, however, seems to get
intercepted en route. If I just send the chr$ 27, I get a blank linefeed.
Can anyone explain in some detail just what the route from keyboard to printer
is? Particularly, does the Amy intercept Escape codes? Why?
Also, it dawned on me this morning that Superscript for the 64 (and other
wps) had a system where the user supplied a TEXT file to control printer
features. That was tricky, but surely less tricky than having us supply a
PROGRAM–hence the need for printer driver generators. I am wondering why
Commodore did not implement a system whereby printer drivers could be text
files. Surely they would have been easier to fix in that case?
Still at it.
// Jim
Jim,
In the case of LPRINT, I think it is Amigabasic that intercepts the ESC
character. I'm not totally sure though. If you try sendint the characters
directly to PAR: you should get them at the printer.
The Amiga's implementation of printer drivers is really quite elegant, and
there is a good reason that they are not implemented as text files. One could
not hope to do translations of anything bu the simplest printer functions using
a text file translator. A printer driver consists of both translation tables
and actual, executable code so that the driver can handle any, and I mean _any_
printer's requirements.
When you send a file to PAR: the parallel port receives the characters just
as they are sent, but when you send it to PRT:, the printer driver becomes the
interface/translator between the data and the parallel port. Any character
strings that begin with a special character are translated according to the
driver itself, through means of a table. This table can substitute a single
character, substitute multiple characters, or even jump into a rotuine that can
di virtually any complex function the printer might require.
If you look at the codes that are required by the printer driver for each
function, you will see what needs to be sent in order to perform that function.
The required string will be the same for any printer that supports the
function.
In Amigabasic, try this: Send the codes that your printer requires for
setting the left margin, but send it to PAR: This will tell you if your
printer does indeed take this as the left margin setting. (you can then send a
plain text file to PAR: with a TYPE FileName PAR: to test it). If the printer
does not set left margins, then there is something amiss with the printer or
the documentation. After determining that the printer sets left margin, try
(again from Basic) sending the appropriate code for the standard Amiga <set
left margin> to PRT:. If it does not set it, then the translation is wrong.
Good luck.
Regards, Larry.
Thanks Larry. I am virtually certain that the code given in the PowerType
manual is fine. It worked from C64 Basic with no problem. Maybe I can use this
PAR: idea. I will try it out.
BTW–I got Cygned ed demo yesterday. Wow! It looks very good. I did crash
the system with it once (or hung it seemed) but I think that was cause I was
fooling with macros and hadn't loaded any and may have gotten into an endless
loop. The one thing I missed was that you cannot enter a special code in the
search field. You can enter ESC codes in the text but you cannot search for
them.
I read about another editor called AEDIT in Amigan magazine. It allows that
feature. Know anything else about it? Meantime, as I learn more about
WordPerfect it looks like it can do most (but not all) of what I want done.
// Jim
Jim,
CygnuEd has gone through a few revisions since the demo was posted. It now
does allowESC and other CTRL characters in the search/replace strings. There
are also far fewer crashes (approximately 0) in normal use. I know very little
about AEdit, except what I've read in Amigans, A&P.
Regards, Larry.
Jim
Note that AmigaBasic's LPRINT does not carry out any ISO printer command codes.
You have to use the OPEN and PRINT # commands. Example:
OPEN "PRT:" FOR OUTPUT AS #2
PRINT #2 CHR$(27);CHR$(M);CHR$(15);
and when your done with the printer CLOSE #2 Hope this is some help.
Hayward,
Thanks for the tip about BASIC and printer codes. I will try what you suggest
to see if I can pass codes via BASIC. Andy Finkel (I think it was) mentioned
that the printers drivers do not really send the margin setting command but
work from an offset.
I am now in touch with someone who makes drivers professionally, so I may have
a solution pretty soon. (Dum spiro spero.) The interest seems to be shifting
toward 24 pin printers, though.
Thanks again.
// Jim