xref: /csrg-svn/share/man/man4/man4.vax/va.4 (revision 20696)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)va.4 4.1 (Berkeley) 05/15/85

VA 4 4/1/81
C 4
NAME
va - Benson-Varian interface
SYNOPSIS
device va0 at uba? csr 0164000 vector vaintr
DESCRIPTION
The Benson-Varian printer/plotter in normally used with the programs vpr (1), vprint (1) or vtroff (1). This description is designed for those who wish to drive the Benson-Varian directly.

The Benson-Varian at Berkeley uses 11\*(rq by 8\*(rq fan-fold paper. It will print 132 characters per line in print mode and 2112 dots per line in plot mode.

In print mode, the Benson-Varian uses a modified ASCII character set. Most control characters print various non-ASCII graphics such as daggers, sigmas, copyright symbols, etc. Only LF and FF are used as format effectors. LF acts as a newline, advancing to the beginning of the next line, and FF advances to the top of the next page.

In plot mode, the Benson-Varian prints one raster line at a time. An entire raster line of bits (2112 bits = 264 bytes) is sent, and then the Benson-Varian advances to the next raster line.

Note: The Benson-Varian must be sent an even number of bytes. If an odd number is sent, the last byte will be lost. Nulls can be used in print mode to pad to an even number of bytes.

To use the Benson-Varian yourself, you must realize that you cannot open the device, /dev/va0 if there is a daemon active. You can see if there is a daemon active by doing a ps (1), or by looking in the directory /usr/spool/vad. If there is a file lock there, then there is probably a daemon /usr/lib/vad running. If not, you should remove the lock.

In any case, when your program tries to open the device /dev/va0 you may get one of two errors. The first of these ENXIO indicates that the Benson-Varian is already in use. Your program can then sleep (2) and try again in a while, or give up. The second is EIO and indicates that the Benson-Varian is offline.

To set the Benson-Varian into plot mode, ``#include <vcmd.h>'' and use the following ioctl (2) call

ioctl(fileno(va), VSETSTATE, plotmd);

where plotmd is defined to be

int plotmd[] = { VPLOT, 0, 0 };

and va is the result of a call to fopen on stdio. When you finish using the Benson-Varian in plot mode you should advance to a new page by sending it a FF after putting it back into print mode, i.e. by

'nf int prtmd[] = { VPRINT, 0, 0 }; ... fflush(va); ioctl(fileno(va), VSETSTATE, prtmd); write(fileno(va), "\ef\e0", 2);

N.B. : If you use the standard I/O library with the Benson-Varian you must do

setbuf(vp, vpbuf);

where vpbuf is declared

char vpbuf[BUFSIZ];

otherwise the standard I/O library, thinking that the Benson-Varian is a terminal (since it is a character special file) will not adequately buffer the data you are sending to the Benson-Varian. This will cause it to run extremely slowly and tend to grind the system to a halt.

FILES
/dev/va0

/usr/include/sys/vcmd.h

SEE ALSO
vfont(5), vpr(1), vtroff(1), vp(4)
DIAGNOSTICS
va%d: npr timeout. The device was not able to get data from the UNIBUS within the timeout period, most likely because some other device was hogging the bus. (But see BUGS below).
BUGS
The 1's (one's) and l's (lower-case el's) in the Benson-Varian's standard character set look very similar; caution is advised.

The interface hardware is rumored to have problems which can play havoc with the UNIBUS. We have intermittent minor problems on the UNIBUS where our va lives, but haven't ever been able to pin them down completely.