[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

166.0. "Panasonic KXP-3131 question" by APOLLO::BERKSON () Mon Nov 10 1986 14:22

    I have been trying without any luck to get the printer to change
    modes by sending it the ESC and other characters from BASIC using
    LPRINT. I'd like to put it in shadow mode which is something like:
    LPRINT CHR$(27)+"[6"+CHR$(34)+"z"
    Scribble seems to send the right stuff because the printer does
    underline and bold when Scribble tells it to. Unfortunately, Scribble
    can't send the codes for some of the different modes I would like
    to use. Any help would be appreciated. Thanks.
    
       mitch
T.RTitleUserPersonal
Name
DateLines
166.1Can't use PRT:NOVA::ARNOLDMon Nov 10 1986 15:199
    I believe the LPRINT command uses the PRT: device. You cannot
    send ESC characters through this device, it just throws them
    away. However, you can send any character codes you want
    through either the SER: (serial) or PAR: (parallel) devices.
    Use the OPEN command in BASIC to open one of these devices
    for output, then do a PRINT to the channel specified in
    the open command.
                              
    -Jeff
166.2Could be messyAPOLLO::BERKSONMon Nov 10 1986 16:055
    I was hoping that I would be able to send the commands through
    Preferences which probably means sending them through PRT:
    I wanted to send the ESC character to Prefernces and have it deal
    with the printer. Isn't it possible to do that somehow without sending
    raw stuff out to the printer?
166.3OPEN!AUTHOR::MACDONALDCUP/MLMon Nov 10 1986 16:217
    What you have to do is OPEN PRT: as you would a sequential file
    for output. Then do a PRINT#n,[your printer control string here]
    where n is the file number you assigned to PRT: in the OPEN statement.
    
    That's the only way to do it that I know of. LPRINT sure won't work.
    
    Paul
166.4Ignore Your Printer's ManualTLE::RMEYERSRandy MeyersMon Nov 10 1986 19:2738
I think that your problem is that the PRT: device handles its own
escape sequence processing.

I don't have any documentation in front of me so I am going to
have to be sketchy.

The PRT: device has a lot of escape sequences built into it.  You
will find a list somewhere in the documentation.  When the PRT:
device receives one of its escape sequences, it converts the escape
sequence to whatever commands necessary to the physical printer
to accomplish the indicated function.  For example, assume that
the escape sequence for the PRT: device to do a reverse linefeed
is $[A.  Assume in preferences that you selected the FOOwriter-100
as your printer, and that FOOwriters do a reverse linefeed when
you send a $(Z.  Then, you should write all your programs to 
do send an $[A when they want to do a reverse linefeed.  The
PRT: driver converts the $[A to a $(Z before sending it to
FOOwriter.

The problem is that I don't know what happens when you send an
escape sequence that the PRT: device doesn't support.  It could
very well eat it.  The other danger is that the escape sequence
for shadow printing for your printer could be the sequence for
clear margins for the PRT: device.

Try and find the table that lists the escape sequences supported
by the PRT: device.  It may include shadow printing.  If so use
the PRT: sequence, not the sequence in your printer's manual.  If
the PRT: doesn't have some feature that you want, you will have
to open either SER: or PAR: directly in order to by-pass PRT:'s
escape processing.  I seem to remember that the PRT: sequences
matched fairly closely to ANSI standard sequences.  If the same is
true of your printer, then you will not have to change very
much of your program.

By the way, software houses for the Amiga love the PRT: escape sequence
processing.  Their programs get support for a large number of printers
without them having to do any work.
166.5Try ThisAUTHOR::MACDONALDCUP/MLTue Nov 11 1986 01:4920
    Here's the info you were looking for - now that I have it in front
    of me:
    
    OPEN "PRT:" FOR OUTPUT AS #4
    PRINT#4,CHR$927)"#1";CHR$(27)"#5";CHR$(27)"[0;80S"
    CLOSE#4
    
    So, just open up the printer device, and output whatever printer
    codes you wish using the PRINT# command. Then close the device.
    That's how you do it in AmigaBasic.
    
    From CLI you can do a similar thing using the COPY command:
    
    COPY * TO PRT:
    
    Next, enter your printer control <ESC> sequences and terminate with
    a CTRL-\.
    
    
    Paul
166.6Another tryTLE::RMEYERSRandy MeyersTue Nov 11 1986 07:1328
I may not have been addressing your problem in my .4 reply.  I thought that
your problem might have been that you didn't know of the escape sequence 
handling of the PRT: device, and that you might have gotten the escape
sequence that you were using from your printer's manual, not the PRT:
documentation.  I apologize if my .4 reply bored you with lots of information
you already knew.

Anyway, I just checked my ROM Kernal Manual and your .0 message does
describe the correct escape sequence for shadow printing on.

Furthermore, the Basic manual does claim that LPRINT writes its output
to the PRT: device, and PRT: does handle the escape sequence processing.

So, I don't see why things don't work with LPRINT.  I don't understand
why explicitly opening PRT: and using PRINT # should have any different
results (unless of course the BASIC manual is wrong about LPRINT using
the PRT: device instead of the PAR: device, say).

There is something that could be causing your problem that would allow
all the documentation to be right.  Let me ask you a question: What
printer handler are you using?  I just looked at preferences, and I didn't
see your printer listed.  Are you using a handler that you got from
someone else, or are you using a handler that is for a printer similar
to yours?  It is possible that the printer handler you are using doesn't
implement shadow mode.  (I remember reading recently a posting to
net.micro.amiga by the author of the printer drivers for the Amiga.  He
said that if a printer didn't have a particular feature, that its handler
would quietly ignore the escape sequence for that feature.)
166.7LPT: doesn't support ISO codesAUTHOR::MACDONALDCUP/MLTue Nov 11 1986 11:408
    I believe LPRINT opens the LPT: device. The LPT: device does not
    support the ISO printer codes. For a list of the codes and an 
    explanation of the differences between PRT: and LPT:, see the next
    to last issue of Amiga World at the very back. There is some good
    info there. If you do not have a copy, send me your mailstop and
    I will photocopy it for you.
    
    Paul
166.8Thanks. Another questionAPOLLO::BERKSONTue Nov 11 1986 12:0723
    Thanks for the help. The driver I set in Preferences is Diablo 630
    which is what this printer uses. Both the printer and the driver
    (according to the Amiga manual) support shadow printing. I was able
    to turn on the shadow print by opening PAR: directly as was suggested
    in a previous reply, but I'd rather go through Preferences since
    that's what it's there for. LPRINTing the escape sequence doesn't
    work. Maybe because of what was suggested in a previous note which
    I think I read something about in the AmigaBasic manual - that LPRINT
    uses LPT: (or LPT1:?).
    
    I have another somewhat related question. In Scribble there is a
    provision in the dot commands for making your own dot command in
    the form .#n/m=%iii where n is the command number and iii is the
    escape code. This enables the user to put in custom escape codes
    (like to turn on shadow printing). If I could get this to work then
    the Basic question wouldn't really be an issue even though I would
    still like to find out. 
    
    For -.1 my mailstop is SHR1-3/011. I'd like to see that article.
    Thanks.
    
        mitch
    
166.9ANT::SMCAFEESteve McAfeeTue Nov 11 1986 12:5711
    
    I may be wrong but I think Scribble has a dot command that allows
    you to insert a character of a given ascii value.  This might be
    the way to turn shadow mode on and off.  The ascii value for ESC
    is 27.  You could then follow this with the rest of the text in
    the sequence.  I'll check the documentation tonight when I get
    home if I remember.
    
    Good luck,
    
    Steve McAfee
166.10I think I tried thatAPOLLO::BERKSONTue Nov 11 1986 13:1815
    Yes. This is what I was thinking of. To use ESC the dot command would
    be .#1/0=%27 
    
    I'm not sure whether the rest of the sequence should be or can be
    part of this same string. It seems like it would have to be. Otherwise
    how would Scribble know where the escape sequence started and text
    began? Anyway, I tried a bunch of variations on this - non of which
    seemed to change the printer mode.
    
    My understanding of the dot command above is this. The 1 after the
    number sign is the command identification number to be used after
    ^G. The 0 after the / means the code is not printable and the %27
    means ASCII 27 which is ESC. 
    
      mitch
166.11BASIC Doc BugTLE::RMEYERSRandy MeyersWed Nov 12 1986 01:1013
Re .7:

I looked up the recommended article (Amiga World, September/October issue,
pages 110-111), and the author of .7 is indeed correct.

The problem seems to be a bug in the BASIC documentation. The BASIC manual
says on page 5-2 that LPT1: "is the same as the PRT: device."   The Amiga
world article points out that this isn't true: LPT1: does not handle the
PRT: escape sequences.

Note that you do not have to use PAR: to send the escape sequences to the
printer--You can do an explicit open on PRT: and thus get the advantage of
the device independent escape sequences.
166.12Can I assign?APOLLO::BERKSONWed Nov 12 1986 14:503
    I'll try opening PRT: directly. Is there a way from CLI or BASIC
    to assign LPT1: to PRT: or something like that so that the LPRINT
    statements will be routed through PRT:?
166.13Why Use LPRINT?????AUTHOR::MACDONALDCUP/MLWed Nov 12 1986 16:474
    Praytell, why do you insist on using LPRINT? Why not use PRINT#n
    where n is the number assigned to the OPENed PRT: device.
    
    Paul
166.14OKAPOLLO::BERKSONWed Nov 12 1986 17:193
    You're right. If the PRINT# works it won't make a difference.
    
      mitch
166.15Might as well try itTLE::RMEYERSRandy MeyersWed Nov 12 1986 21:503
It is worth trying "ASSIGN LPT1: PTR:" BEFORE starting Basic.  Of course,
the folks at Microsoft might ignore device assignments for their cutsy
"transportable" device names.
166.16You give up to easilyTLE::RMEYERSRandy MeyersWed Nov 12 1986 21:586
You folks have a bad attitude.  The spirit of hacking is being able make
your machine jump through hoops.

You should try all possible combinations and report back here.

Very :-).
166.17Scribble! should work.ANT::SMCAFEESteve McAfeeMon Nov 17 1986 00:1131
    
    Mitch,
    
    Sorry I took so long to try this in Scribble!  Anyhow this is how
    I got the sequence stuff to work...
    
    (unfortunately my printer doesn't have shadow mode, so I just did
    it with underline)
    
    At top of file:
    
    .#0/0=%27[4m
    .#1/0=%27[24m
    
    (The 0 after the / tells scribble that you are not defining a
    printable character, so don't set aside any space for it during
    justification/wrap.)
    
    Now when I place a "CTRL-G" 0 in my file it turns on Underline.
    When I place a "CTRL-G 1" in my file it turns off underline.
    
    For shadow mode use %27[6"z and %27[5"z.  If thids doesn't work
    then the printer driver you are using probably doesn't support the
    sequence.
                
    Good Luck,
    
    Steve McAfee
    
    
                             
166.18It works - 1 more questionAPOLLO::BERKSONTue Nov 18 1986 11:4712
    Thanks Steve. I successfully used the ALT-G commands to turn on
    the shadow printing and some other stuff. I thought I tried that
    before, but I guess not. This has opened new vistas to me and has
    led to another question specific to the 3131 printer. 
    
    I turned on proportional spacing and full justification using the
    Scribble ALT-G commands to get the printer to do those things. They
    almost work. Proportional spacing is on but some lines are not aligned
    on the right margin. They miss by about 2 characters. Any help on
    this? Thanks.
    
       mitch