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, 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 overriden 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, and 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(). Several example entries, and a table summarizing the possible options follow.


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"
	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 namedescriptionused by interface or device entriesrequired or optional
baseSpecifies the base ioport or io memory address for a board that lacks plug-and-play capability.interfaceoptional
board_typeSpecifies the type of interface board. See the drivers.txt file for a list of possible board types, and the kernel driver module that supports them.interfacerequired
dmaSpecifies the dma channel for a board that lacks plug-and-play capability.interfaceoptional
eosSets the end-of-string byte for board or device descriptors obtained with ibfind(). See also the set-reos, set-bin, and set-xeos options.interface or deviceoptional
irqSpecifies the interrupt level for a board that lacks plug-and-play capability.interfaceoptional
masterSet 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.interfacerequired
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 one of the arguments of ibdev() interfacerequired
nameThe '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 deviceoptional
padSpecifies 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().interface or devicerequired
pci_busUseful 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. interfaceoptional
pci_slotCan be used in conjunction with 'pci_bus' to specify a particular pci card.interfaceoptional
sadSpecifies the secondary GPIB address. Valid values are 0, or 0x60 to 0x7e hexadecimal (96 to 126 decimal). A value of 0 means secondary addressing is disabled (the default). Secondary addresses from 0 to 30 are specified by the library's convention of adding an offset of 0x60. interface or deviceoptional
set-binEnables 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.interface or deviceoptional
set-eotEnables assertion of the EOI line at the end of writes, for descriptors returned by ibfind(). See ibeot().interface or deviceoptional
set-reosEnables 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.interface or deviceoptional
set-xeosEnables 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.interface or deviceoptional
sysfs_device_pathA string which may be used to select a particular piece of hardware by its sysfs device path.interfaceoptional
timeoutSets the io timeout for a board or device descriptor opened through ibfind(). The possible settings are the same as the constants used by ibtmo().interface or deviceoptional