Linux-GPIB 4.3.7 Documentation
Prev |  | Next

# gpib.conf

## Name

gpib.conf -- GPIB library configuration file

## Description

The library, and the administration tool gpib_config read their configuration information from the file gpib.conf. By default, the file is located in the sysconfdir directory configured when linux-gpib was compiled. The sysconfdir is typically set to /etc or /usr/local/etc. A template gpib.conf file can be found in the util/templates/ subdirectory of the linux-gpib package.

The default config file may be overridden by setting the IB_CONFIG environment variable to a custom file path.

The configuration file must contain one 'interface' entry for each of the board minors that are going to be used unless all the 'required' options are specified in the command-line invocation of the administration tool gpib_config to configure that minor. The file must contain an 'interface' entry with the 'name' option set if you wish to open the board desciptor with ibfind() instead of directly using the minor as the board descriptor. If there is no entry for the minor in the configuration file, the required command-line options are 'board_type' and 'pad'. Additionally the '--system-controller' option must be scpecified if the board is to be system-controller, which is the normal case. For example:

      gpib_config --minor 8 --board-type ni_usb_b --pad 0 --system-controller

The configuration file can contain zero or more 'device' entries. 'device' entries are only required if you wish to open device descriptors with ibfind() instead of using ibdev(). Each 'device' entry must have at least the 'minor', 'pad' and 'name' options specified. The 'minor' of a 'device' entry must have a corresponding 'interface' entry.

Several example entries, and a table summarizing the possible options follow.

      /*  This comment style is permitted */

      // This is an alternate comment style

    interface {
    	minor = 0
    	board_type = "ni_pci"
    	pad = 0
    	master = yes
    }

    interface {
    	minor = 1
    	board_type = "ines_pci"
    	name = "joe"
    	pad = 5
    	sad = 0
    	timeout = T10s
    	pci_bus = 0
    	pci_slot = 0xd
    	master = no
    }

    interface {
    	minor = 2
    	board_type = "pcII"
    	pad = 3
    	sad = 0x62
    	eos = 0x0d
    	set-reos = yes
    	set-bin = no
    	set-xeos = no
    	set-eot = yes
    	base = 0x300
    	irq  = 5
    	dma  = 0
    	master = no
    }

    device {
    	minor = 0
    	name = "counter"  // name that can be used with ibfind
    	pad = 24
    }

    device {
    	minor = 0
    	name = "voltmeter"
    	pad = 7
    	sad = 110
    	eos = 0xa
    	set-reos = yes
    	set-bin = no
    	set-xeos = yes
    	set-eot = no
    	timeout = T1s
    }

Table 1. configuration options

option name | description | used by interface or device entries | required or optional
--- | --- | --- | ---
base | Specifies the base ioport or io memory address for a board that lacks plug-and-play capability. | interface | optional
board_type | Specifies the type of interface board. See the last two columns of Table 2. for a list of possible board types, and the kernel driver module that supports them. There is no default. | interface | required
dma | Specifies the dma channel for a board that lacks plug-and-play capability. | interface | optional
eos | Sets the end-of-string byte for board or device descriptors obtained with ibfind(). By default eos = 0. See also the set-reos, set-bin, and set-xeos options. | interface or device | optional
irq | Specifies the interrupt level for a board that lacks plug-and-play capability. | interface | optional
master | Set to 'yes' if you want the interface board to be the system controller of the bus. There can only be one system controller on a bus. By default master = no. | interface | required
minor | 'minor' specifies the minor number of the device file this interface board will use. A 'minor' of 0 corresponds to /dev/gpib0, 1 is /dev/gpib1, etc. The minor number is also equal to the 'board index' which can be used as a board descriptor, and is passed as the first argument of ibdev() | interface | required
name | The 'name' specifies the name which can be used with ibfind() to get a descriptor for the board or device associated with this entry. | interface or device | interface optional device required
pad | Specifies the primary GPIB address (valid addresses are 0 to 30). For interfaces, this is the primary address that the board will be assigned when it is first brought online. For devices, this is address that will be used by device descriptors obtained with ibfind(). No default. | interface or device | required
pci_bus | Useful for distinguishing between multiple PCI cards. If you have more than one PCI card that with the same 'board_type', you can use the 'pci_bus' and 'pci_slot' options to specify the particular card you are interested in. | interface | optional
pci_slot | Can be used in conjunction with 'pci_bus' to specify a particular pci card. | interface | optional
sad | Specifies the secondary GPIB address. Valid values are 0, or 0x60 to 0x7f hexadecimal (96 to 127 decimal). A value of 0 means secondary addressing is disabled (the default). Secondary addresses from 0 to 31 are specified by the library's convention of adding an offset of 0x60. | interface or device | optional
set-bin | Enables 8-bit comparisons when matching the end-of-string byte, instead of only comparing the 7 least significant bits. Only affects descriptors returned by ibfind(), and has same effect as setting the BIN bit in a ibeos() call. Default is set-bin = 0. | interface or device | optional
set-eot | Enables assertion of the EOI line at the end of writes, for descriptors returned by ibfind(). See ibeot(). Default set-eoi = yes. | interface or device | optional
set-reos | Enables the termination of reads on reception of the end-of-string byte for descriptors returned by ibfind(). Same as setting the REOS bit in a ibeos() call. Default is set-reos = no. | interface or device | optional
set-xeos | Enables the assertion of EOI on transmission of the end-of-string byte for descriptors returned by ibfind(). Same as setting the XEOS bit in a ibeos() call. Default is set-xeos = no. | interface or device | optional
sysfs_device_path | A string which may be used to select a particular piece of hardware by its sysfs device path. | interface | optional
timeout | Sets the io timeout for a board or device descriptor opened through ibfind(). The possible settings are the same as the constants used by ibtmo(). Default is timeout = T3s , which is 3 seconds. | interface or device | optional

Prev | Home | Next
Configuration | Up | gpib_config