]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man4/gpib.4
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man4 / gpib.4
1 .\" Copyright (c) 2010, Joerg Wunsch
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd January 24, 2010
28 .Dt GPIB 4
29 .Os
30 .Sh NAME
31 .Nm gpib
32 .Nd General-Purpose Instrument Bus (GPIB) driver
33 .Sh SYNOPSIS
34 Either of the
35 .Xr pcii 4
36 or
37 .Xr tnt4882 4
38 drivers use this driver as the backend.
39 .Sh DESCRIPTION
40 The
41 .Nm
42 driver provides support for driving an IEEE-488 bus, also called
43 IEC-625 (or just "IEC bus"), or HP-IB (Hewlett Packard Instrument
44 Bus), or GPIB (General Purpose Instrument Bus).
45 The device can become either a listener, talker, controller, and
46 in particular a master controller on the bus.
47 .Ss Example
48 The following example code queries the device provided as
49 .Va argv[1]
50 for its identification response.
51 .Bd -literal
52 /* compile with:  cc -O -o ibtest ibtest.c -lgpib */
53
54 #include <stdio.h>
55 #include <stdlib.h>
56 #include <err.h>
57 #include <vis.h>
58
59 #include <gpib/gpib.h>
60
61 int
62 main(int argc, char **argv)
63 {
64         int dmm;
65         unsigned char buf[100];
66         char vbuf[sizeof(buf) * 4];
67
68         /* DVM */
69         dmm = ibdev(0, (argc > 1? atoi(argv[1]): 7), 0,
70                     T10s, 1, 0);
71         if (dmm < 0)
72                 errx(1, "ibdev = %d\\n", dmm);
73         ibwrt(dmm, "*IDN?\\r\\n", 7);
74         ibrd(dmm, buf, sizeof(buf) - 1);
75         strvisx(vbuf, buf, ibcnt, VIS_WHITE | VIS_CSTYLE);
76         printf("%s\\n", vbuf);
77         return (0);
78 }
79 .Ed
80 .Sh FILES
81 .Bl -tag -width /dev/gpibNNib
82 .It Pa /dev/gpib Ns Em N Ns "ib"
83 Main device node to access the driver.
84 .It Pa /dev/gpib Ns Em N Ns "l"
85 Listen-only entry to the driver.
86 When opening, an instrument can send data to this device on the
87 bus in an unaddressed mode, for example hard-copy printer data.
88 .El
89 .Sh SEE ALSO
90 .Xr gpib 3 ,
91 .Xr pcii 4 ,
92 .Xr tnt4882 4
93 .Sh HISTORY
94 The
95 .Nm
96 driver was written by Poul-Henning Kamp, and first appeared in
97 .Fx 5.4 .
98 .Sh AUTHORS
99 This manual page was written by
100 .An J\(:org Wunsch .