[comp.unix.wizards] 3M Laser Imager

thorn@godot.radonc.unc.edu (Jesse Thorn) (08/23/88)

I am having a problem interfacing a 3M Laser Imager with our VAXes
(running either BSD 4.3 or Ultix 2.0-1).

The LI can be controlled through a serial port that is configured for
data containing 8 data bits + 2 stop bits with even parity. The Imager
responds to simple ASCII commands that use a carriage return as a
message terminator.

The problem is getting UNIX to configure the tty line this
way - I just can't seem to get an 8 data bit/even parity setup.

I tried the following experiment to verify the Laser Imager line
characteristics: I hooked up a VT240 terminal that was configured to 8
bits, even parity, 2 stop bits, and the proper baud rate. I had no
problem controlling the Imager by typing in commands at the VT240
keyboard.

However, when the VT240 is hooked  up to a serial port on one of our
VAXes the commands that the software driver sends show up as as
garbage (setting the VT240 to 7 bit data/even parity solves the problem).
Under software control the line is configured using ioctl calls to be
RAW, EVENP, LITOUT, and -CRMOD. I have grovelled through the source
code of the UNIX tty and don't see why this setup won't work. The
vendor claims that they have no promlems controlling the Imager with
VAXes running VMS, but know of noone doing so under UNIX.

Help advance the cause of medicine here at NC Memorial Hospital -
what's the solution?

- Jesse Thorn

chris@mimsy.UUCP (Chris Torek) (08/23/88)

In article <978@godot.radonc.unc.edu> thorn@godot.radonc.unc.edu
(Jesse Thorn) writes:
>(running either BSD 4.3 or Ultix 2.0-1). ...
>The LI ... [requires] 8 data bits + 2 stop bits with even parity.
>... The problem is getting UNIX to configure the tty line this
>way - I just can't seem to get an 8 data bit/even parity setup.

You are correct: you cannot get 8 data bits plus parity (for a
total of 9 bits) out of either 4.3BSD or Ultrix 2.0-1.  The serial
port hardware is capable of this, but the system has no means to
set it.

>... I have grovelled through the source
>code of the UNIX tty and don't see why this setup won't work.

Whatever parity you set, it subsumes the eigth bit.  If you set
PASS8 mode (available in 4.3BSD, at least) the eight bit will
not be forced to even or odd parity, but the serial port itself
will then be set to eight data bits, no parity bits; even at two
stop bits, you will still only get ten data bits per character.

Since you have source code, you can fix this.  You will have to
add a flag (somewhere; in 4.3BSD, there is one bit left in t_flags,
defined as `L001000') just for this mode, or else rewire much of
the existing code (which needs doing, and has needed doing for
quite some time now).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris