1 .\" Copyright (c) 2010, Joerg Wunsch
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
85 .Dv extern int ibcnt ,
90 .Fn ibask "int handle" "int option" "int *retval"
92 .Fn ibbna "int handle" "char *bdname"
94 .Fn ibcac "int handle" "int v"
96 .Fn ibclr "int handle"
98 .Fn ibcmd "int handle" "void *buffer" "long cnt"
100 .Fn ibcmda "int handle" "void *buffer" "long cnt"
102 .Fn ibconfig "int handle" "int option" "int value"
104 .Fn ibdev "int boardID" "int pad" "int sad" "int tmo" "int eot" "int eos"
106 .Fn ibdiag "int handle" "void *buffer" "long cnt"
108 .Fn ibdma "int handle" "int v"
110 .Fn ibeos "int handle" "int eos"
112 .Fn ibeot "int handle" "int eot"
114 .Fn ibevent "int handle" "short *event"
116 .Fn ibfind "char *bdname"
118 .Fn ibgts "int handle" "int v"
120 .Fn ibist "int handle" "int v"
122 .Fn iblines "int handle" "short *lines"
124 .Fn ibllo "int handle"
126 .Fn ibln "int handle" "int padval" "int sadval" "short *listenflag"
128 .Fn ibloc "int handle"
130 .Fn ibonl "int handle" "int v"
132 .Fn ibpad "int handle" "int pad"
134 .Fn ibpct "int handle"
136 .Fn ibpoke "int handle" "int option" "int value"
138 .Fn ibppc "int handle" "int v"
140 .Fn ibrd "int handle" "void *buffer" "long cnt"
142 .Fn ibrda "int handle" "void *buffer" "long cnt"
144 .Fn ibrdf "int handle" "char *flname"
146 .Fn ibrdkey "int handle" "void *buffer" "int cnt"
148 .Fn ibrpp "int handle" "char *ppr"
150 .Fn ibrsc "int handle" "int v"
152 .Fn ibrsp "int handle" "char *spr"
154 .Fn ibrsv "int handle" "int v"
156 .Fn ibsad "int handle" "int sad"
158 .Fn ibsgnl "int handle" "int v"
160 .Fn ibsic "int handle"
162 .Fn ibsre "int handle" "int v"
164 .Fn ibsrq "(*func) void)"
166 .Fn ibstop "int handle"
168 .Fn ibtmo "int handle" "int tmo"
170 .Fn ibtrap "int mask" "int mode"
172 .Fn ibtrg "int handle"
174 .Fn ibwait "int handle" "int mask"
176 .Fn ibwrt "int handle" "const void *buffer" "long cnt"
178 .Fn ibwrta "int handle" "const void *buffer" "long cnt"
180 .Fn ibwrtf "int handle" "const char *flname"
182 .Fn ibwrtkey "int handle" "const void *buffer" "int cnt"
184 .Fn ibxtrc "int handle" "void *buffer" "long cnt"
188 library provides access to the
191 .Ss Variable Description
194 contains the number of bytes transferred in the most recent call to
204 provided for backwards compatibility.
208 provides an error code for the most recent library call.
209 The possible error codes are:
211 .Bl -tag -width 6n -offset indent -compact
215 Not Active Controller
219 Controller not addressed
223 Not System Controller
229 Async I/O in progress
235 Command byte xfer error
237 Serial poll status byte lost
246 contains the controller status.
247 This is an ORed status value, with the following individual bit names:
249 .Bl -tag -width 6n -offset indent -compact
259 Device requests service
279 Device trigger status
283 .Ss Function Description
286 is used to open the GPIB device, and establish the parameters to
287 communicate with a particular bus device. The device is selected
288 by its primary address
290 a numerical value between 0 and 30, possibly additionally by its
293 a numerical value between 96 and 126, or 0 to not use secondary
297 value specifies the timeout to use when communicating with the device.
298 This can be any of the constants
318 The boolean parameter
320 specifies whether the bus signal
322 (end-or-identify) should be asserted when sending the last byte of a
323 message to the device.
326 parameter determines whether any special character should be used to
327 identify the end of a device message when transferring messages on the
331 are interpreted as an end-of-string character,
333 This character can be ORed with the following values:
335 .Bl -tag -width 6n -compact -offset indent
337 When receiving a message byte on the bus that matches the
339 character, treat it as if the
341 signal were asserted, and stop receiving.
343 When transmitting a message byte on the bus that matches the
345 character, assert the
347 bus signal by the same time, and stop sending.
349 If set, include all 8 bits of the
351 character in the comparison; if unset, compare only 7 bit ASCII
357 will turn off any special character treatment, allowing for a fully
358 8-bit transparent communications channel to the device.
364 of a board identified by the name
366 .Em This function is currently not implemented.
368 All remaining functions take the handle returned by calling
370 as their first argument
375 is used to query configuration values that have been set with
377 .Em This function is currently not implemented.
381 is meant to change the access board for the given device to
384 .Em This function is currently not implemented.
388 is used to become the active controller on the bus, by asserting the
391 .Em This function is currently not implemented.
395 is used to transmit a
396 .Em Selected Device Clear
397 command to the device.
401 is used to directly write
403 GPIB command bytes from a buffer starting at
406 .Em This function is currently not implemented.
412 except it operates asynchronously, so it returns to the caller
414 .Em This function is currently not implemented.
418 is used to set certain configuration parameters.
419 .Em This function is currently not implemented.
423 is obsolete, and not implemented.
427 is used to enable or disable DMA transfers.
430 is a boolean parameter indicating DMA transfers are to be used.
431 Depending on the hardware and operating system configuration, DMA
432 transfers might not be available for a particular access board.
436 configures the end-of-string character.
443 configures the assertion of the
445 signal line when transmitting the last byte of a message; see
451 is used to obtain an event from the board's event queue.
452 .Em This function is currently not implemented.
456 makes the current controller the standby controller, by deasserting
460 .Em This function is currently not implemented.
464 sets the individual status bits of the controller to the value
466 .Em This function is currently not implemented.
470 returns the status of the control and handshake bus lines into the
473 .Em This function is currently not implemented.
477 is obsolete, and not implemented.
481 checks for a listener at the primary address
483 and the optional secondary address
485 If a listener was found, the value pointed to by
487 will be set to a non-zero value.
488 .Em This function is currently not implemented.
492 turns the device into local mode.
496 is used to close or reinitialize a device handle.
499 is passed as zero, the handle will be closed, and cannot be used
501 If it is passed as a non-zero value, all parameters of the handle
502 will be returned to their defaults;
503 .Em this functionality is currently unsupported.
507 is used to change the primary address of the device being communicated
516 is used to make the device associated with the handle the
517 controller-in-charge.
518 .Em This function is currently not implemented.
522 is obsolete, and not implemented.
526 is used to configure the parallel poll response to
528 .Em This function is currently not implemented.
534 bytes from the device, and store it to the address passed as
541 except it operates asynchronously, and returns immediately to the
543 .Em This function is currently not implemented.
547 read data from the device, and appends it to the file with the name
549 .Em This function is currently not implemented.
553 is obsolete, and not implemented.
557 performs a parallel poll, and stores the result at the location
560 .Em This function is currently not implemented.
564 makes the board specified by the handle the
565 .Em system controller
569 .Em This function is currently not implemented.
573 conducts a serial poll, and stores the result in the byte pointed
576 .Em This function is currently not implemented.
580 sets the serial poll response of the board to
582 possibly requesting service from the controller if the SRQ bit (0x40)
584 .Em This function is currently not implemented.
588 changes the secondary address of the device being communicated with to
596 is obsolete, and not implemented.
601 .Em Interface Clear (IFC)
602 signal line on the bus for at least 100 microseconds.
603 This will make all devices attached to the bus to unlisten and untalk.
604 This function should only be executed on the system controller.
609 .Em Remote Enable (REN)
610 signal line on the bus if argument
612 is non-zero, or deasserts it otherwise.
613 .Em This function is currently not implemented.
617 is obsolete, and not implemented.
621 stops or aborts any asynchronous I/O operation.
622 .Em This function is currently not implemented.
626 reconfigures the communication timeout.
633 is obsolete, and not implemented.
638 .Em Group Execute Trigger (GET)
639 command to the device.
643 waits for a status condition as specified by
647 is given as zero, it returns immediately.
648 .Em This function is currently not implemented.
654 bytes to the device, starting at the address pointed to by
659 performs the same operation as
661 in an asynchronous way, returning immediately to the caller.
662 .Em This function is currently not implemented.
666 opens the file named by
668 and sends its contents to the device.
669 .Em This function is currently not implemented.
673 is obsolete, and not implemented.
677 is obsolete, and not implemented.
681 returns a handle to be used for the remaining functions.
682 Upon failure, -1 is returned.
684 All other functions return the value of the variable
691 library tries to be compatible with the Linux GPIB library,
692 which in turn appears to be compatible with the GPIB library
693 shipped by National Instruments.
695 Errors in the functions above might set
697 to one of these values:
700 No such file or directory.
704 Device not configured.
706 Argument list too long.
708 Cannot allocate memory.
718 Too many open files in system.
722 Operation not supported.
729 library was written by
730 .An Poul-Henning Kamp
731 and first appeared in
734 This manual page was written by
737 Currently, the library can only handle a single
739 device with instance number 0.
741 Many functions are currently not implemented, see above for details.