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
285 is used to open the GPIB device, and establish the parameters to
286 communicate with a particular bus device. The device is selected
287 by its primary address
289 a numerical value between 0 and 30, possibly additionally by its
292 a numerical value between 96 and 126, or 0 to not use secondary
296 value specifies the timeout to use when communicating with the device.
297 This can be any of the constants
317 The boolean parameter
319 specifies whether the bus signal
321 (end-or-identify) should be asserted when sending the last byte of a
322 message to the device.
325 parameter determines whether any special character should be used to
326 identify the end of a device message when transferring messages on the
330 are interpreted as an end-of-string character,
332 This character can be ORed with the following values:
333 .Bl -tag -compact -offset indent
335 When receiving a message byte on the bus that matches the
337 character, treat it as if the
339 signal were asserted, and stop receiving.
341 When transmitting a message byte on the bus that matches the
343 character, assert the
345 bus signal by the same time, and stop sending.
347 If set, include all 8 bits of the
349 character in the comparison; if unset, compare only 7 bit ASCII
354 will turn off any special character treatment, allowing for a fully
355 8-bit transparent communications channel to the device.
361 of a board identified by the name
363 .Em This function is currently not implemented.
365 All remaining functions take the handle returned by calling
367 as their first argument
372 is used to query configuration values that have been set with
374 .Em This function is currently not implemented.
378 is meant to change the access board for the given device to
381 .Em This function is currently not implemented.
385 is used to become the active controller on the bus, by asserting the
388 .Em This function is currently not implemented.
392 is used to transmit a
393 .Em Selected Device Clear
394 command to the device.
398 is used to directly write
400 GPIB command bytes from a buffer starting at
403 .Em This function is currently not implemented.
409 except it operates asynchronously, so it returns to the caller
411 .Em This function is currently not implemented.
415 is used to set certain configuration parameters.
416 .Em This function is currently not implemented.
420 is obsolete, and not implemented.
424 is used to enable or disable DMA transfers.
427 is a boolean parameter indicating DMA transfers are to be used.
428 Depending on the hardware and operating system configuration, DMA
429 transfers might not be available for a particular access board.
433 configures the end-of-string character.
440 configures the assertion of the
442 signal line when transmitting the last byte of a message; see
448 is used to obtain an event from the board's event queue.
449 .Em This function is currently not implemented.
453 makes the current controller the standby controller, by deasserting
457 .Em This function is currently not implemented.
461 sets the individual status bits of the controller to the value
463 .Em This function is currently not implemented.
467 returns the status of the control and handshake bus lines into the
470 .Em This function is currently not implemented.
474 is obsolete, and not implemented.
478 checks for a listener at the primary address
480 and the optional secondary address
482 If a listener was found, the value pointed to by
484 will be set to a non-zero value.
485 .Em This function is currently not implemented.
489 turns the device into local mode.
493 is used to close or reinitialize a device handle.
496 is passed as zero, the handle will be closed, and cannot be used
498 If it is passed as a non-zero value, all parameters of the handle
499 will be returned to their defaults;
500 .Em this functionality is currently unsupported.
504 is used to change the primary address of the device being communicated
513 is used to make the device associated with the handle the
514 controller-in-charge.
515 .Em This function is currently not implemented.
519 is obsolete, and not implemented.
523 is used to configure the parallel poll response to
525 .Em This function is currently not implemented.
531 bytes from the device, and store it to the address passed as
538 except it operates asynchronously, and returns immediately to the
540 .Em This function is currently not implemented.
544 read data from the device, and appends it to the file with the name
546 .Em This function is currently not implemented.
550 is obsolete, and not implemented.
554 performs a parallel poll, and stores the result at the location
557 .Em This function is currently not implemented.
561 makes the board specified by the handle the
562 .Em system controller
566 .Em This function is currently not implemented.
570 conducts a serial poll, and stores the result in the byte pointed
573 .Em This function is currently not implemented.
577 sets the serial poll response of the board to
579 possibly requesting service from the controller if the SRQ bit (0x40)
581 .Em This function is currently not implemented.
585 changes the secondary address of the device being communicated with to
593 is obsolete, and not implemented.
598 .Em Interface Clear (IFC)
599 signal line on the bus for at least 100 microseconds.
600 This will make all devices attached to the bus to unlisten and untalk.
601 This function should only be executed on the system controller.
606 .Em Remote Enable (REN)
607 signal line on the bus if argument
609 is non-zero, or deasserts it otherwise.
610 .Em This function is currently not implemented.
614 is obsolete, and not implemented.
618 stops or aborts any asynchronous I/O operation.
619 .Em This function is currently not implemented.
623 reconfigures the communication timeout.
630 is obsolete, and not implemented.
635 .Em Group Execute Trigger (GET)
636 command to the device.
640 waits for a status condition as specified by
644 is given as zero, it returns immediately.
645 .Em This function is currently not implemented.
651 bytes to the device, starting at the address pointed to by
656 performs the same operation as
658 in an asynchronous way, returning immediately to the caller.
659 .Em This function is currently not implemented.
663 opens the file named by
665 and sends its contents to the device.
666 .Em This function is currently not implemented.
670 is obsolete, and not implemented
674 is obsolete, and not implemented.
678 returns a handle to be used for the remaining functions.
679 Upon failure, -1 is returned.
681 All other functions return the value of the variable
688 library tries to be compatible with the Linux GPIB library,
689 which in turn appears to be compatible with the GPIB library
690 shipped by National Instruments.
692 Errors in the functions above might set
694 to one of these values:
697 No such file or directory.
701 Device not configured.
703 Argument list too long.
705 Cannot allocate memory.
715 Too many open files in system.
719 Operation not supported.
726 library was written by
727 .An Poul-Henning Kamp
728 and first appeared in
731 This manual page was written by
734 Currently, the library can only handle a single
736 device with instance number 0.
738 Many functions are currently not implemented, see above for details.