National Instruments GPIB-PC User Manual

GPIB-PC User Manual
for the
IBM Personal Computer and
Compatibles
April 1988 Edition
Part Number 320014-01
© Copyright 1984, 1994 National Instruments Corporation.
All Rights Reserved.
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.
©National Instruments Corp. v GPIB-PC User Manual
Preface
•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.
GPIB-PC User Manual vi ©National Instruments Corp.
Preface

About the Manual

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.
©National Instruments Corp. vi i GPIB-PC User Manual
Preface
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 computer­to-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, at the end of this manual.
GPIB-PC User Manual viii ©National Instruments Corp.

Contents

Section One - Operation of the GPIB................................................ 1-1
Types of Messages...................................................................................... 1-1
Talkers, Listeners, and Controllers ..................................................... 1-1
The Controller-In-Charge and System Controller......................... 1-2
GPIB Signals and Lines ........................................................................... 1-3
Data Lines..................................................................................... 1-3
Handshake Lines........................................................................ 1-3
NRFD (not ready for data).................................. 1-3
NDAC (not data accepted)................................. 1-4
DAV (data valid)..................................................... 1-4
Interface Management Lines............................................... 1-4
ATN (attention)........................................................ 1-4
IFC (interface clear).............................................. 1-4
REN (remote enable)............................................ 1-4
SRQ (service request)........................................... 1-5
EOI (end or identify).............................................. 1-5
Physical and Electrical Characteristics............................................ 1-5
Configuration Requirements................................................................... 1-9
Related Documents.................................................................................... 1-9
Section Two - Installation and Configuration............................ 2-1
Installing the Hardware............................................................................. 2-1
The GPIB-PC Software Package ......................................................... 2-1
Additional Programs and Files............................................ 2-2
Installing the Software .............................................................................. 2-3
Step 1 - Preparation.................................................................. 2-3
Booting from a Floppy Disk ............................... 2-3
Booting from a Hard Disk.................................... 2-3
Step 2 - Run IBSTART........................................................... 2-4
Step 3 - Run IBCONF (optional)....................................... 2-5
Step 4 - Reboot........................................................................... 2-5
Step 5 - Test Software Installation.................................... 2-5
More About IBCONF................................................................................. 2-6
Characteristics of the Instruments ..................................... 2-7
Characteristics of each GPIB-PC ...................................... 2-7
Default Configurations .............................................................................. 2-8
Primary Default Characteristics ......................................... 2-8
©National Instruments Corp. ix GPIB-PC User Manual
Contents
Running IBCONF ........................................................................................ 2-9
Upper and Lower Levels of IBCONF............................ 2-10
Upper Level - Device Map
for Board GPIBx.................................................... 2-10
Device Map Concepts and Terms ................ 2-11
Lower Level - Device/Board
Characteristics ....................................................... 2-11
Device and Board Characteristics.................................. 2-12
Primary GPIB Address ....................................... 2-12
Secondary GPIB Address.................................. 2-12
Timeout Settings................................................... 2-12
EOS Byte.................................................................. 2-14
EOS Modes.............................................................. 2-14
Set EOI with last byte of Write ..................... 2-14
GPIB-PC Model .................................................... 2-14
Board is System Controller
(Boards Only)......................................................... 2-14
Local Lockout on all Devices
(Boards Only)......................................................... 2-15
Disable Auto Serial Polling
(Boards Only)......................................................... 2-15
High-Speed Timing
(Boards Only)......................................................... 2-15
Interrupt Jumper Setting
(Boards Only)......................................................... 2-15
Base I/O Address (Boards Only)................... 2-15
DMA Channel (Boards Only)......................... 2-16
Internal Clock Frequency
(Boards Only)......................................................... 2-16
Exiting IBCONF...................................................................... 2-16
Using Your GPIB-PC .............................................................................. 2-18
Section Three - GPIB-PC Functions — Introduction
Introduction to the GPIB-PC Functions ............................................ 3-1
High-Level Functions .............................................................. 3-1
Low-Level Functions ............................................................... 3-1
Calling Syntax............................................................................ 3-1
Group I.. .. .. .... .. .................................................................................................. 3-2
IBRD (bd,buf,cnt) ..................................................................... 3-2
IBWRT (bd,buf,cnt)................................................................. 3-2
IBFIND (bdname,bd)............................................................... 3-3
GPIB-PC User Manual x ©National Instruments Corp.
............................................................................ 3-1
Contents
Group II............................................................................................................. 3-3
IB RS P (bd ,spr ) ........................................................................... 3-3
IBCLR (bd) .................................................................................. 3-4
Clearing the Device Versus
Clearing the GPIB................................................... 3-4
Clearing the Device ............................. 3-4
Clearing the GPIB................................. 3-4
IBTRG (bd) .................................................................................. 3-4
IBLOC (bd) .................................................................................. 3-4
Placing a Device in Remote Mode ................ 3-4
Placing a Device in Local Mode..................... 3-5
Group III..... ...................................................................................................... 3-5
IBRDA (bd,buf,cnt) and......................................................... 3-6
IBRDF (bd,buf,cnt) and ......................................................... 3-6
IBWAIT (bd,mask)................................................................... 3-6
IBSTOP (bd)................................................................................ 3-6
IBTMO (bd,v) ............................................................................. 3-7
IBONL (bd,v) .............................................................................. 3-7
IBPCT (bd)................................................................................... 3-7
Group IV........................................................................................................... 3-8
Purpose of Board Functions.................................................. 3-9
Multiboard Capability ............................................................. 3-9
IBFIND (bdname,bd)............................................................ 3-10
IBCMD (bd,buf,cnt) and..................................................... 3-10
IBRD (bd,buf,cnt) and ......................................................... 3-10
IBWRT (bd,buf,cnt) and..................................................... 3-12
IBSTOP (bd)............................................................................. 3-12
IBWAIT (bd,mask)................................................................ 3-12
IBTMO (bd,v) .......................................................................... 3-12
IBONL (bd,v) ........................................................................... 3-12
IBSIC (bd) ................................................................................. 3-12
IBSRE (bd,v)............................................................................ 3-13
IBGTS (bd,v)............................................................................ 3-13
IBCAC (bd,v)........................................................................... 3-13
IBRPP (bd,buf)........................................................................ 3-13
IBPPC (bd,v)............................................................................ 3-13
More About Device and Board Functions .................................... 3-14
Group V......................................................................................................... 3-15
IBRSV (bd,v)........................................................................... 3-15
IBLOC (bd) ............................................................................... 3-15
IBPPC (bd,v)............................................................................ 3-16
IBIST (bd,v).............................................................................. 3-16
IBWAIT (bd,mask)................................................................ 3-16
©National Instruments Corp. xi GPIB-PC User Manual
Contents
Group VI........................................................................................................ 3-17
IBEOT (bd,v)............................................................................ 3-17
IBEOS (bd,v)............................................................................ 3-18
IBBNA (bd,"GPIBn") ........................................................... 3-18
IBDMA (bd,v).......................................................................... 3-18
IBPAD (bd,v) ........................................................................... 3-18
IBSAD (bd,v) ........................................................................... 3-18
IBRSC (bd,v)........................................................................... 3-18
IBTMO (bd,v) .......................................................................... 3-18
Section Four - GPIB-PC Functions — Overview
General Programming Information ................................................... 4-1
Status Word................................................................................................. 4-2
Error Codes.................................................................................................. 4-6
Count Variable......................................................................................... 4-11
Read and Write Termination ............................................................ 4-11
Device Function Calls......................................................................... 4-12
Automatic Serial Polling .................................................................... 4-13
................................................................................. 4-1
Section Four A - BASICA/QuickBASIC GPIB-PC Function Calls
BASICA Files .......................................................................................... 4A-2
QuickBASIC Files ................................................................................. 4A-2
Programming Preparations for BASICA .................... 4A-3
Programming Preparations for QuickBASIC ........... 4A-4
BASICA/QuickBASIC GPIB-PC I/O Functions ...................... 4A-5
BASICA/QuickBASIC "ON SRQ" Capability.......................... 4A-6
New GPIB-PC Functions .................................................................. 4A-12
GPIB-PC Function Descriptions.................................................... 4A-15
IBBNA......................................................................................................................... 4A-16
IBCAC......................................................................................................................... 4A-17
IBCLR.......................................................................................................................... 4A-19
IBCMD........................................................................................................................ 4A-20
IBCMDA..................................................................................................................... 4A-23
IBDMA........................................................................................................................ 4A-25
IBEOS.......................................................................................................................... 4A-26
IBEOT.......................................................................................................................... 4A-30
IBFIND........................................................................................................................ 4A-32
IBGTS.......................................................................................................................... 4A-34
IBIST............................................................................................................................ 4A-36
IBLOC.......................................................................................................................... 4A-38
IBONL.......................................................................................................................... 4A-40
IBPAD.......................................................................................................................... 4A-42
......................................................................... 4A-1
GPIB-PC User Manual xii ©National Instruments Corp.
Contents
IBPCT .......................................................................................................................... 4A-44
IBPPC.......................................................................................................................... 4A-45
IBRD............................................................................................................................. 4A-47
IBRDA ........................................................................................................................ 4A-50
IBRDF.......................................................................................................................... 4A-54
IBRDI........................................................................................................................... 4A-57
IBRDIA........................................................................................................................ 4A-60
IBRPP.......................................................................................................................... 4A-64
IBRSC.......................................................................................................................... 4A-66
IBRSP.......................................................................................................................... 4A-68
IBRSV.......................................................................................................................... 4A-70
IBSAD.......................................................................................................................... 4A-71
IBSIC............................................................................................................................ 4A-73
IBSRE.......................................................................................................................... 4A-74
IBSTOP....................................................................................................................... 4A-76
IBTMO......................................................................................................................... 4A-78
IBTRAP....................................................................................................................... 4A-81
IBTRG.......................................................................................................................... 4A-83
IBWAIT....................................................................................................................... 4A-84
IBWRT........................................................................................................................ 4A-87
IBWRTA..................................................................................................................... 4A-90
IBWRTF..................................................................................................................... 4A-93
IBWRTI....................................................................................................................... 4A-95
IBWRTIA .................................................................................................................. 4A-99
BASICA/QuickBASIC GPIB
Programming Examples................................................................... 4A-103
BASICA Example Program - Device...................... 4A-105
BASICA Example Program - Board ........................ 4A-108
QuickBASIC Example Program - Device............. 4A-111
QuickBASIC Example Program - Board ............... 4A-114
Section Five - IBIC.............................................................................................. 5-1
Running IBIC................................................................................................. 5-2
Using HELP.................................................................................. 5-3
Using IBFIND.............................................................................. 5-3
Using IBWRT.............................................................................. 5-4
Using IBRD .................................................................................. 5-4
How to Exit IBIC ....................................................................... 5-5
Important Programming Note............................................... 5-5
Using SET ..................................................................................... 5-6
IBIC Functions and Syntax..................................................................... 5-7
Other IBIC Functions and Syntax........................................................ 5-8
Status Word................................................................................................. 5-10
Error Code.................................................................................................... 5-11
©National Instruments Corp. xiii GPIB-PC User Manual
Contents
Byte Count................................................................................................... 5-12
Auxiliary Functions ................................................................................. 5-12
SET (Select Device or Board)......................................... 5-13
HELP (Display Help Information).................................. 5-13
! (Repeat Previous Function) ........................................... 5-14
- (Turn OFF Display)............................................................ 5-14
+ (Turn ON Display)............................................................. 5-15
n* (Repeat Function n Times)......................................... 5-16
$ (Execute Indirect File) .................................................... 5-17
PRINT (Display the ASCII String) ................................ 5-18
E or Q (exit or quit)............................................................... 5-18
IBIC Sample Programs .......................................................................... 5-19
Device Function Calls......................................................... 5-19
Board Function Calls............................................................ 5-22
Section Six - Applications Monitor....................................................... 6-1
Installing the Applications Monitor .................................................... 6-2
IBTRAP.......................................................................................... 6-2
Applications Monitor Options................................................................ 6-5
Main Commands.......................................................................................... 6-6
Session Summary Screen ........................................................................ 6-7
Configuring the Trap Mask ..................................................................... 6-7
Configuring the Monitor Mode.............................................................. 6-7
Hiding and Showing the Monitor ....................................... 6-8
Appendix A - Multiline Interface Messages................................. A-1
Multiline Interface Messages................................................................ A-2
Interface Message Reference List....................................................... A-4
Appendix B - Common Errors and Their Solutions
EDVR(0).......................................................................................................... B-1
ECIC(1)............................................................................................................ B-1
ENOL(2).......................................................................................................... B-2
EADR(3).......................................................................................................... B-3
EARG(4).......................................................................................................... B-3
ESAC(5).......................................................................................................... B-4
EABO(6).......................................................................................................... B-4
ENEB(7).......................................................................................................... B-5
EOIP(10).......................................................................................................... B-5
ECAP(11)........................................................................................................ B-5
EFSO(12)........................................................................................................ B-5
EBUS(14)........................................................................................................ B-6
ESTB(15)........................................................................................................ B-6
GPIB-PC User Manual xiv ©National Instruments Corp.
............................................................................................. B-1
ESRQ(16)........................................................................................................ B-6
Other Error Conditions............................................................................... B-7
Appendix C - Differences Between Software Revisions
Revision B and Revision C .................................................................... C-1
Revision C and Revision D .................................................................... C-2
............................................................................................... C-1
Interrupts ........................................................................................ C-1
Startup Program.......................................................................... C-1
Configuration Program ............................................................ C-1
Interface Bus Interactive Control Program (IBIC) .... C-1
New Functions ............................................................................ C-2
Modified Functions................................................................... C-2
Language Interfaces ................................................................. C-2
General........................................................................................... C-2
Device Functions....................................................................... C-2
Non-Interrupt Mode................................................................... C-2
Asynchronous I/O....................................................................... C-3
DMA on the GPIB-PCIII ........................................................ C-3
Local Lockout ............................................................................. C-3
SRQI Status Bit.......................................................................... C-3
ATN and/or TIMO..................................................................... C-3
DCAS and DTAS Status Bits .............................................. C-3
Printer Support ............................................................................ C-3
Contents
Appendix D - Using your Printer with the GPIB-PC
Installation...................................................................................................... D-1
............................................................................................... D-1
Appendix E - Application Notes.............................................................. E-1
Application Note 1 - Computer to Computer
Data Transfer ................................................................................................. E-1
Step 1. Configure the Computers...................................... E-1
Step 2. Establish Communication .................................... E-1
Step 3. Transfer Data.............................................................. E-2
Appendix F - Customer Communication ....................................... F-1
Glossary......................................................................................................................... G-1
Index................................................................................................................................. I-1
©National Instruments Corp. xv GPIB-PC User Manual

Illustrations

List of Figures

Figure 1.1 - GPIB Connector and the Signal Assignment .........................1- 6
Figure 1.2 - Linear Configuration .......................................................................... 1-7
Figure 1.3 - Star Configuration ............................................................................... 1-8
Figure 3.1 - Multiboard GPIB System...............................................................3-11
Figure 6.1 - Applications Monitor Popup Screen...........................................6-1

List of Tables

Table 2.1 - Timeout Settings .................................................................................2-13
Table 2.2 - Functions that Alter Default Characteristics .........................2-17
Table 4.1 - Status Word Layout .............................................................................4-2
Table 4.2 - GPIB Error Codes..................................................................................4-6
Table 4A.1 - BASICA GPIB-PC Functions ..................................................4A-7
Table 4A.2 - QuickBASIC GPIB-PC Calls...................................................4A-8
Table 4A.3 - QuickBASIC GPIB-PC Calls.................................................4A-10
Table 4A.4 - QuickBASIC Version 4.0 GPIB-PC Functions .............. 4A-14
Table 5.1 - Syntax of GPIB Functions in IBIC ...............................................5-8
Table 5.2 - Status Word Layout ........................................................................... 5-11
Table 5.3 - Auxiliary Functions that IBIC Supports ...................................5-12
©National Instruments Corp. xvii GPIB-PC User Manual

Section One - Operation of the GPIB

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 device­specific 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.
©National Instruments Corp. 1-1 GPIB-PC User Manual
Operation of the GPIB Section One
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.
GPIB-PC User Manual 1-2 ©National Instruments Corp.
Section One Operation of the GPIB

GPIB Signals and Lines

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.
©National Instruments Corp. 1-3 GPIB-PC User Manual
Operation of the GPIB Section One

NDAC (not data accepted)

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.
GPIB-PC User Manual 1-4 ©National Instruments Corp.
Section One Operation of the GPIB

SRQ (service request)

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 non­standard 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).
©National Instruments Corp. 1-5 GPIB-PC User Manual
Operation of the GPIB Section One
DIO1 DIO2 DIO3 DIO4
EOI
DAV
NRFD
NDAC
IFC
SRQ
ATN
SHIELD
1
13
2
14
3
15
4
16
5
17
6
18
7
19
8
20
9
21
10
22
1 1
23
12
24
DIO5 DIO6
DIO7 DIO8
REN GND (TW PAIR W/DAV) GND (TW PAIR W/NRFD) GND (TW PAIR W/NDAC) GND (TW PAIR W/IFC)
GND (TW PAIR W/SRQ) GND (TW PAIR W/ATN) SIGNAL GROUND

Figure 1.1 - GPIB Connector and the Signal Assignment

GPIB-PC User Manual 1-6 ©National Instruments Corp.
Section One Operation of the GPIB

Figure 1.2 - Linear Configuration

©National Instruments Corp. 1-7 GPIB-PC User Manual
Operation of the GPIB Section One

Figure 1.3 - Star Configuration

GPIB-PC User Manual 1-8 ©National Instruments Corp.
Section One Operation of the GPIB

Configuration Requirements

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 for Programmable Instrumentation.
GPIB-PC Technical Reference Manual.
©National Instruments Corp. 1-9 GPIB-PC User Manual

Section Two - Installation and Configuration

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.
©National Instruments Corp. 2-1 GPIB-PC User Manual
Installation and Configuration Section Two
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.
GPIB-PC User Manual 2-2 ©National Instruments Corp.
Section Two Installation and Configuration
DBSAMP.BAS, BBSAMP.BAS, DQBSAMP, BIBSAMP, and
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.
©National Instruments Corp. 2-3 GPIB-PC User Manual
Installation and Configuration Section Two

Step 2 - Run IBSTART

Run IBSTART from the distribution diskette by switching to the drive containing the distribution diskette and entering:
ibstart x:
replacing x with the letter of the boot drive. For example, if the distribution diskette is in drive B and you have booted from drive A, enter:
b:
to switch to drive B. Next, enter:
ibstart a:
to run IBSTART. IBSTART first creates a directory called GPIB-PC on the boot diskette,
and copies the GPIB software to that directory. If the insufficient disk space message appears, abort the IBSTART program by
pressing the control key while you enter:
c
Increase the free space in your boot area and run IBSTART again. Next, IBSTART creates or modifies the DOS system configuration file
CONFIG.SYS to contain the line:
DEVICE=GPIB.COM
By reading this file at boot time, DOS installs new device drivers and handlers.
Next, IBSTART switches to the boot drive to run the hardware diagnostic program, IBDIAG.
GPIB-PC User Manual 2-4 ©National Instruments Corp.
Section Two Installation and Configuration
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
GPIB-PC.
©National Instruments Corp. 2-5 GPIB-PC User Manual
Loading...
+ 232 hidden pages