Click here to Skip to main content
15,850,265 members
Articles / Programming Languages / C++

Add GPIB Support to Your Desktop

Rate me:
Please Sign up or sign in to vote.
4.60/5 (11 votes)
12 Dec 20034 min read 117.6K   2.7K   38   15
Add General Purpose Interface Bus (GPIB) capabilities to your desktop computer for measuring purposes.

Command/Query GPIB Demo


GPIB is an abbreviation of General Purpose Interface Bus, and is a digital 8-bit parallel communications interface with data transfer rates up to 1 Mbyte/s. The bus supports one System Controller, usually a computer, and up to 15 additional instruments. Because the GPIB is an 8-bit parallel interface with fast data transfer rates, it gained popularity in other applications such as intercomputer communication and peripheral control.

The IEEE-488 (GPIB) bus was developed to connect and control programmable instruments, and to provide a standard interface for communication between instruments from different sources. Hewlett Packard (today the Test & measurement's division's name is Agilent Technologies) originally developed the interfacing technique, and called it HP-IB. The interface quickly gained popularity in the computer industry. Because the interface was so versatile, the IEEE committee renamed it GPIB.

The intention was to create a reliable bus system especially designed for connecting computers and instruments. This networked system has all features that are required to create a measurement system. Remote control of instruments is one aspect of these features, but there are other more important features like data handshake for reliable operation and real-time response capability, only to name a few.

IEEE-488 Overview

Almost any instrument can be used with the IEEE-488 specification, because it says nothing about the function of the instrument itself, or about the form of the instrument's data. Instead, the specification defines a separate component, the interface, that can be added to the instrument. The signals passing into the interface from the IEEE-488 bus and from the instrument are defined in the standard. The instrument does not have complete control over the interface. Often the bus controller tells the interface what to do. The Active Controller performs the bus control functions for all the bus instruments.

IEEE Standard 488.2-1987 encouraged a new level of growth and acceptance of the IEEE 488 bus or GPIB by addressing problems that had arisen from the original IEEE 488 standard. IEEE 488.2 was drafted on the premise that it stay compatible with the existing IEEE 488.1 standard. The overriding concept used in the IEEE 488.2 specification for the communication between Controllers and instruments is that of "precise talking" and "forgiving listening". In other words, IEEE 488.2 exactly defined how both IEEE 488.2 Controllers and IEEE 488.2 instruments talk so that a completely IEEE 488.2-compatible system can be highly reliable and efficient. The standard also required that IEEE 488.2 devices be able to work with existing IEEE 488.1 devices by accepting a wide range of commands and data formats as a Listener. You obtain the true benefits of IEEE 488.2 when you have a completely IEEE 488.2-compatible system.

The SCPI specification expanded the IEEE 488.2 common command set by defining a single, comprehensive command set suitable for all instruments. For example, all SCPI-compatible voltmeters, regardless of manufacturer or model, respond to the same command for reading AC voltage. Their response format is also the same. SCPI embraces many of the commands and protocols that the hardware-independent portion of the IEEE 488.2 standard defines. Figure 2 shows the structure of the GPIB standards.

Following image shows the structure of GPIB standard:

GPIB Structure - Taken from National Instruments Web Site (

How we can use GPIB?

For using GPIB features to redirect captured data from an electronic device (like a simple voltmeter or a very complex spectrum analyzer), you must have a GPIB interface card, a IEEE-488 cable and a single PC!

Following pictures show AXIOM GPIB interface card and IEEE-488 cable to connect measurement device to PC.

AXIOM AX5488 GPIB Interface Card

AXIOM AX5488 GPIB Interface Card (Used in this project)

IEEE-488 cable for connecting GPIB interface card to GPIB capable device

In this project, I use Tektronix TDS2024 Digital Oscilloscope. Following picture shows the device:

Digital Oscilloscope

Every measurement device has a complete list of commands and queries to redirect the captured data from the device and transfer it to the PC. For getting the list of these commands or queries, you must read the device programming manual. Notice that commands are different for different devices.


The IEEE-488.1 standard greatly simplified the interconnection of programmable instruments by clearly defining mechanical, hardware, and electrical protocol specifications. For the first time, instruments from different manufactures were connected by a standard cable. This standard does not address data formats, status reporting, message exchange protocol, common configuration commands, or device specific commands.

The IEEE-488.2 standard enhances and strengthens the IEEE-488.1 standard by specifying data formats, status reporting, error handling, controller functionality, and common instruments commands. It focuses mainly on the software protocol issues and thus maintains compatibility with the hardware- oriented IEEE-488.1 standard. IEEE-488.2 systems tend to be more compatible and reliable.

For more information about GPIB Hardware and Software Specifications, click here.



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Written By
CEO Solaris Electronics LLC
United Arab Emirates United Arab Emirates
I was born in Shiraz, a very beautiful famous city in Iran. I started programming when I was 12 years old with GWBASIC. Since now, I worked with various programming languages from Basic, Foxpro, C/C++, Visual Basic, Pascal to MATLAB and now Visual C++.
I graduated from Iran University of Science & Technology in Communication Eng., and now work as a system programmer for a telecommunication industry.
I wrote several programs and drivers for Synthesizers, Power Amplifiers, GPIB, GPS devices, Radio cards, Data Acquisition cards and so many related devices.
I'm author of several books like Learning C (primary and advanced), Learning Visual Basic, API application for VB, Teach Yourself Object Oriented Programming (OOP) and etc.
I'm winner of January, May, August 2003 and April 2005 best article of month competition, my articles are:

You can see list of my articles, by clicking here

Comments and Discussions

QuestionCan you help me communication Equipment used GPIB Pin
Cuong Nguyen Hung25-Jul-19 22:16
Cuong Nguyen Hung25-Jul-19 22:16 
QuestionDriver for AX5488 Pin
UbaldoPrones31-May-17 3:58
UbaldoPrones31-May-17 3:58 
QuestionHow to build code for GPIB NI-488.2 (National Instrument ) Pin
manzoor2317-Sep-08 9:20
manzoor2317-Sep-08 9:20 
GeneralLink to driver is broken Pin
holgerl5-Jun-06 23:04
holgerl5-Jun-06 23:04 
AnswerRe: Link to driver is broken Pin
Abbas_Riazi6-Jun-06 6:08
professionalAbbas_Riazi6-Jun-06 6:08 
GeneralAbout New GPIB Card Driver for Windows!! Pin
Ensign Yeh3-Jun-04 22:35
sussEnsign Yeh3-Jun-04 22:35 
GeneralRe: About New GPIB Card Driver for Windows!! Pin
Abbas_Riazi4-Jun-04 3:09
professionalAbbas_Riazi4-Jun-04 3:09 
GeneralRe: About New GPIB Card Driver for Windows!! Pin
Ensign Yeh7-Jun-04 19:35
sussEnsign Yeh7-Jun-04 19:35 
Questionwhat have you done is very useful to me! Pin
samxuysu1-Jun-04 22:42
samxuysu1-Jun-04 22:42 
AnswerRe: what have you done is very useful to me! Pin
Abbas_Riazi2-Jun-04 1:56
professionalAbbas_Riazi2-Jun-04 1:56 
GeneralReading Data From Spectrum Analyser Pin
kdvyas8-Mar-04 20:06
kdvyas8-Mar-04 20:06 
GeneralRe: Reading Data From Spectrum Analyser Pin
Abbas_Riazi8-Mar-04 20:40
professionalAbbas_Riazi8-Mar-04 20:40 
GeneralRe: Reading Data From Spectrum Analyser Pin
kdvyas9-Mar-04 17:36
kdvyas9-Mar-04 17:36 
GeneralYou 'da man! Pin
Nitron14-Dec-03 12:02
Nitron14-Dec-03 12:02 
GeneralRe: You 'da man! Pin
Abbas_Riazi15-Dec-03 1:57
professionalAbbas_Riazi15-Dec-03 1:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.