6504 Bridge Point Parkway
Austin, TX 78730-5039
(512) 794-0100
Technical support fax: (800) 328-2203
(512) 794-5678
Branch Offices:
Australia (03) 879 9422, Austria (0662) 435986, Belgium 02/757.00.20,
Canada (Ontario) (519) 622-9310, Canada (Québec) (514) 694-8521,
Denmark 45 76 26 00, Finland (90) 527 2321, France (1) 48 14 24 24,
Germany 089/741 31 30, Italy 02/48301892, Japan (03) 3788-1921,
Netherlands 03480-33466, Norway 32-848400, Spain (91) 640 0085,
Sweden 08-730 49 70, Switzerland 056/20 51 51, U.K. 0635 523545
Limited Warranty
The GPIB-PC is warranted against defects in materials and workmanship
for a period of two years from the date of shipment, as evidenced by
receipts or other documentation. National Instruments will, at its option,
repair or replace equipment that proves to be defective during the warranty
period. This warranty includes parts and labor.
The media on which you receive National Instruments software are
warranted not to fail to execute programming instructions, due to defects in
materials and workmanship, for a period of 90 days from date of shipment,
as evidenced by receipts or other documentation. National Instruments will,
at its option, repair or replace software media that do not execute
programming instructions if National Instruments receives notice of such
defects during the warranty period. National Instruments does not warrant
that the operation of the software shall be uninterrupted or error free.
A Return Material Authorization (RMA) number must be obtained from the
factory and clearly marked on the outside of the package before any
equipment will be accepted for warranty work. National Instruments will
pay the shipping costs of returning to the owner parts which are covered by
warranty.
National Instruments believes that the information in this manual is
accurate. The document has been carefully reviewed for technical
accuracy. In the event that technical or typographical errors exist, National
Instruments reserves the right to make changes to subsequent editions of
this document without prior notice to holders of this edition. The reader
should consult National Instruments if errors are suspected. In no event
shall National Instruments be liable for any damages arising out of or
related to this document or the information contained in it.
EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO
WARRANTIES
ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE
CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF
, EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS
. CUSTOMER'S RIGHT TO RECOVER DAMAGES
NATIONAL
INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE
PAID BY THE CUSTOMER
LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA
USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES,
EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation of the
. NATIONAL INSTRUMENTS WILL NOT BE
, PROFITS,
liability of National Instruments will apply regardless of the form of action,
whether in contract or tort, including negligence. Any action against
National Instruments must be brought within one year after the cause of
action accrues. National Instruments shall not be liable for any delay in
performance due to causes beyond its reasonable control. The warranty
provided herein does not cover damages, defects, malfunctions, or service
failures caused by owner's failure to follow the National Instruments
installation, operation, or maintenance instructions; owner's modification of
the product; owner's abuse, misuse, or negligent acts; and power failure or
surges, fire, flood, accident, actions of third parties, or other events outside
reasonable control.
Copyright
Under the copyright laws, this publication may not be reproduced or
transmitted in any form, electronic or mechanical, including photocopying,
recording, storing in an information retrieval system, or translating, in
whole or in part, without the prior written consent of National Instruments
Corporation.
Trademarks
Product and company names listed are trademarks or trade names of their
respective companies.
WARNING REGARDING MEDICAL AND
CLINICAL USE OF NATIONAL
INSTRUMENTS PRODUCTS
National Instruments products are not designed with components and
testing intended to ensure a level of reliability suitable for use in treatment
and diagnosis of humans. Applications of National Instruments products
involving medical or clinical treatment can create a potential for accidental
injury caused by product failure, or by errors on the part of the user or
application designer. Any use or application of National Instruments
products for or involving medical or clinical treatment must be performed
by properly trained and qualified medical personnel, and all traditional
medical safeguards, equipment, and procedures that are appropriate in the
particular situation to prevent serious injury or death should always
continue to be used when National Instruments products are being used.
National Instruments products are NOT intended to be a substitute for any
form of established process, procedure, or equipment used to monitor or
safeguard human health and safety in medical or clinical treatment.
Preface
Introduction to the GPIB
The GPIB is a link, or bus, or interface system, through which
interconnected electronic devices communicate.
History of the GPIB
The original GPIB was designed by Hewlett-Packard (where it is called
the HP-IB) to connect and control programmable instruments
manufactured by Hewlett-Packard. Because of its high data transfer
rates of from 250 kilobytes to 1 megabyte per second, the GPIB quickly
gained popularity in other applications such as intercomputer
communication and peripheral control. It was later accepted as the
industry standard IEEE-488. The versatility of the system prompted the
name General Purpose Interface Bus.
National Instruments expanded the use of the GPIB among users of
computers manufactured by companies other than Hewlett-Packard.
National Instruments specialized both in high performance, high-speed
hardware interfaces, and in comprehensive, full-function software that
helps users bridge the gap between their knowledge of instruments and
computer peripherals and of the GPIB itself.
The GPIB-PC Family
The GPIB-PC family consists of GPIB interface hardware products,
software, documentation, and other items for several types of personal
computers.
What Your Package Should Contain
Unless you have a special application, your GPIB-PC package consists
of the following:
• A GPIB-PC interface board for your personal computer. Each
board has a model name such as GPIB-PCIIA. This manual uses
GPIB-PC to refer generally to all models of the GPIB-PC
interface board.
•A Getting Started with your GPIB-PC pamphlet. The pamphlet
contains the directions with a minimum of explanations for
installing your hardware and software in your GPIB system.
• A GPIB-PC distribution diskette. The distribution diskette is part
of the GPIB-PC package. It contains the DOS handler, BASICA
and QuickBASIC language interfaces, and other programs.
•A GPIB-PC User Manual. The manual contains descriptions of
the GPIB-PC handler functions, BASICA, and QuickBASIC
language interfaces to the handler.
•A Programmer Reference Guide for BASIC.
• A supplement to Section Two of the manual describing your
particular interface board and how to install it in your personal
computer.
For a language other than BASICA and QuickBASIC, you also need:
• An additional GPIB-PC distribution diskette containing the
software for that language.
• A supplement to Section Four describing the GPIB functions in
the syntax and semantics of that language.
• A Programmer Reference Guide for that language.
Who Are Our Users?
Most of our users have experience in technological fields and with
computers.
How to Get Started
If you already have experience with the GPIB, you may wish to turn
directly to the Getting Started with your GPIB-PC pamphlet that was
shipped with your hardware. It contains directions, with a minimum of
explanations, for installing your hardware and software in your GPIB
system.
If you are less experienced or want more information than the pamphlet
provides, read this GPIB-PC User Manual. It explains in detail all of the
information you will need for the proper operation of the GPIB-PC.
This manual is written specifically for a GPIB-PC which is to be
installed in an IBM Personal Computer or compatible PC which is
operating under PC-DOS or MS-DOS and programmed using BASICA
and QuickBASIC. With appropriate supplements to the manual, other
GPIB-PC interfaces can be installed in other computers, using other
programming languages.
Organization of the Manual
Section One - Operation of the GPIB describes the operation of the
GPIB.
Section Two - Installation and Configuration describes the installation of
the software and the configuration program IBCONF. A supplement
contains instructions for installing your particular board into your
computer.
Section Three - GPIB-PC Functions — Introduction introduces you to the
functions used by your GPIB-PC. The features are divided into groups
as a means of helping you understand the uses of the functions.
Section Four - GPIB-PC Functions — Overview introduces you to
programming information common to all languages.
Section Four A - Function Reference — Language Interface(s) pertains to
BASICA and QuickBASIC. The descriptions are listed alphabetically
for easy reference.
Section Five - IBIC introduces you to IBIC, the interactive control
program that allows you to control and communicate with the GPIB
through functions you enter at your keyboard. IBIC is designed to help
you learn how to use the GPIB-PC functions to program your devices.
Section Six - Applications Monitor introduces you to the applications
monitor, a resident program that is useful in debugging sequences of
GPIB calls from within your application.
Appendix A - Multiline Interface Messages is a listing of Multiline
Interface Command Messages.
Appendix B - Common Errors and Their Solutions singles out the most
common errors users have encountered and some probable solutions.
Appendix C - Differences Between Software Revisions points out
differences between revisions of the GPIB-PC handler.
Appendix D - Using your Printer with the GPIB-PC gives some quick
steps to connect your GPIB-PC with your printer.
Appendix E - Application Notes is an application note about computerto-computer transfers.
Appendix F - Customer Communication contains forms you can use to
request help from National Instruments or to comment on our products
and manuals.
The Glossary contains an alphabetical list and description of terms used
in this manual, including abbreviations, acronyms, metric prefixes,
mnemonics, and symbols.
The Index contains an alphabetical list of key terms and topics in this
manual, including the page where you can find each one.
Now, with your personal computer, your GPIB-PC, your manuals and
supplements, and these instructions, you are ready to get started with
your GPIB. We hope your experience will be a rewarding one.
Customer Support
National Instruments wants to receive your comments on our products
and manuals. We are interested in the applications you develop with
our products, and we want to help if you have problems with them. For
information on how to contact us, refer to Appendix F, Customer
Communication between interconnected devices is achieved by passing
messages through the interface system.
Types of Messages
The GPIB carries two types of messages — device-dependent messages
and interface messages.
• Device-dependent messages, often called data or data messages,
contain device-specific information such as programming
instructions, measurement results, machine status, and data files.
• Interface messages manage the bus itself. They are usually
called commands or command messages. Interface messages
perform such functions as initializing the bus, addressing and
unaddressing devices, and setting device modes for remote or
local programming.
The term command as used here should not be confused with some
device instructions which can also be called commands. Such devicespecific instructions are actually data messages.
Talkers, Listeners, and Controllers
A Talker sends data messages to one or more Listeners. The Controller
manages the flow of information on the GPIB by sending commands to
all devices.
Devices can be Listeners, Talkers, and/or Controllers. A digital
voltmeter, for example, is a Talker and may be a Listener as well.
The GPIB is a bus like an ordinary computer bus except that the
computer has its circuit cards interconnected via a backplane bus
whereas the GPIB has standalone devices interconnected via a cable
bus.
The role of the GPIB Controller can also be compared to the role of the
computer's CPU, but a better analogy is to the switching center of a city
telephone system.
The switching center (Controller) monitors the communications network
(GPIB). When the Controller notices that a party (device) wants to
make a call (send a data message), it connects the caller (Talker) to
the receiver (Listener).
The Controller usually addresses a Talker and a Listener before the
Talker can send its message to the Listener. After the message is
transmitted, the Controller usually unaddresses both devices.
Some bus configurations do not require a Controller. For example, one
device may always be a Talker (called a Talk-only device) and there
may be one or more Listen-only devices.
A Controller is necessary when the active or addressed Talker or
Listener must be changed. The Controller function is usually handled by
a computer.
With the GPIB-PC interface board and its software, your personal
computer plays all three roles:
•Controller - to manage the GPIB,
•Talker - to send data, and
•Listener - to receive data.
The Controller-In-Charge and System Controller
Although there can be multiple Controllers on the GPIB, only one
Controller at a time is active, or Controller-In-Charge (CIC). Active
control can be passed from the current CIC to an idle Controller. Only
one device on the bus, the System Controller, can make itself the CIC.
The GPIB-PC is usually the System Controller.
The interface system consists of 16 signal lines and 8 ground return or
shield drain lines.
The 16 signal lines are divided into the following three groups:
•8 data lines,
•3 handshake lines, and
•5 interface management lines.
Data Lines
The eight data lines, DIO1 through DIO8, carry both data and command
messages. All commands and most data use the 7-bit ASCII or ISO
code set, in which case the 8th bit, DIO8, is unused or used for parity.
Handshake Lines
Three lines asynchronously control the transfer of message bytes
between devices:
•NRFD,
•NDAC, and
•DAV.
The process is called a three-wire interlocked handshake and it
guarantees that message bytes on the data lines are sent and received
without transmission error.
NRFD (not ready for data)
NRFD indicates when a device is ready or not ready to receive a
message byte. The line is driven by all devices when receiving
commands and by Listeners when receiving data messages.
NDAC indicates when a device has or has not accepted a message byte.
The line is driven by all devices when receiving commands and by
Listeners when receiving data messages.
DAV (data valid)
DAV tells when the signals on the data lines are stable (valid) and can
be accepted safely by devices. The Controller drives DAV lines when
sending commands and the Talker drives DAV lines when sending data
messages.
Interface Management Lines
Five lines are used to manage the flow of information across the
interface:
•ATN,
•IFC,
•REN,
•SRQ, and
•EOI.
ATN (attention)
The Controller drives ATN true when it uses the data lines to send
commands and false when it allows a Talker to send data messages.
IFC (interface clear)
The System Controller drives the IFC line to initialize the bus and
become CIC.
REN (remote enable)
The System Controller drives the REN line, which is used to place
devices in remote or local program mode.
Any device can drive the SRQ line to asynchronously request service
from the Controller.
EOI (end or identify)
The EOI line has two purposes. The Talker uses the EOI line to mark
the end of a message string. The Controller uses the EOI line to tell
devices to identify their response in a parallel poll.
Physical and Electrical Characteristics
Devices are usually connected with a cable assembly consisting of a
shielded 24-conductor cable with both a plug and receptacle connector
at each end. This design allows devices to be linked in either a linear
or a star configuration, or a combination of the two. See Figures 1.1,
1.2, and 1.3.
The standard connector is the Amphenol or Cinch Series 57
MICRORIBBON or AMP CHAMP type. An adapter cable using nonstandard cable and/or connector is used for special interconnect
applications.
The GPIB uses negative logic with standard TTL logic level. When
DAV is true, for example, it is a TTL low-level ( ≤ 0.8V), and when
DAV is false, it is a TTL high-level ( ≥ 2.0V).
To achieve the high data transfer rate that the GPIB was designed for,
the physical distance between devices and the number of devices on the
bus are limited.
The following restrictions are typical.
• A maximum separation of four meters between any two devices
and an average separation of two meters over the entire bus.
• A maximum total cable length of 20 meters.
• No more than 15 devices connected to each bus, with at least
two-thirds powered on.
Bus extenders are available from National Instruments and other
manufacturers for use when these limits must be exceeded.
Related Documents
For more information on topics covered in this section consult the
following related documents.
• IEEE Std. 488-1978, IEEE Standard Digital Interface forProgrammable Instrumentation.
The procedures for installing your GPIB-PC depend on your model of
board and your make of computer. A supplement to Section Two
contains information about your interface board. Section Two A, for
example, contains information about the model GPIB-PCIIA for the IBM
PC and compatible computers.
Installing the Hardware
To install your hardware, follow the instructions in the Section Two
supplement for your interface board.
If you change the default settings of any switches, make a note of the
new values so that you can refer to them when you configure your
software.
Install the hardware before continuing.
The GPIB-PC Software Package
Before you install your software, you might wish to review the files on
your GPIB-PC distribution diskette to gain an understanding of what
they are.
The following files are the main files of the GPIB-PC software:
•GPIB.COM - is a device handler file that is loaded at system
start-up by the DOS operating system. Handler is a term used
by National Instruments to refer to a loadable device driver.
•BIB.M - is a language interface file that provides an
application program access to the GPIB-PC handler. BIB.M is
intended for use with programs written in BASICA.
•QBIB*.OBJ - is a language interface file that provides an
application program access to the GPIB-PC handler.
QBIB*.OBJ is intended for use with programs written in
QuickBASIC.
•DECL.BAS - is a declaration file that contains code to be
placed at the beginning of the BASICA and QuickBASIC
application programs.
•QBDECL.BAS - is a declaration file that contains code to be
placed at the beginning of the QuickBASIC application
programs.
Additional Programs and Files
The following additional programs and files include installation, test,
and example programs:
•APPMON.COM - is the applications monitor program. It is a
resident program that is useful in debugging sequences of GPIB
calls from within your application. The applications monitor
provides the capability to trap on return from GPIB driver calls,
allowing you to inspect function arguments, buffers, return
values, GPIB global variables, and other pertinent data.
•IBTRAP.EXE - is a program that configures the applications
monitor.
•IBSTART.BAT - is a batch file used for installation and start-
up. It is a multipurpose program that performs the software
installation. It copies files, modifies CONFIG.SYS (the DOS
system configuration file) using MKCFG.EXE, and tests the
hardware using IBDIAG.EXE.
•IBDIAG.EXE - is a program that tests the hardware installation
before the GPIB software is configured and installed. After the
handler is installed, IBTEST.BAT confirms that both the
software and hardware are installed and functioning properly.
The test is executed in two parts using IBTSTA.EXE and
IBTSTB.EXE.
•IBCONF.EXE - is a software configuration program that allows
you to change the software parameters and other data used by
the handler.
•IBIC.EXE - is an interactive control program that allows you
to execute the handler functions interactively from your
keyboard. It helps you to learn the functions, to program your
instrument or other GPIB device, and to develop your
application program.
DIBSAMP - are example programs for BASICA, QuickBASIC,
and IBIC. The BASICA and QuickBASIC supplement of the
manual, Section Four A, contains additional examples.
Installing the Software
The term boot disk refers to the hard disk or floppy disk that contains
DOS and that is read by your computer when it is booted. The term
boot refers to the action of loading DOS into your system from your boot
disk, either when power is applied or when the warm boot keys are
pressed.
Step 1 - Preparation
Your first step is determined by whether you wish to boot from a floppy
disk or a hard disk. Perform the step that applies to your system.
Booting from a Floppy Disk
If you boot DOS from a floppy diskette, you need a boot disk with
enough free space to hold a copy of the GPIB-PC software contained on
the distribution diskette.
Insert the boot diskette into the first drive (usually named A:) and the
distribution diskette into the second drive (B:). Boot your system if you
have not already done so.
Booting from a Hard Disk
If you boot DOS from a hard disk, you need a personal computer with
one floppy drive. The hard disk must have enough free space to hold a
copy of the GPIB-PC software contained on the distribution diskette.
Boot your system. Then, insert the distribution diskette into the floppy
drive.
Finally, IBSTART advises you to complete the following actions:
•Run IBCONF if you must reconfigure the software;
•Reboot your system to load the handler into DOS; and
•Run IBTEST to test the installation of the software.
Step 3 - Run IBCONF (optional)
The pamphlet Getting Started with your GPIB-PC that comes with your
interface board explains when you must run IBCONF to reconfigure the
software. You may also run IBCONF to examine how the software is
configured.
See More About
run IBCONF and on the configurable software parameters.
NOTE: You must run IBCONF if you have a PCIIA, or wish to change
defaults.
IBCONF
later in this section for information on how to
Step 4 - Reboot
Reboot your computer from the drive you specified when you ran
IBSTART so that DOS will load the GPIB-PC handler.
Step 5 -Test Software Installation
Run IBTEST from the directory GPIB-PC in your boot area by entering:
cd gpib-pc
ibtest
IBTEST tests whether the handler is installed and functioning with the