BSD 3 development
[unix-history] / usr / man / man4 / vp.4
CommitLineData
90df4f67
BJ
1.TH VP 4 2/24/79 4
2.UC
3.SH NAME
4vp \- Versatec interface
5.SH SYNOPSIS
6.B /dev/vp0
7.SH DESCRIPTION
8The Versatec printer/plotter in normally used with the programs
9.IR vprint (1)
10or
11.IR vtroff (1).
12This description is designed for those who wish to drive the Versatec directly.
13.PP
14The Versatec at Berkeley is 36'' wide, and has 440 characters per line
15and 7040 dot per line in plot mode (this is actually slightly less than
1636'' of dots.)
17The paper used is continuous roll paper, and comes in 500' rolls.
18.PP
19To use the Versatec yourself, you must realize that you cannot open the
20device,
21.I /dev/vp0
22if there is a daemon active.
23You can see if there is a daemon active by doing a
24.IR ps (1),
25or by looking in the directory
26.I /usr/spool/vpd.
27If there is a file
28.I lock
29there, then there is probably a daemon
30.IR vpd (1)
31running.
32If not, you should remove the
33.I lock.
34.PP
35In any case, when your program tries to open the device
36.I /dev/vp0
37you may get one of two errors.
38The first of these
39ENXIO
40indicates that the Versatec is already in use.
41Your program can then
42.IR sleep (2)
43and try again in a while, or give up.
44The second is
45EIO
46and indicates that the Versatec is offline.
47.PP
48To set the Versatec into plot mode you can use the following
49.IR ioctl (2)
50call
51.IP
52ioctl(fileno(vp), SETSTATE, plotmd);
53.PP
54where SETSTATE must be defined to be ``('v'<<8) | 1'' and
55.B plotmd
56is defined by
57.IP
58\fBint\fR plotmd[] = { 0200, 0, 0 };
59.PP
60and
61.I vp
62is the result of a call to
63.I fopen
64on stdio.
65When you finish using the Versatec in plot mode you should eject paper
66by sending it a EOT after putting it back into print mode, i.e. by
67.sp .1i
68'nf
69\fBint\fR prtmd[] = { 0100, 0, 0 };
70\&...
71fflush(vp); ioctl(fileno(vp), SETSTATE, prtmd); write(fileno(vp), "\e04", 1);
72.fi
73.PP
74.B "\s+2Very important point:\s0"
75If you use the standard I/O library with the Versatec you
76.B must
77do
78.IP
79setbuf(vp, vpbuf);
80.PP
81where
82.I vpbuf
83is declared
84.IP
85\fBchar\fR vpbuf[BUFSIZ];
86.PP
87otherwise the standard I/O library, thinking that the Versatec
88is a terminal (since it is a character special file) will not buffer
89the data you are sending to the Versatec.
90This will cause it to run
91.B extremely
92slowly and tends to grind the system to a halt.
93.SH FILES
94/dev/vp0
95.SH SEE ALSO
96vcat(1), vfont(5), vpr(1), vprint(1), vstat(1), vtroff(1)
97.SH BUGS