fitz@ai.mit.edu (David Fitzgerald) (06/28/89)
i am trying to connect a hp plotter 7475A to my sun 3/60 and run it through a printer daemon on /dev/ttya i.e. lpr <plotter_file> the plotter file is straight ascii text file and i have no problems plotting about one page of commands. however the plotters error light flashes through the entire process and aborts after a small portion of a larger file. i believe the problem lies with the printcap entry but i could be wrong. here is my printcap entry: hpp:\ :lp=/dev/ttya:sd=/usr/spool/hpp:\ :br#9600:fc#0177777:fs#0177413:tr=\f: i would appreciate any information regarding the correct printcap entry or other aspect of the hp plotter that i should know about. thanks in advance dave -
gbarker%mph.sm.ucl.ac.uk@nsfnet-relay.ac.uk (Gareth Barker) (07/05/89)
I think your problem may be with flow control - the first buffer gets sent properly and the HP then tries to use RTS/CST to tell the sun to wait a bit. The sun ignores this and then ... The way out is to tell the HP to use XON/XOFF flow control (and also apply YAPT 5.??? if your running SunOs 4.0.1). Below are our printcap entry and two simple filters that do what is required for our Roland plotter, which is supposed to be a HP clone - you may need to check the HP manual to make sure that all the escape codes are correct. (Thanks to Brian Utterback for the original filters based are based on). plt|plotter|dxy990:\ :sh:\ :lp=/dev/ttya:\ :sd=/var/spool/pltd:\ :lf=/var/adm/pltd-errs:\ :af=/var/adm/pltd-acct:\ :br#9600:\ :fc#0177777:\ :fs#0000001:\ :if=/local/filters/plotter_iffil:\ :xc#0177777: :xs#0000040: # ^^^^^^^^ make sure this is a <tab> #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: Makefile plotter_iffil.c plotter_offil.c # Wrapped by gareth@titan on Wed Jul 5 11:48:29 1989 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Makefile'\" else echo shar: Extracting \"'Makefile'\" \(109 characters\) sed "s/^X//" >'Makefile' <<'END_OF_FILE' XCFLAGS = -O XOBJS = plotter_offil plotter_iffil X Xinstall : $(OBJS) X strip $(OBJS) X mv $(OBJS) /local/filters END_OF_FILE if test 109 -ne `wc -c <'Makefile'`; then echo shar: \"'Makefile'\" unpacked with wrong size! fi chmod +x 'Makefile' # end of 'Makefile' fi if test -f 'plotter_iffil.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'plotter_iffil.c'\" else echo shar: Extracting \"'plotter_iffil.c'\" \(1761 characters\) sed "s/^X//" >'plotter_iffil.c' <<'END_OF_FILE' X/* X iffil, a printcap filter for Roland DXY-990 plotter/ HP 7475 plotter X X Written by Brian Utterback X December 1987 X X Modified GJB 25/1/89 X*/ X X#include <stdio.h> Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X int c,atoi(); X int contr,width,length; X int nlines=0,npages=2; X FILE *fopen(), *fp; X char *cp,*indent; X char *logi,*host,*actf; X X while (--argc) { X if (*(cp = *++argv) == '-' ) { X switch (cp[1]) { X case 'w': X width = atoi(&cp[2]); X break; X X case 'l': X length = atoi(&cp[2]); X break; X X case 'c': X contr++; X break; X X case 'i': X indent = &cp[2]; X break; X X case 'n': X logi = argv[1]; X break; X X case 'h': X host = argv[1]; X actf = argv[2]; X break; X } X } X }; X X X X printf("\033.M0;0;0;10;0;0:"); /* Reset the printer */ X printf("\033.I256;0;17:"); /* Set buffer size and XON char */ X printf("\033.N;19:"); /* Set XOFF char */ X printf("\033.@;0:"); /* Turn off DTR ??? */ X X X while ( (c = getchar()) != EOF) { X if ( c == '\n' || c == '\r' ) nlines++; X if ( c == '\f' || nlines > length) { X nlines = 0; X npages++; X }; X putchar(c); X }; X if (access(actf, 02) >= 0 && (fp = fopen(actf,"a")) != NULL ) { X fprintf(fp,"%7.2f\t%s:%s\n",(float)npages,host,logi); X fclose(fp); X } else { X fprintf(stderr, X "iffil: Can't open %s\n", actf); X exit(2); X }; X} END_OF_FILE if test 1761 -ne `wc -c <'plotter_iffil.c'`; then echo shar: \"'plotter_iffil.c'\" unpacked with wrong size! fi chmod +x 'plotter_iffil.c' # end of 'plotter_iffil.c' fi if test -f 'plotter_offil.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'plotter_offil.c'\" else echo shar: Extracting \"'plotter_offil.c'\" \(1285 characters\) sed "s/^X//" >'plotter_offil.c' <<'END_OF_FILE' X/* X offil, a printcap filter for printing the header page. X X Written by Brian Utterback X December 19878 X X*/ X X#include <stdio.h> X#include <signal.h> X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X register char *cp; X register int ch; X X /* 'of' filters are only passed width and length arguments from lpd */ X while (--argc) { X if (*(cp = *++argv) == '-' ) { X switch (cp[1]) { X case 'w': X /* this filter does nothing with width */ X break; X X case 'l': X /* this filter does nothing with length */ X break; X X } X } X } X X X while ((ch=getchar()) != EOF) { X switch(ch) { X X case '\31': X /* X * LPD needs to use a different filter to X * print data so stop what we are doing X * and wait for lpd to restart us. X */ X if ((ch = getchar()) == '\01') { X (void) fflush(stdout); X (void) kill(getpid(), SIGSTOP); X X break; X } else { X (void) ungetc(ch,stdin); X ch='\31'; X } X default: X putchar(ch); X break; X } X } X exit(0); X} END_OF_FILE if test 1285 -ne `wc -c <'plotter_offil.c'`; then echo shar: \"'plotter_offil.c'\" unpacked with wrong size! fi chmod +x 'plotter_offil.c' # end of 'plotter_offil.c' fi echo shar: End of shell archive. exit 0 Hope this helps, Gareth J. Barker, Institute of Neurology, Queen Square, London, UK. JANET : gbarker@uk.ac.ucl.sm.mph INTERNET : gbarker@.mph.sm.ucl.ac.uk BITNET : gbarker%uk.ac.ucl.sm.mph@ukacrl.bitnet
meo@gatech.edu (Miles O'Neal) (07/06/89)
In article <4155@kalliope.rice.edu> beareq!quants5!fitz@ai.mit.edu (David Fitzgerald) writes: | i am trying to connect a hp plotter 7475A to my sun 3/60 and run it | through a printer daemon on /dev/ttya i.e. lpr <plotter_file> | the plotter file is straight ascii text file and i have no problems | plotting about one page of commands. however the plotters error light | flashes through the entire process and aborts after a small portion of a | larger file. i believe the problem lies with the printcap entry but i | could be wrong. You need to (a) make sure the plotter is set up to do flow control via ^S and ^Q (one of the DIP switches) and (B) make sure that ttya is defined in ttytype as something reasonable for what you are doing, including having flow control set appropriately. -Miles
hysell@kodak.com (John Hysell) (07/06/89)
It sounds like you don't have any hardware flow control between the plotter and the computer. At 9600 baud you will fill up the Plotter's on-board buffer pretty quick, and then overrun it. Once it is overrun, the plotter cannot handle the 'garbage' that it finds in the buffer. (HPGL is very particular about command order.) The best solution is to modify your cable to implement XON/XOFF flow control (or some other protocol). A simpler way to handle the problem without making up a custom cable is to slow down the baud rate to a point where the buffer is not exceeded. Start at 150 baud, and gradually bump it up until you start blasting the buffer again, then back it down a notch or two. The 'optimal' baud rate will be hard to settle on as the plotter will print at varying speeds depending on the size and position of the text in your files. Hope this helps...
guy@uunet.uu.net (Guy Harris) (07/23/89)
>I think your problem may be with flow control - the first buffer gets sent >properly and the HP then tries to use RTS/CST to tell the sun to wait a >bit. The sun ignores this and then ... The way out is to tell the HP to >use XON/XOFF flow control (and also apply YAPT 5.??? if your running SunOs >4.0.1). If you're running SunOS 4.x, you might just try telling the Sun *not* to ignore RTS/CTS flow control, by using the "ms" capability in "printcap" and specifying "crtscts" mode. (Note: it's unidirectional RTS/CTS flow control - i.e., the Sun can't control flow of data *into* it - but for a printer or plotter, that should be sufficient. Bi-directional flow control, unlike unidirectional flow control, requires software changes - it can't be done just by the hardware, as unidirectional flow control can. Note also that the ALM - i.e., the Systech MTI board, as opposed to the Sun-built ALM-2 - *always* does unidirectional RTS/CTS flow control, although you can tie CTS high and disable it.)