🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #229

Re: Programming HP Plotters over RS-232

#229
From: John R. Dudeck
Date: Thu, 29 Mar 1990 22:10
43 lines
2557 bytes
In article <20621@cs.yale.edu> spolsky-joel@CS.Yale.EDU (Joel Spolsky) writes:
>Hi yall, a quick question; we've got this HP Plotter attached to COM1
>(over RS232) and I have tried to program it with
>
>	plotter = fopen("COM1");
>	fprintf (plotter, "...");
>
>but every once in a while some buffer overflows and I get nasty DOS
>"Write error on COM1, Abort Retry Ignore Fail" messages scribbled all
>over my otherwise extremely beautiful VGA graphic screen.
>
>What am I doing wrong? Do I have to write my own routines to write one
>character at a time to the UART and check when it is ready for
>another? will this solve my problem at all? or is there an easier way?

I don't have a plotter around to verify this, but I would bet that the
plotter has a buffer that is getting overrun, and it is trying to do flow
control, which the PC is getting upset about.

It sounds to me that the flow control is working, but the PC is timing
out because of the slowness of the plotter.  This can by fixed by the 
proper parameters to the MODE command.  In my DOS 4.01 manual it says
that to error is the default, but you can do MODE COM1:96,N,8,1,B
or MODE COM1:96,N,8,1,p for older DOS versions. (You should use the
appropriate parameters for your plotter).  The B or p makes
it retry instead of timing out.

Another possible thing to look for is an improperly connected cable.
There is probably one line being used for flow control.  Typically it
comes out of pin 20 on a 25-pin connector on the plotter, and goes into 
pin 5 on the PC side on a 25-pin connector.

If the plotter doesn't support hardware flow control, then it most
likely uses X-on-X-off flow control.  The PC doesn't have built-in
support for this, but you can easily add it with an X-on-X-off driver
from SIMTEL.


-- 
John Dudeck                           "You want to read the code closely..." 
jdudeck@Polyslo.CalPoly.Edu             -- C. Staley, in OS course, teaching 
ESL: 62013975 Tel: 805-545-9549          Tanenbaum's MINIX operating system.
Technical Details
Message-ID: <261287c0.49dc@polyslo.CalPoly.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!jarthur!petunia!polyslo!jdudeck
References: <20621@cs.yale.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!jarthur!petunia!polyslo!jdudeck
From: jdudeck@polyslo.CalPoly.EDU (John R. Dudeck)
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: Programming HP Plotters over RS-232
Message-ID: <261287c0.49dc@polyslo.CalPoly.EDU>
Date: 29 Mar 90 22:10:08 GMT
References: <20621@cs.yale.edu>
Reply-To: jdudeck@polyslo.CalPoly.EDU (John R. Dudeck)
Organization: Cal Poly State University -- San Luis Obispo
Lines: 38