vp(4) — VAX — Unsupported
Name
vp − Versatec interface
Syntax
device vp0 at uba0 csr 0177510 vector vpintr vpintr
Description
The Versatec printer/plotter is normally used with the programs vpr(1), vprint(1) or vtroff(1). This description is designed for those who wish to drive the Versatec directly.
To use the Versatec yourself, you must realize that you cannot open the device, /dev/vp0 if there is a daemon active. You can see if there is a daemon active by doing a lpq(1), and seeing if there are any files being sent.
To set the Versatec into plot mode you should include <sys/vcmd.h> and use the ioctl(2) call
ioctl(fileno(vp), VSETSTATE, plotmd);
where plotmd is defined to be
int plotmd[] = { VPLOT, 0, 0 };
and vp is the result of a call to fopen on stdio. When you finish using the Versatec in plot mode you should eject paper by sending it a EOT after putting it back into print mode, i.e. by
int prtmd[] = { VPRINT, 0, 0 };
...
fflush(vp);
ioctl(fileno(vp), VSETSTATE, prtmd);
write(fileno(vp), "\04", 1);
N.B.: If you use the standard I/O library with the Versatec you must do
setbuf(vp, vpbuf);
where vpbuf is declared
char vpbuf[BUFSIZ];
otherwise the standard I/O library, thinking that the Versatec is a terminal (since it is a character special file) will not adequately buffer the data you are sending to the Versatec. This will cause it to run extremely slowly and tends to grind the system to a halt.
Files
/dev/vp0
See Also
vfont(5), lpr(1), lpd(8), vtroff(1), va(4)
Diagnostics
The following error numbers are significant at the time the device is opened.
[ENXIO] The device is already in use.
[EIO] The device is offline.
Restrictions
The configuration part of the driver assumes that the device is setup to vector print mode through 0174 and plot mode through 0200. Since the driver doesn’t care whether the device considers the interrupt to be a print or a plot interrupt, it would be preferable to have these be the same. This since the configuration program can’t be sure at boot time which vector interrupted and where the interrupt vectors actually are. For the time being, since our versatec is vectored as described above, we specify that it has two interrupt vectors and are careful to detect an interrupt through 0200 at boot time and (manually) pretend the interrupt came through 0174.