[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Serial Handshaking

From: Andy Pugh
Subject: Serial Handshaking
Date: Wed, 7 Dec 2005 13:59:42 +0000

I am having some difficulty getting a system I have set up working. To
be honest, this isn't really a surprise considering what is connected
to what.

I have an old flat bed X-Y Plotter (Roland DG880). This has the
innards of a generic Prolific USB-Serial converter hard-wired to the
PCB (following the suggested pinout in the Roland manual). This is
then connected to my Apple G4 cube running OSX 10.4 and sat on top of
that I have the Fink distributioon of Octave and Aquaterm.

I am importing solid models into Octave from an STL file, then
sectioning the model and plotting a series of contours. (It is a
poor-man's version of the commercial system at which is in turn the porr mans version of a
stereolithography machine)

Somewhat surprisingly it all very nearly works...

The problem is one of handshaking. It is pretty much OK but very very
slow if I plot the output to Gnuplot/Aquaterm because Aquaterm seems
very slow in this application ("hold on" and plotting line segments
sequentially. The vast collection of gnuplot temp files created might
explain why)

If I turn of Gnuplot plotting, however, it all falls apart. It appears
to be a problem with handshaking. I have rather lost track of all the
possibilities I have tried but there seem to be two modes of
1) It plots the first few profiles on the sheet (looking like a
buffer-worth) but then stops and occasionally won't re-start until
octave is completely quit (releasing the port?). Sometimes fflush(p)
will prompt a brief flurry of plotter output.

2) It plots random bits of random profiles all over the sheet. I
suspect that this is due to buffer overflow.

1) looks like the nearest to proper function, but it looks like Octave
might be just giving up as soon as the hardware handshaking from the
plotter tells the port to stop sending.

Configuration of the port is being done through a line

system("stty -f /dev/cu.usbserial0 9600 -parodd cs7 crtscts -hupcl -clocal")

(With various combinations of hupcl, clocal and crtscts having been tried)

In the archives of this list I saw a suggestion to use fcntl to set
nonblocking mode on a file/port but that appears not to work in the
version of Octave installed by Fink.

Does it sound like a blocking issue?  Perhaps I need to manually
install a newer version of Octave?

Any ideas if it is possible to programmatically read the status of the
DSR, CTS etc lines?

Thanks for any help that you can offer.

Andy Pugh


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]