GPIB / IEEE 488 Protocol, Commands & Operation

Notes and summary about the operation of the GPIB, or IEEE 4888 bus - how it works, the protocol used and the purposes of the various lines.


GPIB / IEEE 488 Bus Includes:
GPIB / IEEE 488 bus     GPIB operation / commands / protocol     IEEE 488.2     How to Use GPIB / IEEE 488     GPIB / IEEE 488 cables     GPIB / IEEE 488 connectors     GPIB / IEEE 488 pinout / pin connections    


The IEEE 488 bus uses levels based around the use of Schottky TTL and has a total of sixteen active lines.

These lines can be organised into three categories. Eight are used for data transfer, three are used for a comprehensive form of handshaking, and the remaining five are used for general bus management, carrying status and control information.

GPIB operation

The operation of GPIB is based around the handshaking protocol. Three lines, DAV (DAta Valid), NDAC (Not Data ACepted), and NRFD (Not Ready For Data), control this. All the listeners on the bus use the NRFD line to indicate their state of readiness to accept data. If one listener holds the line low then this prevents any data transfer being initiated. This means that when all the instruments are ready as indicated by the NRFD being line is high and then data can be transferred. Once all the instruments have released the NRFD line and it is in the high state, only then can the next stage be initiated.

Data is placed onto the data lines by the talker and once this has settled, the DAV line is pulled low. This signals to all the listeners that they are able to read the data that is present. During this operation the NDAC line will be held low by all the active listeners, i.e. those which have been instructed to receive the data. Only when they have read the data will each device stop trying to hold this line low. When the last device removes its hold, the level of the line will rise and the talker will know that all the data has been accepted and the next byte of data can be transferred.

GPIB / IEEE 488 handshaking protocol with DAV, NRDF and NDAC commands
GPIB / IEEE 488 handshaking protocol

By transferring data in this way the data is placed onto the bus at a rate which is suitable for the talker, and it is held until the slowest listener has accepted it. In this way the optimum data transfer rate is always used, and there are no specifications and interface problems associated with the speeds at which data must be transferred.

IEEE 488 bus management

In addition to the comprehensive handshaking system, the GPIB also incorporates a number of very useful bus management facilities, enabling the instruments on the bus to be controlled in a very flexible manner.

Each instrument has its own address. This enables the controller or talker to talk to a specific piece of equipment. It is obviously imperative that each piece of equipment has its own unique address on the bus. If not bus conflicts occur and the operation of the system will crash.

Often different types of instrument have their own default values set for GPIB at the factory during manufacture. However in all cases it must be possible to change the GPIB address either by changing switches on the outside of the equipment or the inside. Even though only fifteen units are allowed on the bus at any one time, addresses up to 31 are allowed. This enables a certain amount of flexibility in defining specific addresses for certain types of equipment within an organisation.

Within the GPIB there are a number of lines that are dedicated to signalling and control on the bus:

  • Attention, ATN line:   One of the most important lines is the ATN (Attention) line. Using this the controller is able to signal whether the data to be placed onto the data lines is control information or data. When the line is pulled low then the bus is said to be in command mode and bus commands may be placed onto the bus. These commands are the same for all bus systems and each device is programmed to respond to any commands that have a useful or applicable meaning. One of the most common bus commands is to give the address of an instrument to which data is about to be sent. In addition to this when the line is pulled low it causes any talker to relinquish its control of the DAV line and cease its data transmission. Another result is that all listeners whether active or not will listen to the control data being transmitted.

    When the ATN line is high the bus is said to be in data mode and data transfers between the instruments can take place. In command mode not all the data lines are used. Bit seven is ignored, whilst bits five and six indicate the type of information to be transmitted. It may be a bus command, a talk address, or a listen address.
  • Interface Clear, IFC;   The IFC line is used by the controller to reset the bus and place it into its quiescent state. Any talker or listener which is active is stopped and control is returned to the controller. This is not used in the course of normal operation. However it can be used when the system needs re-setting or at initial power up when the bus may be in a random state.
  • Remote Enable, REN:   Remote enable (REN) is a function that is used by the controller to set instruments on the bus to local i.e. front panel control or to bus control. Bus controlled instruments may be returned to their local state by a go to local message sent in conjunction with the ATN line being pulled low.
  • End or Identify, EOI:   End or Identify (EOI) is an optional GPIB function used to signify the end of a multiple byte data transfer. As an alternative, talkers can use a carriage return or carriage return line feed to terminate the message. This can then be interpreted by the controlled dependent upon how its software is configured.
  • Service Request, SRQ   The next control line is SRQ or service request. Any device fitted with this function can pull the service request line low. When this happens it indicates that it wants to interrupt the current activities so that attention can be given to a particular event. One instance where this facility is needed is when a printer runs out of paper, or in another instance, an instrument may be overloaded or "over-ranged". Once the SRQ line has been pulled low, the controller then has to identify which instrument has caused the interrupt. A process called polling accomplishes this. Essentially this just requests status information from the devices on the bus.

Each of these lines provides an important function on the line. Having dedicated lines for these functions ensures that the handshaking on the interface is swift and does not have to rely on embedded messages that would take longer to action.

GPIB Polling

There are two ways in which instruments on GPIB can be polled. One is called parallel polling and the other is serial.

Parallel polling can only operate with up to eight instruments. This is because each of the devices will return a status bit one of the eight data lines. To assert a parallel poll the controller pulls the ATN and EOI lines low. When this occurs each instrument responds by transmitting a one-bit status report.

A serial poll is more flexible but takes longer to accomplish. Here the controller sends each of the instruments a serial poll enable command in turn. This is one of the GPIB commands that can be sent when the ATN line is held low. When an instrument receives a serial poll enable it responds by returning eight bits of status information. When the controller has received the status data it sends a serial poll disable command and returns the bus and instruments on it to the normal data mode.

The advantage of a serial poll is that it is far more flexible and enables eight bits of data to be returned. However it is much slower because each instrument has to be polled in turn to find out which one pulled the SRQ line in the first place.

More Test Topics:
Data network analyzer     Digital Multimeter     Frequency counter     Oscilloscope     Signal generators     Spectrum analyzer     LCR meter     Dip meter, GDO     Logic analyzer     RF power meter     RF signal generator     Logic probe     PAT testing & testers     Time domain reflectometer     Vector network analyzer     PXI     GPIB     Boundary scan / JTAG     Data acquisition    
    Return to Test menu . . .