|
GPIB - General Purpose Interface Bus |
| |
|
Table of contents |
|
|
| Overview |  |
|
|
The BitCtrl Systems GPIB is a software library for the general
purpose interface bus (GPIB). This collection of functions enables the creation of GPIB
applications for the operating system to QNX 4.x.
The GPIB is a connecting or an interface system, through which
electronic devices communicate.
The original GPIB was designed by Hewlett-Packard (known as HP-
IB). Because of its high data transfer rate (up to 1 Megabyte/sec) and its versatility the
GPIB became popular very quickly and was adapted by the IEEE as standard IEEE-488
|
| Installation |  |
|
|
Insert diskette 1 into the floppy disk drive and input at the
operating system prompt:
install
The installation program automatically copies all files in the directory
‘/usr/gpib/’ and
various subdirectories.
|
| Start of the System |  |
|
|
In the directory
‘/usr/gpib/bin/’ is the Script
‘gpstart’, which shows an example of
starting the BitCtrl Systems GPIB system. The GPIB administrator
‘Gpib’ must be sperately started as a
background process:
/usr/gpib/bin/Gpib &
It is necessary to be superuser (root) to be able to start the administrator.
Different QNX drivers must be started, depending on the type of
card, to be able to use the GPIB interface card. For a NI PC2 card the driver is
started as follows:
/usr/gpib/bin/Gpib.pc2 &
Table 1 shows which driver must be used for its respective GPIB interface
card.
| GPIB-Driver |
| GPIB Interface Card |
GPIB-Driver |
National Instruments PC2 and NEC 7210
Register compatible cards |
Gpib.pc2 |
National Instruments AT |
Gpib.t488 |
Burr Brown PCI 800 |
Gpib.pci800 |
Ines AT 488 |
Gpib.ines488 |
|
| |
| GPIB Utilities |  |
|
|
Through BitCtrl Systems GPIB a set of utilities are available.
Table 2 shows these utilities with their respective functions.
| GPIB-Utilities |
| Name |
Function |
| gpconf |
Menu controlled configuration
program |
| gpsh |
Interactive command line interface for the input
of GPIB commands |
| vgpsh |
Menu controlled interface for the input
of GPIB commands |
| gpstop |
Program for terminating GPIB administrator
and drivers |
| gplines |
Display the GPIB bus line |
|
| |
| GPIB Configuration |  |
|
|
The BitCtrl Systems GPIB software uses a series of standard
adjustments for the diverse configuration parameters of the GPIB systems. These
adjustments can be changed with the help of utilities
‘gpconf’. Also at run-time they can be changed by various
functions. |
| Standard Configuration |  |
|
|
The following adjustments to the standard can are
active:
 |
There are 500 devices. Each hundred devices are
assigned to an access card and have the symbolic names ‘dev1’ to
‘dev99’. These symbolic names can be modified at will. |
 |
There are 5 access cards with the symbolic names
‘gpib0’ to ‘gpib4’. These symbolic names can
be modified at will. Each access card can administer up to 100 devices. |
 |
Each GPIB card is the system controller of their
independent buses and has the primary GPIB address of 0. This address can be modified
at will. |
 |
The END message is transmitted with the last
byte of each data message to a device. |
 |
The Timeout value for I/O operations and wait
functions is set at approx. 10 seconds. |
 |
Each GPIB interface card has its own standard
adjustments for base I/O address, interrupts and DMA (direct memory access) channel.
Additional information is contained in the documentation of the interface card. |
|
| Device- and Card Adjustments |  |
|
|
The following anouncements about the configurable adjustments, if
not otherwise noted, concerns both cards and devices.
 |
Primary GPIB Address
All devices and cards must have a unique primary address between 0x00 and 0x1e.
The driver automatically produces a receiver address, by adding 0x20 to primary
address, and a sender address, by adding 0x40. The primary address of a device
is adjusted by hardware switches or a special program. This address must
correspond with the address for this device which was set with
‘ibconfig’.
The standard address for all GPIB cards is zero.
|
| |
 |
Secondary GPIB Address
Each device that uses extended addressing, must have a secondary address between
0x60 and 0x7e. Otherwise the secondary addressing must be switched off with the
option NONE. The secondary address of a device is adjusted by hardware switches or
a special program. This address must correspond with the address for this device
which was set with ‘ibconfig’.
The standard adjustment for all devices and cards for this option is NONE.
|
| |
 |
Timeout Adjustment
The timeout value is the approximate minimum length of time that an I/O
operation like ibwrt, ibrd or ibcmd may
last before a timeout occurs. It also determines the length of time which the
ibwait function will wait for the arrival of an event before it
returns (if the TIMO bit in the event mask is set). If the SRQI bit and the
TIMO bit in the ibwait transferred event mask are set and no SRQ
were discovered, the function will be terminated by with a timeout. See
ibwait in the GPIB reference manual for further information.
‘ibconfig’ uses a code for
the timeout value which is explained in table 3.
The standard adjustment is T10sec.
|
| |
| Timeout Values |
| Code |
Real Value |
Minimum Timeout |
| TNONE |
0 |
Turned off *) |
| T10msec |
1 |
10 msec |
| T30msec |
2 |
30 msec |
| T100msec |
3 |
100 msec |
| T300msec |
4 |
300 msec |
| T1msec |
5 |
1 msec |
| T3msec |
6 |
3 msec |
| T10msec |
7 |
10 msec |
| T30msec |
8 |
30 msec |
| T100msec |
9 |
100 msec |
| T300msec |
10 |
300 msec |
| T1sec |
11 |
1 sec |
| T3sec |
12 |
3 sec |
| T10sec |
13 |
10 sec |
| T30sec |
14 |
30 sec |
| T100sec |
15 |
100 sec |
*) If TNONE were selected, no limitation is activated and I/O
operation could persist infinitely for a long time.
 |
EOS-Byte
EOS byte some devices it can be programmed in such a way that they terminate write
operations, if a certain EOS character is discovered. The LINE feed character (LF)
is a usual EOS byte.
Note: The driver does not add with write operations automatically a EOS
byte to the end of the data. This byte must be attached expressly to the data
character string. The specification of the EOS byte serves only for the
information of the driver, so that the I/O operation can be terminated correctly.
The standard adjustment for the EOS byte is 0x0h. |
| |
 |
Terminate Reading Operations with EOS
Some devices transmit a EOS byte, in order to indicate the last byte of a data
message. If this option is activated, the GPIB card terminates a reading operation,
as soon as a EOS byte will receive.
This option is according to standard not activated. |
| |
 |
Set EOI with EOS during Writing Operations Wenn diese Option aktiviert ist, setzt die GPIB-Karte die
If this option is activated, the GPIB card sets the EOI line, if the EOS character
is discovered during a write operation.
This option is according to standard not activated. |
| |
 |
7 / 8-bit Comparison with EOS
If one or both of the previous options is activated, the type of the comparison of
the data stream with the EOS byte can be determined with this option. Either all
eight bits can be compared or only the lower 7 bits.
The standard adjustment is 7 bits. |
| |
 |
Set EOI with the Last Byte of a Writing Operation
Some devices need as a listener that the speaker terminates a data message, by
setting the EOI line, if the last byte of the message is transmitted. If this
option is activated, the GPIB card sets EOI with the last data byte.
This option is according to standard activated. |
| |
 |
System Controller (only card adjustments)
This option is valid only for card adjustments. The systems Controller in a GPIB
system is the device, which monitors and controls the bus. It should be at the
most one device system Comtroller in a GPIB system. In some situations, e.g. if a
computer network is connected with the GPIB card, another device system Controller
can be and the GPIB card should not the system Controller be appointed. If this
option is activated, the card can exercise system Controller abilities.
Generally this option should be activated; this is the standard adjustment. |
| |
 |
Set REN at SC (only card adjustments)
If this option is activated, remote Enable (REN) is set automatically, as soon as
the card on-line is switched and system is Controller (SC). If the option is not
activated, REN must be set explicitly with a call of ibsre.
The option is according to standard switched off. |
| |
 |
Enable Automatic Serial Polling (only card adjustments)
This option checks whether devices are queried by automatic serial Polling, if the
GPIB service Request (SRQ) is set to line. Positive Polling responses is stored
after the Polling and can be read with ibsrp the function. See ibsrp for further
information. Normally this option will not lead to conflicts with devices,
which are conformal IEEE-488. If conflicts occur nevertheless, the option
should be switched off.
This option is according to standard switched off.
Note: If those is to be used ON SRQ characteristic of the driver, this
option must be deactivated. |
| |
 |
ICC LOG (only card adjustments)
If a device call has taken place, after the control was transferred to another
device and the ICC LOG is activated, the GPIB card will SRQ with a serial polling
status of 0x42. Then the Controller momentary should interpret this signal in such
a way that the card would like to regain control. If the Controller momentary
delivers the control to the card, the device call continues as planned. If the
control is not returned during Timeout time, an ECIC error is generated. If the
ICC LOG is switched off, an ECIC error is returned immediately, whether after the
delivery of the control a device call has taken place.
This option is according to standard activated. |
| |
 |
GPIB Bus Timing (only card adjustments)
GPIB bus timing specifies the delay T1 for the Source handshake ability of the
card. This delay determines offense minimum time that has to pass after RFD,
before the card may set DAV during a writing or command operation. If the entire
length of the GPIB cable is smaller than 15 meters, a value of 350ns is
appropriate.
The standard adjustment is 500 ns. |
| |
 |
Repeated Addressing (only device adjustments)
Normally a device is addressed again every time a writing or a reading operation
is executed. If this option is deactivated, the device is not addresssed again
during each writing or reading reading, if the same operation was executed with
the same device before. This saves time, if several GPIB operations are
successively executed. |
| |
 |
Interrupt Adjustments (only card adjustments)
This adjustment specifies the Interrupt used by the GPIB card.
It must correspond with the interrupt which is actually used by the card.
|
| |
 |
Basic I/O Address (only card adjustments)
This adjustment specifies the base I/O address used by the GPIB card.
It must correspond with the base I/O address actually used by the card.
|
| |
 |
DMA (direct memory access) Channel (only card adjustments)
This specifies the DMA (direct memory access) channel used by the GPIB card.
It must correspond with the DMA (direct memory access) channel actually used by
the card. |
|
| Dynamic Reconfiguration of Device- and Card Characteristics |  |
|
|
At run time the configuration parameters can be modified by devices
and cards with various functions. These functions are specified in table 4.
Functions to Modify the Standard Adjustments of the GPIB System |
| Characteristic |
Dynamically changeable with &hellip |
| Primary GPIB Address |
ibpad |
| Secondary GPIB Address |
ibsad |
| End-Of-String (EOS) Byte |
ibeos |
| 7 / 8-Bit Comparison with EOS |
ibeos |
| Set EOI with EOS during Writing Operation |
ibeos |
| Terminate Reading Operation with EOS |
ibeos |
| Set EOI with the Last Byte of a Writing Operation |
ibeot |
| Modify Card Assignment |
ibbna |
| Turn on / Turn off DMA |
ibdma |
| Modify Timeout Value |
ibtmo |
| Modify System Control |
ibrsc |
The function ‘ibconfig’
can modify these and almost all other parameters dynamically at run-time. |
| Introduction to the GPIB Functions |  |
|
|
The BitCtrl Systems GPIB functions orientate itself in naming and
mode of operation at the industry standard for GPIB software, the NI-488 package from
National Instruments. |
| Device Functions and Card Functions |  |
|
|
The functions included in this library are at one hand device
functions that work on a high level of abstraction and hide a majority of the GPIB
administration operations and on the other hand the card functions which enable any
even rudimentary operations on the GPIB. Normally for most applications only a few
device functions are needed. Device function are powerful and easy to learn and use.
Card function offer a more of flexibility, however they require more expenditure of
the programer since large sections of the addressing and the bus administration
must be programed.
In general the following relation between device functions and card
functions may be stated: A device function can be replaced by several card
functions. |
| Open Cards and Devices |  |
|
|
The first step before the use of a BitCtrl Systems GPIB function is
the procurement of unit descriptors for all cards and devices. They are addressed as
follows. The unit descriptor udis the general name for for the device or card
descriptor which is returned either by the ibfindor the ibdevfunction.
A unit descriptor for a device is the first argument of a device function. A unit
descriptor for a card is the first argument of a card function. Some function are
both device and card functions.
 |
ibfind
Ibfind returns an unit descriptor associated with a device or card name and
must be called before any other function. If the software is installed, an internal
table in the driver contains descriptions of cards and devices in the GPIB system
including a symbolic name. The ibfind function locates a card or device by
using the appropriate symbolic name which is something like gpib0, gpib1.dev1
or gpib0.scope. |
| |
 |
ibdev
Ibdev is an alternative to the ibfind function. Ibdev returns a
unit descriptor for a device. This function is used if the symbolic name is
insignificant and the values of the configurable parameters are indicated. |
|