From: francini@narfvx.enet.dec.com (John Francini)
Newsgroups: comp.os.vms
Subject: Re: HP DeskJet on VMS 5.4-2 extra page eject/form feed
Date: 24 Jan 93 21:53:03 GMT
Organization: Digital Equipment Corporation, Littleton, MA


In article <1993Jan22.180051.17983@mksol.dseg.ti.com>, pyron@skndiv.dseg.ti.com (Dillon Pyron) writes...
> 
>In article <01GTR0REM8CG91W9M7@admin.ripon.edu>, SCHANG@ADMIN.RIPON.EDU ("Jeff Schang ") writes:
>>I'm setting up a DeskJet 500 to run on our VAXStation 3100 (5.4-2) and I am
>>having one small problem.  The printer and queue are working perfectly 
>>except for the fact that the DeskJet ejects ONE blank page BEFORE every 
>>print job.  The DeskJet will eject TWO blank pages before the first job 
>>that is printed after the queue or the printer is reset.
> 
>Well since the HP DJ500 on my (cough, my wife's) PC doesn't exhibit this, I'd
>tend to look at the VAX.
> 
>>
>>I have checked the SET QUEUE command for queue characteristics and I
>>have checked the DeskJet book for an answer, but I haven't been able to
>>figure out the problem.  I have tried setting the queue to default=nofeed
>>and taking out the separate qualifier, but I get the same result.
>>
>>I set the terminal up as an LQP02 which is directly connected to the serial 
>>port on the VAXStation, hence no LAT.
>>
>>I have tried setting the terminal to an LA100 and LN03, which yields
>>the same result as well.
>>
>>Has anyone tried a similar setup, and if so, do you have any ideas?  Is 
>>there a queue qualifier I'm missing, or a symbiont I should be using?
>>
>>I have included the terminal config and queue config below.  I created the 
>>HP500CTL device control library from scratch using the DeskJet manual and 
>>have had no problem printing with various forms aside from the extra eject.
>>Thanks for any help.
>>
>>+-------------------------------------------------------------------+
>>| Jeff Schang	Systems Manager/Postmaster   schang@admin.ripon.edu |
>>| Ripon College   PO Box 248   Ripon, WI 54971  414/748-8713        |
>>+-------------------------------------------------------------------+
>>
>>
>>Terminal queue CENLETTER, on ARIEL::CENLQP, mounted form NARROW (stock=REGULAR)
>>    /BASE_PRIORITY=4 /DEFAULT=(FEED,FORM=NORMAL (stock=REGULAR)) 
>>    /LIBRARY=HP500CTL Lowercase /OWNER=[SYSTEM] /PROTECTION=(S:E,O:D,
>>    G:R,W:W) /RETAIN=ERROR /SEPARATE=(RESET=(RESET))
>>
>>
>>
>>Form name                            Number   Description
>>---------                            ------   -----------
>>NARROW (stock=REGULAR)                   19   13 pitch draft
>>    /LENGTH=66 /SETUP=(DRAFT,CPI13,VPI6) /STOCK=REGULAR /TRUNCATE /WIDTH=200
>                        ^^^^^^^^^^^^^^^^
>What do these do?  Is there any chance that any of these escape sequences
>contains anything that might cause a form feed.  I'm not certain, but I believe
>the DJ will do a formfeed if its buffer gets too full.  Normally not a problem
>as it is quite big, but some escape sequences can be enormous!
> 

Without actually seeing the contents of your setup modules it's somewhat
hard to know for sure, but there _are_ a couple of things everyone trying
to run an non-ANSI printer should know about VMS, the print symbiont, and
forming setup and reset modules.

0. The page eject at initial queue startup can not be eliminated without
code changes to the symbiont. Period.  The print symbiont was designed back
in the days of real tractor-fed line printers, and since at startup it had
no idea where the printer was positioned, it always assumed the worst and
sent a formfeed before starting the first job.  Most people didn't notice
or care, since your typical full-size line printer required three or four
pages ANYWAY to be wasted just to get the paper completely loaded.
(Typically, the printer's stacker was about three sheets away from the
print line.)

1. The symbiont (stupidly, in my opinion) tries to parse any control
sequences it sees in setup and reset modules to determine what effect they
may have on the paper position.  However, its ideas about valid escape
sequences haven't changed since the early 80s (and it knows nothing about
non-ANSI devices like your HP).  So, much of the time, it gets it wrong and
thinks the escape sequences moved the printer away from line 1 column 1 and
throws a page.

2. The symbiont ignores any control sequences that are imbedded inside the
escape sequences <ESC>P and <ESC>\.  [This was originally done to handle
ReGIS sequences, which are always bracketed by these two characters.]  So,
you can put your DeskJet control sequences inside <ESC>P and <ESC>\
delimiters.  NOTE WELL:  Do NOT include ANY carriage returns, formfeeds, or
comments in the sequences, or you will get an unwanted blank page.

These should solve most problems.  [There are a few pathological situations
that require stronger measures, but that is a subject for another post.]

John Francini
Engineer, PATHWORKS Server Development Group
Digital Equipment Corporation
Littleton, MA