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:
210 .Bl -tag -offset indent -compact
214 Not Active Controller
218 Controller not addressed
222 Not System Controller
228 Async I/O in progress
234 Command byte xfer error
236 Serial poll status byte lost
245 contains the controller status.
246 This is an ORed status value, with the following individual bit names:
247 .Bl -tag -offset indent -compact
257 Device requests service
277 Device trigger status
281 .Ss Function Description
284 is used to open the GPIB device, and establish the parameters to
285 communicate with a particular bus device. The device is selected
286 by its primary address
288 a numerical value between 0 and 30, possibly additionally by its
291 a numerical value between 96 and 126, or 0 to not use secondary
295 value specifies the timeout to use when communicating with the device.
296 This can be any of the constants
316 The boolean parameter
318 specifies whether the bus signal
320 (end-or-identify) should be asserted when sending the last byte of a
321 message to the device.
324 parameter determines whether any special character should be used to
325 identify the end of a device message when transferring messages on the
329 are interpreted as an end-of-string character,
331 This character can be ORed with the following values:
332 .Bl -tag -compact -offset indent
334 When receiving a message byte on the bus that matches the
336 character, treat it as if the
338 signal were asserted, and stop receiving.
340 When transmitting a message byte on the bus that matches the
342 character, assert the
344 bus signal by the same time, and stop sending.
346 If set, include all 8 bits of the
348 character in the comparison; if unset, compare only 7 bit ASCII
353 will turn off any special character treatment, allowing for a fully
354 8-bit transparent communications channel to the device.
360 of a board identified by the name
362 .Em This function is currently not implemented.
364 All remaining functions take the handle returned by calling
366 as their first argument
371 is used to query configuration values that have been set with
373 .Em This function is currently not implemented.
377 is meant to change the access board for the given device to
380 .Em This function is currently not implemented.
384 is used to become the active controller on the bus, by asserting the
387 .Em This function is currently not implemented.
391 is used to transmit a
392 .Em Selected Device Clear
393 command to the device.
397 is used to directly write
399 GPIB command bytes from a buffer starting at
402 .Em This function is currently not implemented.
408 except it operates asynchronously, so it returns to the caller
410 .Em This function is currently not implemented.
414 is used to set certain configuration parameters.
415 .Em This function is currently not implemented.
419 is obsolete, and not implemented.
423 is used to enable or disable DMA transfers.
426 is a boolean parameter indicating DMA transfers are to be used.
427 Depending on the hardware and operating system configuration, DMA
428 transfers might not be available for a particular access board.
432 configures the end-of-string character.
439 configures the assertion of the
441 signal line when transmitting the last byte of a message; see
447 is used to obtain an event from the board's event queue.
448 .Em This function is currently not implemented.
452 makes the current controller the standby controller, by deasserting
456 .Em This function is currently not implemented.
460 sets the individual status bits of the controller to the value
462 .Em This function is currently not implemented.
466 returns the status of the control and handshake bus lines into the
469 .Em This function is currently not implemented.
473 is obsolete, and not implemented.
477 checks for a listener at the primary address
479 and the optional secondary address
481 If a listener was found, the value pointed to by
483 will be set to a non-zero value.
484 .Em This function is currently not implemented.
488 turns the device into local mode.
492 is used to close or reinitialize a device handle.
495 is passed as zero, the handle will be closed, and cannot be used
497 If it is passed as a non-zero value, all parameters of the handle
498 will be returned to their defaults;
499 .Em this functionality is currently unsupported.
503 is used to change the primary address of the device being communicated
512 is used to make the device associated with the handle the
513 controller-in-charge.
514 .Em This function is currently not implemented.
518 is obsolete, and not implemented.
522 is used to configure the parallel poll response to
524 .Em This function is currently not implemented.
530 bytes from the device, and store it to the address passed as
537 except it operates asynchronously, and returns immediately to the
539 .Em This function is currently not implemented.
543 read data from the device, and appends it to the file with the name
545 .Em This function is currently not implemented.
549 is obsolete, and not implemented.
553 performs a parallel poll, and stores the result at the location
556 .Em This function is currently not implemented.
560 makes the board specified by the handle the
561 .Em system controller
565 .Em This function is currently not implemented.
569 conducts a serial poll, and stores the result in the byte pointed
572 .Em This function is currently not implemented.
576 sets the serial poll response of the board to
578 possibly requesting service from the controller if the SRQ bit (0x40)
580 .Em This function is currently not implemented.
584 changes the secondary address of the device being communicated with to
592 is obsolete, and not implemented.
597 .Em Interface Clear (IFC)
598 signal line on the bus for at least 100 microseconds.
599 This will make all devices attached to the bus to unlisten and untalk.
600 This function should only be executed on the system controller.
605 .Em Remote Enable (REN)
606 signal line on the bus if argument
608 is non-zero, or deasserts it otherwise.
609 .Em This function is currently not implemented.
613 is obsolete, and not implemented.
617 stops or aborts any asynchronous I/O operation.
618 .Em This function is currently not implemented.
622 reconfigures the communication timeout.
629 is obsolete, and not implemented.
634 .Em Group Execute Trigger (GET)
635 command to the device.
639 waits for a status condition as specified by
643 is given as zero, it returns immediately.
644 .Em This function is currently not implemented.
650 bytes to the device, starting at the address pointed to by
655 performs the same operation as
657 in an asynchronous way, returning immediately to the caller.
658 .Em This function is currently not implemented.
662 opens the file named by
664 and sends its contents to the device.
665 .Em This function is currently not implemented.
669 is obsolete, and not implemented.
673 is obsolete, and not implemented.
677 returns a handle to be used for the remaining functions.
678 Upon failure, -1 is returned.
680 All other functions return the value of the variable
687 library tries to be compatible with the Linux GPIB library,
688 which in turn appears to be compatible with the GPIB library
689 shipped by National Instruments.
691 Errors in the functions above might set
693 to one of these values:
696 No such file or directory.
700 Device not configured.
702 Argument list too long.
704 Cannot allocate memory.
714 Too many open files in system.
718 Operation not supported.
725 library was written by
726 .An Poul-Henning Kamp
727 and first appeared in
730 This manual page was written by
733 Currently, the library can only handle a single
735 device with instance number 0.
737 Many functions are currently not implemented, see above for details.