National Instruments GPIB-PC User Manual

National Instruments GPIB-PC User Manual

Gpib-pc user manual for the ibm personal computer and compatibles april 1988 edition part number 320014-01
Table of Contents

Advertisement

Quick Links

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.

Advertisement

Table of Contents
loading

Summary of Contents for National Instruments GPIB-PC

  • Page 1 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.
  • Page 2 National Instruments Corporate Headquarters 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,...
  • Page 3: Limited Warranty

    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.
  • Page 4 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;...
  • Page 5 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...
  • Page 6 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...
  • Page 7: About The Manual

    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.
  • Page 8: Customer Support

    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.
  • Page 9: Table Of Contents

    Configuration Requirements... 1-9 Related Documents... 1-9 Section Two - Installation and Configuration 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 Step 2 - Run IBSTART... 2-4 Step 3 - Run IBCONF (optional)...
  • Page 10 Device and Board Characteristics... 2-12 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) ...
  • Page 11 IBWAIT (bd,mask)... 3-16 ©National Instruments Corp. Clearing the Device Versus Clearing the GPIB... 3-4 Clearing the Device ... 3-4 Clearing the GPIB... 3-4 Placing a Device in Remote Mode... 3-4 Placing a Device in Local Mode... 3-5 Contents GPIB-PC User Manual...
  • Page 12 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 ...
  • Page 13 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..5-1 xiii Contents GPIB-PC User Manual...
  • Page 14 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 ... B-1 ... 6-1 ... A-1 ©National Instruments Corp.
  • Page 15 ATN and/or TIMO... C-3 DCAS and DTAS Status Bits ... C-3 Printer Support... C-3 Appendix D - Using your Printer with the GPIB-PC Installation... D-1 Appendix E - Application Notes Application Note 1 - Computer to Computer Data Transfer... E-1 Step 1.
  • Page 16 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...
  • Page 17: Section One - Operation Of The Gpib

    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. GPIB-PC User Manual...
  • Page 18: The Controller-In-Charge And System Controller

    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: •...
  • Page 19: Gpib Signals And Lines

    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. Operation of the GPIB GPIB-PC User Manual...
  • Page 20: Ndac (Not Data Accepted)

    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 ©National Instruments Corp. Section One...
  • Page 21: Srq (Service Request)

    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. GPIB-PC User Manual...
  • Page 22: Figure 1.1 - Gpib Connector And The Signal Assignment

    DIO2 DIO3 DIO4 D A V NRFD NDAC SHIELD Figure 1.1 - GPIB Connector and the Signal Assignment GPIB-PC User Manual DIO5 DIO6 DIO7 DIO8 GND (TW PAIR W/DAV) GND (TW PAIR W/NRFD) GND (TW PAIR W/NDAC) GND (TW PAIR W/IFC)
  • Page 23: Figure 1.2 - Linear Configuration

    Section One Operation of the GPIB Figure 1.2 - Linear Configuration ©National Instruments Corp. GPIB-PC User Manual...
  • Page 24: Figure 1.3 - Star Configuration

    Operation of the GPIB Section One Figure 1.3 - Star Configuration GPIB-PC User Manual ©National Instruments Corp.
  • Page 25: Configuration Requirements

    • 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.
  • Page 26: Section Two - Installation And Configuration

    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.
  • Page 27: Additional Programs And Files

    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 ©National Instruments Corp. Section Two...
  • Page 28: Installing The Software

    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:).
  • Page 29: Step 2 - Run Ibstart

    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: Increase the free space in your boot area and run IBSTART again.
  • Page 30: Step 3 - Run Ibconf (Optional)

    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.
  • Page 31: More About Ibconf

    Installation and Configuration If errors occur, check the following: • Did you read Getting Started with your GPIB-PC and make any required changes? If not, do so now. • Did you change hardware switch settings on your GPIB-PC board? If so, run IBCONF and accurately input the new settings for the board.
  • Page 32: Characteristics Of The Instruments

    A symbolic name of each device on the GPIB (such as DEV5 or PS5010). • A GPIB-PC access board for each device (e.g., GPIB0). The access board is discussed in Device Map Concepts and Terms later in this section. •...
  • Page 33: Default Configurations

    DEV1 is at address 1. • The 16 devices are assigned to GPIB0 as their access board. GPIB0 is the symbolic name of the first GPIB-PC board in your system. If you have an additional GPIB-PC in your system, its symbolic name is GPIB1.
  • Page 34: Running Ibconf

    GPIB-PC from the factory settings. Otherwise, it is unnecessary to run IBCONF. Consult the appropriate supplement to Section Two of the user manual to find the factory settings of your GPIB-PC model. Running IBCONF When you ran IBSTART, a copy of IBCONF.EXE was placed on your...
  • Page 35: Upper And Lower Levels Of Ibconf

    GPIBx. At this level, you may: • Rename a device; • Disconnect a device from its assigned GPIB-PC access board or connect (reassign) it to a different access board; or • Proceed to the lower level to edit or examine the characteristics of a particular board or device.
  • Page 36: Device Map Concepts And Terms

    • Access Board - all devices on the GPIB require an access board within the computer. The access board is the GPIB-PC interface board that provides the hardware link to the computer. The access board name is of the form GPIBx, where x is a digit 0 or 1 representing the appropriate GPIB board number.
  • Page 37: Device And Board Characteristics

    The primary GPIB address of all GPIB-PC boards is 0, unless changed by IBCONF. There are no hardware switches on the GPIB-PC to select the GPIB address. Secondary GPIB Address...
  • Page 38: Table 2.1 - Timeout Settings

    Minimum Timeout disabled 10 sec 30 sec 100 sec 300 sec 1 msec 3 msec 10 msec 30 msec 100 msec 300 msec 1 sec 3 sec 10 sec 30 sec 100 sec 300 sec 1000 sec 2-13 GPIB-PC User Manual...
  • Page 39: Eos Byte

    Some devices, as Listeners, require that the Talker terminate a data message by asserting the EOI signal line (sending END) with the last byte. A yes response will cause the GPIB-PC to assert EOI on the last data byte. GPIB-PC Model The GPIB-PC Model must be specified so that the handler will use the appropriate hardware addressing scheme.
  • Page 40: Local Lockout On All Devices (Boards Only)

    Base I/O Address (Boards Only) The GPIB-PC may be assigned any one of the legal base I/O or port addresses as described in the appropriate supplement to this section. The value entered must match the hardware setting selected during hardware configuration.
  • Page 41: Dma Channel (Boards Only)

    DMA Channel (Boards Only) This field appears only on computers supporting DMA capability. The GPIB-PC may use any of the three DMA channels, 1, 2, or 3, provided that another device is not already using that channel. If a DMA channel is not available, programmed I/O can be enabled by selecting NONE.
  • Page 42: Table 2.2 - Functions That Alter Default Characteristics

    Set EOI w/last byte of Write Change board assignment Enable or disable DMA Change or disable time limit Request/release system control ©National Instruments Corp. Installation and Configuration Dynamically Changed by IBPAD IBSAD IBEOS IBEOS IBEOS IBEOS IBEOT IBBNA IBDMA IBTMO IBRSC 2-17 GPIB-PC User Manual...
  • Page 43: Using Your Gpib-Pc

    Using Your GPIB-PC Now that your software and hardware are installed, read Section Three for an introduction to the functions available for the GPIB-PC. The functions are described in the order that you will most likely use them. Pay special attention to Group I, Group II, and Group III.
  • Page 44: Section Three - Gpib-Pc Functions - Introduction

    Section Three - GPIB-PC Functions — Introduction This section introduces you to the GPIB-PC handler functions and their capabilities. They are described in the order you will most likely use them. Application environments for which the functions are designed are described.
  • Page 45: Group I

    GPIB-PC Functions — Introduction Group I Group I functions may be the only functions you need for many of your instrument control applications. Group I functions are as follows: • IBRD, • IBWRT, and • IBFIND. They are suitable for your applications under the following conditions: •...
  • Page 46: Ibfind (Bdname,Bd)

    STATUS. Unless disabled during software configuration, any device function call will automatically conduct serial polls if SRQ is asserted on GPIB. This automatic serial polling is discussed in Section Four. ©National Instruments Corp. GPIB-PC Functions — Introduction GPIB-PC User Manual...
  • Page 47: Ibclr (Bd)

    GPIB-PC Functions — Introduction Section Three IBCLR (bd) IBCLR clears the device by sending to it the Selected Device Clear (SDC) and appropriate addressing commands. Clearing the Device Versus Clearing the GPIB There is a difference between clearing or initializing devices and clearing or initializing the GPIB itself.
  • Page 48: Placing A Device In Local Mode

    The functions of Group III are more flexible for controlling and communicating with devices. Group III functions are as follows: • IBRDA, • IBWRTA, • IBRDF, • IBWRTF, • IBWAIT, • IBSTOP, • IBTMO, • IBONL, and • IBPCT. ©National Instruments Corp. GPIB-PC Functions — Introduction GPIB-PC User Manual...
  • Page 49: Ibrda (Bd,Buf,Cnt) And

    GPIB-PC Functions — Introduction These functions are used under the following conditions: • Program execution must proceed in parallel with GPIB I/O – often called asynchronous operation. • I/O is to or from a file rather than a memory buffer.
  • Page 50: Ibtmo (Bd,V)

    Section Three GPIB-PC Functions — Introduction IBTMO (bd,v) IBTMO changes the time limit in which operations with the device must complete. IBONL (bd,v) IBONL re-initializes the device and cancels any asynchronous I/O in progress. All reconfigurable software parameters, such as the time limit just discussed, are reset to their power-on values.
  • Page 51: Group Iv

    The functions described previously have been device functions; that is, the bd argument referred to a device on the GPIB. This section introduces board functions, where bd refers to a specific GPIB-PC interface board in the computer. Group IV functions are as follows: •...
  • Page 52: Purpose Of Board Functions

    Purpose of Board Functions The handler software can control or communicate over the GPIB only by manipulating a GPIB-PC interface board. Remote devices are accessed indirectly by programming the interface board to do specific things. Device functions are selected sequences of some basic board functions.
  • Page 53: Ibfind (Bdname,Bd)

    GPIB-PC Functions — Introduction Section Three IBFIND (bdname,bd) This is the same as the Group I function except that boards are assigned names at configuration time in the form GPIBn, where n is a board's decimal number (0, 1, 2, ...) within the computer. For instance, in a system with two GPIB boards, the first is named GPIB0 and the second GPIB1.
  • Page 54: Figure 3.1 - Multiboard Gpib System

    Section Three Figure 3.1 - Multiboard GPIB System ©National Instruments Corp. GPIB-PC Functions — Introduction Boards GPIB Oscilloscope SCOPE Board GPIB0 Digital Voltmeter GPIB Board Plotter GPIB1 PLTR Printer PRTR 3-11 Devices GPIB Another GPIB GPIB-PC User Manual...
  • Page 55: Ibwrt (Bd,Buf,Cnt) And

    GPIB-PC Functions — Introduction Section Three IBWRT (bd,buf,cnt) and IBWRTA (bd,buf,cnt) Both functions use the specified board to write to one or more devices that have already been addressed to listen (for example, by the IBCMD or IBCMDA function). The syntax for these low-level functions is the same as their high-level counterparts of Group I and III.
  • Page 56: Ibsre (Bd,V)

    Section Three GPIB-PC Functions — Introduction IBSRE (bd,v) IBSRE uses the board to set or clear the GPIB Remote Enable (REN) line. IBGTS (bd,v) IBGTS causes the board to go from Active Controller to Standby Controller, and in so doing to turn the ATN signal off. This function is generally used to allow two external devices to talk to each other directly.
  • Page 57: More About Device And Board Functions

    GPIB-PC Functions — Introduction More About Device and Board Functions Before proceeding to the next group of functions, you will find it helpful to compare how a high-level device function can be replaced by several low-level board functions. Conducting a serial poll is a good example.
  • Page 58: Group V

    Section Three Group V Group V functions are used when the GPIB-PC is not CIC. An example is a system where the computer in which the board is installed performs as an instrument, but is controlled by another device on the GPIB.
  • Page 59: Ibppc (Bd,V)

    GPIB-PC Functions — Introduction Section Three IBPPC (bd,v) IBPPC locally configures or unconfigures the board for parallel polls. IBIST (bd,v) IBIST sets or clears the board's parallel poll flag (also known as the individual status bit). IBWAIT (bd,mask) This function is described in Group IV. It is included here to describe the additional events associated with noncontroller operations that the function can detect.
  • Page 60: Group Vi

    Change the GPIB address of a board or device. • Request or release System Control. IBEOT (bd,v) IBEOT enables or disables sending the END message (EOI) with the last byte written by the board. ©National Instruments Corp. GPIB-PC Functions — Introduction 3-17 GPIB-PC User Manual...
  • Page 61: Ibeos (Bd,V)

    IBTMO sets the time limit in which operations with a device or board must complete. Another important feature of the GPIB-PC functions is that they return status information about the boards and devices in the system. This information is returned in the form of three global status variables, IBSTA, IBERR, and IBCNT.
  • Page 62: Section Four - Gpib-Pc Functions - Overview

    Section Four - GPIB-PC Functions — Overview This section consists of Section Four and a BASIC supplement. Section Four contains a discussion of the important characteristics common to all programming languages. The BASIC supplement lists the GPIB functions for BASICA and QuickBASIC languages.
  • Page 63: Status Word

    Status Word All functions return a status word containing information about the state of the GPIB and the GPIB-PC. You should test for the conditions reported in the status word to make decisions about continued processing. The status word is returned in the variable IBSTA.
  • Page 64 GPIB-PC is CIC and the GPIB SRQ line is asserted. It is cleared whenever the GPIB-PC ceases to be the CIC, or the GPIB SRQ line is unasserted. The bit is also cleared when executing board functions and the GPIB-PC is an active talker, i.e., it is...
  • Page 65 GPIB-PC or by another Controller. It is cleared whenever REN becomes unasserted, or when the GPIB-PC as a Listener detects the Go to Local (GTL) command has been sent either by the GPIB-PC or by another Controller, or when the IBLOC function is called while the LOK bit is cleared in the status word.
  • Page 66 Section Four as a Talker. It is sent either by the GPIB-PC itself or by another Controller. It is cleared whenever the GPIB-PC detects the Untalk (UNT) command, a talk address other than its own talk address, or Interface Clear (IFC).
  • Page 67: Error Codes

    IBCONF utility to recognize the name. GPIB-PC User Manual Explanation DOS error Function requires GPIB-PC to be CIC No Listener on write function GPIB-PC not addressed correctly Invalid argument to function call GPIB-PC not System Controller as required...
  • Page 68 IBCAC, and • IBGTS. In cases when the GPIB-PC should always be the CIC, the remedy is to be sure to call IBSIC to send Interface Clear before attempting any of these calls, and to avoid sending the command byte TCT (hex 09, Take Control). In...
  • Page 69 IBCMD argument string and that no Unlisten (hex 3F) command follows it. ENOL may occur in situations in which the GPIB-PC is not the CIC and the Controller asserts ATN before the write call in progress has ended. The remedy is either to reduce...
  • Page 70 Talker use the END message to assist in early termination. ENEB (7) ENEB occurs when there is no GPIB-PC at the I/O address specified in the configuration program. This happens when the board is not physically plugged into the system, when...
  • Page 71 GPIB-PC Functions — Overview EFSO (12) EFSO results when an IBRDF or IBWRTF call encounters a problem performing a file operation. Specifically, this error indicates the function was unable to open, create, seek, write, or close the file being accessed. The specific DOS error code for this condition is contained in IBCNT.
  • Page 72: Count Variable

    Listener be properly configured to unambiguously detect the end of a transmission. The GPIB-PC always terminates IBRD operations on the END message. Using the configuration program, you can accommodate all permissible forms of read and write termination. The default configuration settings for read and write termination can be changed at run time using the IBEOS and IBEOT functions, if necessary.
  • Page 73: Device Function Calls

    In a single board configuration in which there is only one GPIB-PC in use, when the first device function of the program is executed, the GPIB is initialized by its controlling access board with the Interface Clear (IFC) command.
  • Page 74: Automatic Serial Polling

    Section Four GPIB-PC Functions — Overview Automatic Serial Polling If this feature is enabled, the handler automatically conducts serial polls when SRQ is asserted. The handler polls all active devices and stores each positive response, i.e., those responses that have the Request Service (RQS) or hex 40 bit set in the device status byte, in a queue associated with each device.
  • Page 75 GPIB-PC Functions — Overview Section Four If the handler is configured with automatic serial polling enabled, this feature will be disabled after a board-level I/O function call, and resumed after a device-level I/O function call. However, if any device- level I/O call results in a timeout error, this feature will be disabled until the next I/O call completes.
  • Page 76: Section Four A - Basica/Quickbasic Gpib-Pc Function Calls

    Section Four A - BASICA/QuickBASIC GPIB-PC Function Calls This section contains information for programming the GPIB-PC in BASICA and QuickBASIC, Versions 4.0 and earlier. The term BASICA, as used in this section, refers to Advanced IBM Interpretive BASIC for the IBM Personal Computer. The term QuickBASIC refers to Microsoft QuickBASIC.
  • Page 77: Basica Files

    An example of this appears as follows: Information that is not located in a frame can be used to program the GPIB-PC in all versions of BASICA and QuickBASIC (that is, Version 4.0 and earlier).
  • Page 78: Programming Preparations For Basica

    Refer to the BASICA MERGE command. DECL.BAS contains code which loads the file BIB.M into memory. The file BIB.M contains the BASICA language interface to the GPIB-PC handler, and must exist in the directory currently in use. ©National Instruments Corp.
  • Page 79: Programming Preparations For Quickbasic

    IBSTA%, IBERR%, and IBCNT% as described at the beginning of Section Four. The file QBIB*.OBJ contains the QuickBASIC language interface to the GPIB-PC handler. Link compiled GPIB application programs written in QuickBASIC with QBIB*.OBJ to produce an executable file permitting access to the handler.
  • Page 80: Basica/Quickbasic Gpib-Pc I/O Functions

    QuickBASIC User's Manual which pertain to compiling and linking programs. Use the file QBIB4.OBJ for linking purposes. BASICA/QuickBASIC GPIB-PC I/O Functions The most commonly needed I/O functions are IBRD and IBWRT. In BASICA, these functions read and write from a character string that may be up to 255 bytes long.
  • Page 81: Basica/Quickbasic "On Srq" Capability

    IBWRTIA are provided to perform asynchronous integer reads and writes. The functions are listed alphabetically by function name in this section. Table 4A.1 provides a summary of the BASICA GPIB-PC functions and Table 4A.2 provides a summary of the QuickBASIC GPIB-PC functions. BASICA/QuickBASIC "ON SRQ" Capability BASICA programs may be interrupted on the occurrence of the GPIB SRQ signal.
  • Page 82: Table 4A.1 - Basica Gpib-Pc Functions

    Section Four A Table 4A.1 - BASICA GPIB-PC Functions Description Change access board of device Become Active Controller Clear specified device Send commands from string Send commands asynchronously from string Enable/disable DMA Change/disable EOS mode Enable/disable END message Open device and return unit descriptor IBFIND (BDNAME$,BD%)
  • Page 83: Table 4A.2 - Quickbasic Gpib-Pc Calls

    BASICA/QuickBASIC GPIB-PC Function Calls Table 4A.1 - BASICA GPIB-PC Functions (continued) Description Wait for selected event Write data from string Write data asynchronously from string IBWRTA (BD%,WRT$) Write data from file Write data from integer array Write data asynch from integer array The first argument of all function calls except IBFIND is the integer variable BD%, which serves as a unit descriptor.
  • Page 84 Write data from file Write data from integer array Write data asynch from integer array ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Table 4A.2 - QuickBASIC GPIB-PC Calls (cont.) CALL Function Syntax IBPCT (BD%) IBPPC (BD%,V%) IBRD (BD%,RD$) IBRDA (BD%,RD$)
  • Page 85: Table 4A.3 - Quickbasic Gpib-Pc Calls

    BASICA/QuickBASIC GPIB-PC Function Calls Table 4A.3 - QuickBASIC GPIB-PC Calls Description Change access board of device Become Active Controller Clear specified device Send commands from string Send commands asynchronously from string Enable/disable DMA Change/disable EOS mode Enable/disable END message Open device and return unit descriptor IBFIND (BDNAME$,BD%)
  • Page 86 Section Four A Table 4A.3 - QuickBASIC GPIB-PC Calls (continued) Description Change/disable time limit Configure applications monitor Trigger selected device Wait for selected event Write data from string Write data asynchronously from string IBWRTA (BD%,WRT$) Write data from file Write data from integer array Write data asynch from integer array ©National Instruments Corp.
  • Page 87: New Gpib-Pc Functions

    In general, the functions behave identically to the subroutines with the few exceptions noted in the following paragraph. The description of each subroutine found in the GPIB-PC User Manual can be applied to the new functions, except for the syntax-specific information.
  • Page 88 IF IBRD (BD%, RD%, CNT%) < 0 THEN CALL GPIBERROR Table 4A.4 contains a complete list of the new QuickBASIC GPIB functions, their parameters, and a short description of each. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-13 GPIB-PC User Manual...
  • Page 89: Table 4A.4 - Quickbasic Version 4.0 Gpib-Pc Functions

    BASICA/QuickBASIC GPIB-PC Function Calls Table 4A.4 - QuickBASIC Version 4.0 GPIB-PC Functions Description Change access board of device Become Active Controller Clear specified device Send commands from string Send commands asynchronously from string Enable/disable DMA Change/disable EOS mode Enable/disable END message...
  • Page 90: Gpib-Pc Function Descriptions

    Section Four A Table 4A.4 - QuickBASIC Version 4.0 GPIB-PC Functions Description Configure applications monitor Wait for selected event Write data from string Write data asynchronously from string ILWRTA (BD%,WRT$,CNT%) Write data from file Write data from integer array Write data asynch from integer array...
  • Page 91: Ibbna

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBBNA Purpose: Change access board of device Format: CALL IBBNA (BD%,BNAME$) Remarks: BD% specifies a device. BNAME$ specifies the new access board to be used in all device calls to that device. IBBNA is needed only to alter the board assignment from its configuration setting.
  • Page 92: Ibcac

    Functions such as IBCMD and IBRPP, which require that the GPIB-PC take control, do so automatically. The ECIC error results if the GPIB-PC is not CIC. Board Examples: Take control immediately without regard to any data handshake in progress.
  • Page 93 BASICA/QuickBASIC GPIB-PC Function Calls Take control synchronously and assert ATN following a read operation. CALL IBRD (BRD0%,RD$) V% = 1 CALL IBCAC (BRD0%,V%) GPIB-PC User Manual 4A-18 ©National Instruments Corp. Section Four A...
  • Page 94: Ibclr

    Three. Device Example: Clear the device VMTR%. CALL IBCLR (VMTR%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Listen address of the device; Secondary address of the device, if applicable; Selected Device Clear (SDC); and Untalk (UNT) and Unlisten (UNL) 4A-19...
  • Page 95: Ibcmd

    A short count can occur on any event but the first. An ECIC error results if the GPIB-PC is not CIC. If it is not Active Controller, it takes control and asserts ATN prior to sending the command bytes. It remains Active Controller afterward.
  • Page 96 Trigger any devices previously addressed to listen with the Group Execute Trigger (GET or &H08) command. CMD$ = CHR$(&H08) CALL IBCMD (BRD0%,CMD$) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls ' UNL TAD1 LAD2 ' UNL TAD1 LAD2 SAD2 ' GET 4A-21...
  • Page 97 &H52 (ASCII R) using the Serial Poll Enable (SPE or &H18) and Serial Poll Disable (SPD or &H19) commands (the GPIB-PC listen address is &H20 or ASCII space). CMD$ ="?R " + CHR$(&H18)'UNL TAD MLA SPE CALL IBCMD (BRD0%,CMD$)
  • Page 98: Ibcmda

    EOIP, with the following exceptions: • IBSTOP - • IBWAIT - ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls to cancel the asynchronous I/O; to monitor other GPIB conditions; and 4A-23 BASICA/QuickBASIC IBCMDA GPIB-PC User Manual...
  • Page 99 The asynchronous I/O started by IBCMDA terminates for the same reasons IBCMD terminates. An ECIC error results if the GPIB-PC is not CIC. If it is not Active Controller, the GPIB-PC takes control and asserts ATN prior to sending the command bytes. It remains Active Controller afterward.
  • Page 100: Ibdma

    CALL IBDMA (BD%,V%) Remarks: BD% specifies an interface board. If V% is non-zero, DMA transfers between the GPIB-PC and memory are used for read and write operations. If V% is zero, programmed I/O is used in place of DMA I/O.
  • Page 101: Ibeos

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBEOS Purpose: Change or disable end-of-string termination mode Format: CALL IBEOS (BD%,V%) Remarks: BD% specifies a device or an interface board. V% specifies the EOS character and the data transfer termination method according to Table 4A.5. IBEOS is needed only to alter the value from its configuration setting.
  • Page 102 V% = EOSV% + &H0800 CALL IBEOS (DVM%,V%) WRT$ = "123" + CHR$(&H0A) CALL IBWRT (DVM%,WRT$) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls ' EOS info for IBEOS. ' Data bytes to be ' written. ' character is the ' last byte.
  • Page 103 BASICA/QuickBASIC GPIB-PC Function Calls Board Examples: Program the interface board BRD0% to terminate a read on detection of the linefeed character (&H0A) that is expected to be received within 200 bytes. EOSV% = &H0A V% = EOSV% + &H0400 CALL IBEOS (BRD0%,V%)
  • Page 104 To send END with linefeeds and to terminate reads on linefeeds for operations involving the interface board BRD0%, change line 100 in Example 4. V% = EOSV% + &H0C00 ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Assume the board has been addressed; do board write. 4A-29 GPIB-PC User Manual...
  • Page 105: Ibeot

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBEOT Purpose: Enable or disable END termination message on write operations Format: CALL IBEOT (BD%,V%) Remarks: BD% specifies a device or an interface board. If V% is non- zero, the END message is sent automatically with the last byte of each write operation.
  • Page 106 V% = 1 CALL IBEOT (BRD0%,V%) CALL IBWRT (BRD0%,WRT$) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls It is assumed that WRT$ contains the data to be written to the GPIB. ' Enable sending of EOI. It is assumed that WRT$ contains the data to be written and all Listeners have been addressed.
  • Page 107: Ibfind

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBFIND Purpose: Open device and return the unit descriptor associated with the given name Format: CALL IBFIND (BDNAME$,BD%) Remarks: BDNAME$ is a string containing a default or configured device or board name. BD% is a variable containing the unit descriptor returned by IBFIND.
  • Page 108 "GPIB0" to the variable BRD0%. BDNAME$ = "GPIB0" ' Board name CALL IBFIND (BDNAME$,BRD0%) IF BRD0% < 0 GOTO 1000 ' ERROR ROUTINE ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls ' Device name ' assigned at ' configuration time ' assigned at...
  • Page 109: Ibgts

    GPIB. If V% is zero, no shadow handshake or holdoff is done. The IBGTS function causes the GPIB-PC to go to the Controller Standby state and to unassert the ATN signal if it initially is the Active Controller. IBGTS permits GPIB devices to transfer data without the GPIB-PC being a party to the transfer.
  • Page 110 Listener at &H31 (ASCII 1) to allow the Talker to send data messages. CMD$ = "?F1" ' UNL MTA1 MLA2 CALL IBCMD (BRD0%,CMD$) V% = 1 CALL IBGTS (BRD0%,V%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls ' Listen in continuous mode. 4A-35 GPIB-PC User Manual...
  • Page 111: Ibist

    GPIB data line either true or false, depending on the value of its local ist bit. The GPIB-PC, for example, can be assigned to drive the DIO3 data line true if ist=1 and false if ist=0;...
  • Page 112 Board Examples: Set the individual status bit. V% = 1 ' Any non-zero value will do. CALL IBIST (BRD0%,V%) Clear the individual status bit. V% = 0 CALL IBIST (BRD0%,V%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-37 GPIB-PC User Manual...
  • Page 113: Ibloc

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBLOC Purpose: Go to Local Format: CALL IBLOC (BD%) Remarks: BD% specifies a device or an interface board. Unless the Remote Enable line has been unasserted with the IBSRE function, all device functions automatically place the specified device in remote program mode.
  • Page 114 Section Four A Device Example: Return the device DVM% to local state. CALL IBLOC (DVM%) Board Example: Return the interface board BRD0% to local state. CALL IBLOC (BRD0%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-39 GPIB-PC User Manual...
  • Page 115: Ibonl

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBONL Purpose: Place the device or interface board online or offline Format: CALL IBONL (BD%,V%) Remarks: BD% specifies a device or an interface board. If V% is non- zero, the device or interface board is enabled for operation (i.e., online).
  • Page 116 Reset the configuration settings of the interface board BRD0% to their defaults. V% = 1 CALL IBONL (BRD0%,V%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 'at configuration time IBONL with V% non-zero is automatically performed as part of IBFIND. 4A-41...
  • Page 117: Ibpad

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBPAD Purpose: Change Primary Address Format: CALL IBPAD (BD%,V%) Remarks: BD% specifies a device or an interface board. V% specifies the primary GPIB address of the device or interface board. IBPAD is needed only to alter the value from its configuration setting.
  • Page 118 Change the primary GPIB listen and talk address of the interface board BRD0% from the configuration setting to &H27 and &H47 respectively. V% = &H7 ' Lower 5 bits of GPIB address. CALL IBPAD (BRD0%,V%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-43 GPIB-PC User Manual...
  • Page 119: Ibpct

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBPCT Purpose: Pass Control Format: CALL IBPCT (BD%) Remarks: BD% specifies a device. The IBPCT function passes CIC authority to the specified device from the access board assigned to that device. The board automatically goes to Controller Idle State (CIDS).
  • Page 120: Ibppc

    And if PPE=&H68, DIO1 is driven true if ist=1 and false if ist=0. Any PPD message or zero value cancels the PPE message in effect. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-45 BASICA/QuickBASIC IBPPC...
  • Page 121 BASICA/QuickBASIC GPIB-PC Function Calls Which PPE and PPD messages are sent and the meaning of a particular parallel poll response are all system dependent protocol matters to be determined by you. On exit, all devices are unaddressed. Board IBPPC Function:...
  • Page 122 If the access board is CIC, the IBCMD function must be called prior to IBRD to address a device to talk and the board to listen. Otherwise, the device on the GPIB that is the CIC must perform the addressing. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-47 BASICA/QuickBASIC IBRD...
  • Page 123 BASICA/QuickBASIC GPIB-PC Function Calls If the access board is Active Controller, the board is first placed in Standby Controller state with ATN off and remains there after the read operation is completed. Otherwise, the read operation commences immediately. An EADR error results if the board is CIC but has not been addressed to listen with the IBCMD function.
  • Page 124 Section Four A Board Examples: Read 56 bytes of data from a device at talk address &H4C (ASCII L) and then unaddress it (the GPIB-PC listen address is &H20 or ASCII space). CMD$ = "? L" ' UNL MLA TAD...
  • Page 125 BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBRDA Purpose: Read data asynchronously to string Format: CALL IBRDA (BD%,RD$) Remarks: BD% specifies a device or an interface board. RD$ identifies the storage buffer for data bytes that are read from the GPIB. The IBRDA function reads from 1 to 255 bytes of data from a GPIB device.
  • Page 126 EOIP, with the following exceptions: • - to cancel the asynchronous I/O; IBSTOP • - to monitor other GPIB conditions; or IBWAIT • - to cancel the I/O and reset the interface. IBONL ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-51 GPIB-PC User Manual...
  • Page 127 BASICA/QuickBASIC GPIB-PC Function Calls Device Example: Read 56 bytes of data from the device TAPE% while performing other processing. RD$ = SPACE$(56) CALL IBRDA (TAPE%,RD$) MASK% = &H4100 CALL IBWAIT (TAPE%,MASK%) IF (IBSTA% AND &H100) = 0 GOTO 130 GPIB-PC User Manual Perform device read.
  • Page 128 Section Four A Board Examples: Read 56 bytes of data from a device at talk address &H4C (ASCII L) and then unaddress it (the GPIB-PC listen address is &H20 or ASCII space). CMD$ = "? L" CALL IBCMD (BRD0%,CMD$) RD$ = SPACE$(56) CALL IBRDA (BRD0%,RD$) MASK% = &H4100...
  • Page 129: Ibrd

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBRDF Purpose: Read data from GPIB into file Format: CALL IBRDF (BD%,FLNAME$) Remarks: BD% specifies a device or an interface board. FLNAME$ is the filename under which the data is stored. FLNAME$ may be up to 50 characters long, including a drive and path designation.
  • Page 130 Read data from the device RDR% into the file RDGS on disk drive B. FLNAME$ = "B:RDGS" CALL IBRDF (RDR%,FLNAME$) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Perform device read. Check IBSTA% and IBCNT% to see how the read completed (not done here). All addressing and unaddressing has been done.
  • Page 131 Read data from a device at talk address &H4C (ASCII L) to the file RDGS on the current disk drive and then unaddress it (the GPIB-PC listen address is &H20 or ASCII space). CMD$ = "?L " ' UNL TAD MLA CALL IBCMD (BRD0%,CMD$) FLNAME$ = "RDGS"...
  • Page 132: Ibrdi

    Refer to the IBRD function and to the information about BASICA and QuickBASIC GPIB-PC I/O Functions at the beginning of this section. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls BASICA and QuickBASIC Version 1.0:...
  • Page 133 BASICA/QuickBASIC GPIB-PC Function Calls Device Example: Read 56 bytes of data from the device TAPE% and store in the integer array RD%. CNT% = 56 DIM RD% (28) CALL IBRDI (TAPE%,RD%(0),CNT%) CALL IBRDI (TAPE%,VARPTR(RD%(0)),CNT%) CALL IBRDI (TAPE%,RD%(), CNT%) GPIB-PC User Manual Array size is equal to CNT% divided by 2.
  • Page 134 Read 56 bytes of data into the integer array RD% from a device at talk address &H4C (ASCII L) and then unaddress it (the GPIB-PC listen address is &H20 or ASCII space). CMD$ = "? L" ' UNL MLA TAD...
  • Page 135: Ibrdia

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBRDIA Purpose: Read data asynchronously to integer array Format: Call IBRDIA (BD%,IARR%(0),CNT%) Call IBRDIA (BD%, VARPTR(IARR%(0)),CNT%) Call IBRDIA (BD%, IARR%(), CNT%) Remarks: BD% specifies a device or an interface board. IARR% specifies an integer array into which data is read asynchronously from the GPIB.
  • Page 136 I/O operation. Refer to the IBRDA function and to the BASICA and QuickBASIC GPIB-PC I/O Functions at beginning of this section. Device Example: Read 56 bytes of data into the integer array RD% from the device TAPE% while performing other processing.
  • Page 137 Read 56 bytes of data into the integer array RD% from a device at talk address &H4C (ASCII L) and then unaddress it (the GPIB-PC listen address is &H20 or ASCII space). CMD$ = "? L" ' UNL MLA TAD...
  • Page 138 CALL IBRDIA (TAPE%,VARPTR(RD%(0)),CNT%) CALL IBRDIA (BD%,RD%(),CNT%) To terminate the read on an end-of-string character, see IBEOS examples. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls QuickBASIC Version 2.0 or 3.0, replace line 190 with: QuickBASIC Version 4.0, replace line 190 with:...
  • Page 139: Ibrpp

    IDY message (ATN and EOI both asserted) and reading the response from the GPIB data lines. An ECIC error results if the GPIB-PC is not CIC. If the GPIB-PC is Standby Controller, it takes control and asserts ATN (becomes Active) prior to polling.
  • Page 140 CALL IBRPP (BRD0%,PPR%) Disable and unconfigure all GPIB devices from parallel polling using the PPU (&H15) command. CMD$ = CHR$(&H15) CALL IBCMD (BRD0%,CMD$) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Send LAD, PPC, PPE, and UNL. 4A-65 ' PPU GPIB-PC User Manual...
  • Page 141: Ibrsc

    If V% is zero, functions requiring System Controller capability are disallowed. The IBRSC function is used to enable or disable the capability of the GPIB-PC to send the Interface Clear (IFC) and Remote Enable (REN) messages to GPIB devices using the IBSIC and IBSRE functions respectively.
  • Page 142 Board Example: Request to be System Controller if the interface board BRD0% is not currently so designated. V% = 1 CALL IBRSC (BRD0%,V%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls ' Any non-zero value will do. 4A-67 GPIB-PC User Manual...
  • Page 143: Ibrsp

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBRSP Purpose: Return serial poll byte Format: CALL IBRSP (BD%,SPR%) Remarks: BD% specifies a device. SPR% is the variable in which the poll response is stored. The IBRSP function is used to serially poll one device and obtain its status byte or to obtain a previously stored status byte.
  • Page 144 Refer to IBCMD and IBRD for additional information. Device Example: Obtain the Serial Poll response (SPR) byte from the device TAPE%. CALL IBRSP (TAPE%,SPR%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls The application program would then analyze the response in SPR%. 4A-69 GPIB-PC User Manual...
  • Page 145: Ibrsv

    Remarks: BD% specifies an interface board. V% specifies the response or status byte the GPIB-PC provides when serially polled by another device that is the GPIB CIC. If bit 6 (the &H40 bit) is set, the GPIB-PC additionally requests service from the Controller by asserting the GPIB SRQ line.
  • Page 146: Ibsad

    Board IBSAD Function: When BD% specifies an interface board, the IBSAD function enables or disables extended GPIB addressing and, when enabled, assigns the secondary address of the GPIB-PC. Refer also to IBPAD, IBONL, and Table 2.1. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls...
  • Page 147 BASICA/QuickBASIC GPIB-PC Function Calls Device Examples: Change the secondary GPIB address of the device PLOTTER% from its current value to &H6A. V% = &H6A CALL IBSAD (PLOTTER%,V%) Disable secondary addressing for the device DVM%. V% = 0 CALL IBSAD (DVM%,V%)
  • Page 148: Ibsic

    CALL IBSIC (BD%) Remarks: BD% specifies an interface board. The IBSIC function causes the GPIB-PC to assert the IFC signal for at least 100 microseconds, provided the GPIB-PC has System Controller capability. This action initializes the GPIB and makes the interface board CIC and Active Controller with ATN asserted, and is generally used when a bus fault condition is suspected.
  • Page 149: Ibsre

    REN enables the remote mode. A device does not actually enter remote mode until it receives its listen address. The ESAC error occurs if the GPIB-PC is not System Controller. When IBSRE is called and an error does not occur, the previous value of V% is stored in IBERR%.
  • Page 150 CMD$ = CHR$(&H11) CALL IBCMD (BRD0%,CMD$) CMD$ = "#" + CHR$(&H11) CALL IBCMD (BRD0%,CMD$) Return all devices to local mode. V% = 0 ' Set REN to false CALL IBSRE (BRD0%,V%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-75 GPIB-PC User Manual...
  • Page 151: Ibstop

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBSTOP Purpose: Abort asynchronous operation Format: CALL IBSTOP (BD%) Remarks: BD% specifies a device or an interface board. IBSTOP terminates any asynchronous read, write, or command operation in progress. Device IBSTOP Function: If BD% specifies a device, IBSTOP attempts to terminate any unfinished asynchronous I/O operation to that device that had been started with a device function for that device.
  • Page 152 Section Four A Board Example: Stop any asynchronous operations associated with the interface board BRD0%. CALL IBSTOP (BRD0%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-77 GPIB-PC User Manual...
  • Page 153: Ibtmo

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBTMO Purpose: Change or disable time limit Format: CALL IBTMO (BD%,V%) Remarks: BD% specifies a device or an interface board. V% is a code specifying the time limit as follows: NOTE: If V% is zero, no limit is in effect.
  • Page 154 Board IBTMO Function: When BD% specifies a board, the new time limit is used in subsequent board functions directed to that board. Refer also to IBWAIT and to Table 2.1. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-79 GPIB-PC User Manual...
  • Page 155 BASICA/QuickBASIC GPIB-PC Function Calls Device Example: Change the time limit for calls involving the device TAPE% to approximately 300 msec. V% = 10 CALL IBTMO (TAPE%,V%) Board Example: Change the time limit for calls directed to the interface board BRD0% to approximately 10 msec.
  • Page 156: Ibtrap

    4 (EARG) Otherwise, IBERR will contain the previous mask value. Refer to Section Six for more information. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Turn monitor off. No recording or trapping occurs. Turn record on. All calls are recorded but no trapping occurs.
  • Page 157 BASICA/QuickBASIC GPIB-PC Function Calls Device Example: Configure applications monitor to record and trap on SRQ or CMPL. MASK% = &H1100 MODE% = 3 CALL IBTRAP (MASK%, MODE%) GPIB-PC User Manual 'SRQ or CMPL 'Record and trap on 4A-82 ©National Instruments Corp.
  • Page 158: Ibtrg

    Untalk (UNT) and Unlisten (UNL). Other command bytes may be sent as necessary. Refer to the IBCMD function for additional information. Device Example: Trigger the device ANALYZ%. CALL IBTRG (ANALYZ%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-83 BASICA/QuickBASIC IBTRG GPIB-PC User Manual...
  • Page 159: Ibwait

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBWAIT Purpose: Wait for selected event Format: CALL IBWAIT (BD%,MASK%) Remarks: BD% specifies a device or an interface board. MASK% is a bit mask with the same bit assignments as the status word, IBSTA%. Each MASK% bit is set or cleared to wait or not wait, respectively, for the corresponding event to occur.
  • Page 160 I/O completed GPIB-PC is in lockout state GPIB-PC is in remote state GPIB-PC is CIC Attention is asserted GPIB-PC is Talker GPIB-PC is Listener GPIB-PC is in device trigger state GPIB-PC is in device clear state 4A-85 GPIB-PC User Manual...
  • Page 161 BASICA/QuickBASIC GPIB-PC Function Calls Device Example: Wait indefinitely for the device LOGGER% to request service. MASK% = &H800 CALL IBWAIT (LOGGER%,MASK%) Board Examples: Wait for a service request or a timeout. MASK% = &H5000 CALL IBWAIT (BD%,MASK%) Update the current status for IBSTA%.
  • Page 162: Ibwrt

    If the access board is CIC, the IBCMD function must be called prior to IBWRT to address the device to listen and the board to talk. Otherwise, the device on the GPIB that is the CIC must perform the addressing. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-87 BASICA/QuickBASIC IBWRT...
  • Page 163 BASICA/QuickBASIC GPIB-PC Function Calls If the access board is Active Controller, the board is first placed in Standby Controller state with ATN off and remains there after the write operation is completed. Otherwise, the write operation commences immediately. An EADR error results if the board is CIC but has not been addressed to talk with the IBCMD function.
  • Page 164 Section Four A Board Example: Write 10 instruction bytes to a device at listen address &H2F (ASCII /) and then unaddress it (the GPIB-PC talk address is &H40 or ASCII @). CMD$ = "?@/" CALL IBCMD (BRD0%,CMD$) WRT$ = "F3R1X5P2G0"...
  • Page 165: Ibwrta

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBWRTA Purpose: Write data asynchronously from string Format: CALL IBWRTA (BD%,WRT$) Remarks: BD% specifies a device or an interface board. WRT$ contains the data to be sent over the GPIB. This is a special case of the IBWRTA function which in BASICA writes a maximum of 255 bytes from a character string to the GPIB.
  • Page 166 EOIP, with the following exceptions: • IBSTOP - to cancel the asynchronous I/O; • IBWAIT - to monitor other GPIB conditions; or • IBONL - to cancel the I/O and reset the interface. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-91 GPIB-PC User Manual...
  • Page 167 Write 10 instruction bytes to a device at listen address &H2F (ASCII /), while testing for a high priority event to occur, and then unaddress it (the GPIB-PC talk address is &H40 or ASCII CMD$ = "?@/" CALL IBCMD (BRD0%,CMD$) WRT$ = "F3R1X5P2G0"...
  • Page 168: Ibwrtf

    An ENOL error occurs if there are no listeners on the bus when the data bytes are sent. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-93 BASICA/QuickBASIC IBWRTF...
  • Page 169 BASICA/QuickBASIC GPIB-PC Function Calls The board IBWRTF operation terminates on any of the following events: • All bytes sent; • Error is detected; • Time limit is exceeded; or • Device Clear (DCL) or Selected Device Clear (SDC) command is received from another device which is the CIC.
  • Page 170: Ibwrti

    GPIB. This function is useful when those bytes are stored in integer format. Refer to the IBWRT function and to the information about BASICA/QuickBASIC GPIB-PC I/O Functions at the beginning of this section. Refer also to IBWRTIA. ©National Instruments Corp.
  • Page 171 BASICA/QuickBASIC GPIB-PC Function Calls Device Examples: Write 10 instruction bytes from the integer array WRT% to the device DVM%. DIM WRT%(4) WRT%(0) = ASC("F") + ASC("3") * 256 WRT%(1) = ASC("R") + ASC("1") * 256 WRT%(2) = ASC("X") + ASC("5") * 256 WRT%(3) = ASC("P") + ASC("2") * 256...
  • Page 172 Board Example: Write 10 instruction bytes from the integer array WRT% to a device at listen address &H2F (ASCII /) and then unaddress it (the GPIB-PC talk address is &H40 or ASCII @). CMD$ = "?@/" CALL IBCMD (BRD0%,CMD$) DIM WRT%(4) WRT%(0) = ASC("F") + ASC("3") * 256...
  • Page 173: Ibwrtia

    BASICA/QuickBASIC GPIB-PC Function Calls BASICA/QuickBASIC IBWRTIA Purpose: Write data asynchronously from integer array Format: BASICA and QuickBASIC Version 1.0: Call IBWRTIA (BD%,IARR%(0),CNT%) Call IBWRTIA (BD%, VARPTR(IARR%(0)), CNT%) Call IBWRTIA (BD%, IARR%(), CNT%) Remarks: BD% specifies a device or an interface board. IARR% is an array from which integer data is written.
  • Page 174 CALL IBWRTIA (PTR%,VARPTR(WRT%(0)),CNT%) QuickBASIC Version 4.0, replace line 170 with: CALL IBWRTIA (BD%,WRT%(),CNT%) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Perform other processing here then wait for I/O completion or timeout. Check IBSTA% to see how the write terminated on: CMPL, END, TIMO, or ERR.
  • Page 175 Board Example: Write 10 instruction bytes from the integer array WRT% to a device at listen address &H2F (ASCII /) and then unaddress it (the GPIB-PC talk address is &H40 or ASCII @). CMD$ = "?@/" CALL IBCMD (BRD0%,CMD$) DIM WRT%(4) WRT%(0) = ASC("F") + ASC("3") * 256...
  • Page 176: Programming Examples

    This section illustrates the programming steps that could be used to program a representative IEEE-488 instrument from your personal computer using the GPIB-PC handler functions. The applications are written in BASICA and QuickBASIC. The target instrument is a digital voltmeter (DVM). This instrument is otherwise unspecified (that is, it is not a DVM manufactured by any particular manufacturer).
  • Page 177 The only changes made to the software parameters are those necessary to define the device DVM at primary address 3. • There is only one GPIB-PC in use, which is designated GPIB0. • Its primary listen and talk addresses are &H20 (ASCII space character) and &H40 (ASCII @ character), respectively.
  • Page 178: Basica Example Program - Device

    MASK% = &H4800 : CALL IBWAIT (DVM%,MASK%) IF (IBSTA% AND &HC000) <> 0 THEN GOTO 3000 Since neither a timeout nor an error occurred, IBWAIT must have returned on RQS. ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls Next, serial poll the device. 4A-103 GPIB-PC User Manual...
  • Page 179 BASICA/QuickBASIC GPIB-PC Function Calls CALL IBRSP (DVM%,SPR%) IF IBSTA% < 0 THEN GOTO 3000 Now test the status byte (SPR%). If SPR% is &HC0, the DVM has valid data to send; otherwise, it has a fault condition to report. IF SPR% <> &HC0 THEN GOTO 4000 If the data is valid, read the measurement.
  • Page 180: Basica Example Program - Board

    Write the function, range, and trigger source instructions to the DVM. WRT$ = "F3R7T3" : CALL IBWRT (BRD0%,WRT$) IF IBSTA% < 0 THEN GOTO 3000 ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls send the Device Clear (DCL) 4A-105 GPIB-PC User Manual...
  • Page 181 IBWAIT must have returned on SRQ. unaddress bus devices and send the Serial Poll Enable (SPE) command, then send the DVM's talk address and the GPIB-PC listen address &H20 (ASCII space). CMD$ = "?_" + CHR$(&H18) + "C " CALL IBCMD (BRD0%,CMD$) IF IBSTA% <...
  • Page 182 Section Four A Since the DVM and GPIB-PC are still addressed to talk and listen, the measurement can be read REM as follows. RD$ = SPACE$(16) : CALL IBRD (BRD0%,RD$) IF IBSTA% < 0 THEN GOTO 3000 To close out a programming sequence, send...
  • Page 183: Quickbasic Example Program - Device

    BASICA/QuickBASIC GPIB-PC Function Calls QuickBASIC Example Program - Device QuickBASIC - Using device function calls. COMMON SHARED IBSTA%, IBERR%, IBCNT% Assign a unique identifier to device and store in variable DVM%. BDNAME$ = "DVM" CALL IBFIND (BDNAME$,DVM%) Check for error on IBFIND call.
  • Page 184 For errors during data transfers, IBCNT may be examined to determine the actual number of bytes transferred. PRINT "GPIB ERROR" : STOP ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-109 GPIB-PC User Manual...
  • Page 185 BASICA/QuickBASIC GPIB-PC Function Calls DEVICE-ERROR: A routine at this location would analyze the fault code returned in the DVM's status byte and take appropriate action. PRINT "DVM ERROR" : STOP GPIB-PC User Manual 4A-110 ©National Instruments Corp. Section Four A...
  • Page 186: Quickbasic Example Program - Board

    CMD$ = CHR$(&H11)+"#" +CHR$(&H14)+"@" CALL IBCMD (BRD0%,CMD$) IF IBSTA% < 0 THEN GOSUB GPIB-ERROR: Write the function, range, and trigger source instructions to the DVM WRT$ = "F3R7T3" : CALL IBWRT (BRD0%,WRT$) ©National Instruments Corp. BASICA/QuickBASIC GPIB-PC Function Calls 4A-111 GPIB-PC User Manual...
  • Page 187 BASICA/QuickBASIC GPIB-PC Function Calls IF IBSTA% < 0 THEN GOSUB GPIB-ERROR: Send the GET message to trigger a measurement reading. CMD$ = CHR$(&H8) : CALL IBCMD (BRD0%,CMD$) IF IBSTA% < 0 THEN GOSUB GPIB-ERROR: Wait for the DVM to set SRQ or for a timeout;...
  • Page 188 Section Four A CMD$ = CHR$(&H19) : CALL IBCMD (BRD0%,CMD$) IF IBSTA% < 0 THEN GOSUB GPIB-ERROR: Since the DVM and GPIB-PC are still addressed to talk and listen, the measurement can be read as follows. RD$ = SPACE$(16) : CALL IBRD (BRD0%,RD$) IF IBSTA% <...
  • Page 189 This interactive method of data input and data/status output is designed to help you learn how to use the GPIB-PC functions to program your device. Once you develop a sequence of steps that works successfully for your system, you can easily incorporate the sequence into an application program using the appropriate language and syntax described in Section Four.
  • Page 190: Running Ibic

    IBIC Running IBIC The IBIC program, IBIC.EXE, is an executable file that was copied from the distribution diskette to a subdirectory called GPIB-PC when you ran IBSTART at installation. To run IBIC, change directory to C:\GPIB-PC and enter: C:\GPIB-PC> National Instruments...
  • Page 191: Using Help

    The name used with the IBFIND function must be a valid symbolic name known by the handler. Both dev1 and gpib0 are default names found in the handler. IBIC makes no distinction between uppercase and lowercase. ©National Instruments Corp. GPIB-PC User Manual IBIC...
  • Page 192 4E 44 43 56 28 30 30 30 2E 30 30 34 37 45 2B 30 0D 0A GPIB-PC User Manual N D C V ( 0 0 0 . 0 0 4 7 E + 0 • •...
  • Page 193 "F3R5T1\r\n" dev1: [0100] (cmpl) count: 6 The \r and \n represent the carriage return and linefeed characters respectively. See Table 5.3 for a more detailed description on the representation of non-printable characters. ©National Instruments Corp. GPIB-PC User Manual IBIC...
  • Page 194 The following example summarizes the use of IBFIND and SET in a typical program. Example: ibfind dev1 dev1: plotter: [0100] (cmpl) count: plotter: dev1: ibwrt "X7Y39G0" [0100] (cmpl) count: dev1: GPIB-PC User Manual ibfind plotter ibwrt "F3T7G0" set dev1 Section Five ©National Instruments Corp.
  • Page 195: Ibic Functions And Syntax

    IBIC. The screen prompt identifies which of these opened units IBIC will use in subsequent calls. Use the SET function to change from one of these units to another. ©National Instruments Corp. GPIB-PC User Manual IBIC...
  • Page 196: Other Ibic Functions And Syntax

    IBIC Other IBIC Functions and Syntax Table 5.1 summarizes the GPIB-PC functions and syntax when called from IBIC. Syntax rules for IBIC are explained in the table notes. Consult Section Four for detailed function descriptions and for syntax rules of the programming language you will use.
  • Page 197 \n for a linefeed character. These symbols provide a more convenient method for inserting the carriage return and linefeed ©National Instruments Corp. ibrsv v ibsad v ibsic ibsre [v] ibstop ibtmo v ibtrap mask v ibtrg ibwait [mask] ibwrt stringd ibwrta string ibwrtf flname NOTES GPIB-PC User Manual IBIC...
  • Page 198: Status Word

    In this example, the status word shows that the device level write operation completed successfully and that dev1 is requesting service. Table 5.2 lists the mnemonics of the status word. This is the same list that is given in Table 4.1. GPIB-PC User Manual 5-10 ©National Instruments Corp. Section Five...
  • Page 199: Error Code

    CMPL TACS LACS DTAS DCAS Error Code If a GPIB-PC function completes with an error, IBIC also displays the error mnemonic. The following example illustrates an error condition occurred in the data transfer. Example: dev1: [8100] (err cmpl) ERROR:...
  • Page 200: Byte Count

    Call IBFIND initially to open each device or board. If option is omitted, a menu of options appears. Replace function with correct IBIC function syntax. filename is the DOS pathname of a file that contains IBIC functions to be executed. GPIB-PC User Manual Function Syntax set bdname help...
  • Page 201: Set (Select Device Or Board)

    The SET function specifies a previously opened device or board to be used for subsequent GPIB-PC functions executed from IBIC. SET eliminates the need to include the BD unit descriptor in each GPIB-PC function call. The argument bdname is any of the symbolic device or board names recognized by the handler.
  • Page 202: (Repeat Previous Function)

    [130] - (Turn OFF Display) The - function causes the GPIB-PC function output NOT to be displayed on the screen. This function is useful when you want to repeat a GPIB-PC I/O function quickly without waiting for screen output to be displayed.
  • Page 203: (Turn On Display)

    8 [4100] (end cmpl) COUNT: 8 71 72 73 74 75 76 77 78 ©National Instruments Corp. a b c d q r s t 5-15 GPIB-PC User Manual IBIC e f g h u v w x...
  • Page 204: N* (Repeat Function N Times)

    Notice that the multiplier (*) does not become part of the function name; that is, ibwrt "Hello" is repeated 20 times, not 5* ibwrt "Hello". GPIB-PC User Manual 20* ! 10* ! 5-16 ©National Instruments Corp. Section Five...
  • Page 205: (Execute Indirect File)

    IBIC functions listed in the file usrfile, and 3*$ usrfile gpib0: repeats that operation three times. The display mode, in effect before this function is executed, is restored afterward but may be changed by functions in the indirect file. ©National Instruments Corp. 5-17 GPIB-PC User Manual...
  • Page 206: Print (Display The Ascii String)

    The second PRINT example illustrates the use of hex values in IBIC strings. E or Q (exit or quit) The DOS exit command or the IBIC function E or Q returns you to DOS. GPIB-PC User Manual 5-18 ©National Instruments Corp. Section Five...
  • Page 207: Ibic Sample Programs

    Refer to Section Four A, BASICA/QuickBASIC GPIB Programming Examples, for a description of the programming steps that could be used to program a representative IEEE-488 instrument from your personal computer using the GPIB-PC handler functions. The applications are written using IBIC commands. Device Function Calls To communicate with a device, first "find"...
  • Page 208 Wait for the DVM to request service or for a timeout; if the current timeout limit is too short, use ibtmo to change it. Example: DVM: ibwait (TIMO RQS) [800] (rqs) GPIB-PC User Manual 5-20 ©National Instruments Corp. Section Five...
  • Page 209 4E 44 43 56 20 30 30 30 N D C V 2E 30 30 34 37 45 28 30 . 0 0 4 7 OA OA ©National Instruments Corp. 5-21 GPIB-PC User Manual IBIC 0 0 0 E + 0...
  • Page 210: Board Function Calls

    Send the interface clear message (IFC) to all devices. This clears the bus and asserts attention (ATN) on the bus. The user should check for ERR after each GPIB function call to be safe. Example: GPIB0: [0130] (cmpl cic atn) GPIB-PC User Manual ibsic 5-22 Section Five ©National Instruments Corp.
  • Page 211 GPIB-PC board's talk address. This was calculated using the Multiline Interface Message chart in Appendix A. The GPIB-PC board is at GPIB primary address 0. Moving across to the Talk address column, the appropriate ASCII character is an @ character.
  • Page 212 [0188] (cmpl lok cic atn tacs) count: 1 Wait for the DVM to set SRQ or for a timeout; if the current timeout limit is too short, use IBTMO to change it. Example: GPIB-PC User Manual ibwrt "F3R7T3" ibcmd "\x08" 5-24 Section Five...
  • Page 213 Read the status byte. The status byte returned may vary depending on the device used. Example: GPIB0: [01E4] (cmpl lok rem cic atn lacs) count: 1 Complete the serial poll by sending the serial poll disable message (SPD). ©National Instruments Corp. ibwait (TIMO SRQI) ibrd 1 5-25 IBIC GPIB-PC User Manual...
  • Page 214 Example: GPIB0: ibcmd "\x19" [01F4] (cmpl lok rem cic atn lacs) count: 1 Since the DVM and the GPIB-PC are still addressed to talk and to listen, the measurement can be read. Example: ibrd 20 GPIB0: [01E4] (cmpl lok rem cic lacs) 0D 0A 4E 44 43 56 2D 30•...
  • Page 215 Section Five IBIC Example: GPIB0: e ©National Instruments Corp. 5-27 GPIB-PC User Manual...
  • Page 216: Section Six - Applications Monitor

    In addition, you can view a listing of up to 255 of the preceding calls to verify that the sequence of calls and their arguments have occurred as intended. Figure 6.1 - Applications Monitor Popup Screen ©National Instruments Corp. GPIB-PC User Manual...
  • Page 217: Installing The Applications Monitor

    See the description of IBTRAP in your language section for details on including IBTRAP calls in your application. The utility program IBTRAP may be used to set the trap mode from DOS. Simply type IBTRAP in response to the DOS prompt, specifying GPIB-PC User Manual ©National Instruments Corp.
  • Page 218 GPIB-PC is in Remote State -rem GPIB-PC is Controller-In-Charge -cic attention is asserted -atn -tacs GPIB-PC is Talker -lacs GPIB-PC is Listener -dtas GPIB-PC is in Device Trigger State -dcas GPIB-PC is in Device Clear State ©National Instruments Corp. GPIB-PC User Manual IBIC...
  • Page 219 IBTRAP -dis IBTRAP -off See Section Four of the Programming Language Supplement for the appropriate syntax to use in your application program. GPIB-PC User Manual record all GPIB handler calls and display the monitor whenever attention is asserted or the GPIB- PC Controller-in-Charge.
  • Page 220: Applications Monitor Options

    Error Information ©National Instruments Corp. symbolic device name. GPIB-PC function mnemonic and description. for functions that have a number as their second parameter, this contains its value, otherwise it is undefined. for functions that have a count as their third parameter this contains its value, otherwise it is undefined.
  • Page 221 IBIC Section Six NOTE: All numbers are displayed in hexadecimal. Also, the monitor is unable to record IBFIND or IBTRAP calls. GPIB-PC User Manual ©National Instruments Corp.
  • Page 222: Main Commands

    IBIC GPIB-PC User Manual...
  • Page 223: Session Summary Screen

    Use the up and down arrow keys to highlight the new mode and press ENTER to record the change. Pressing ESCAPE will cancel this action and leave the mode unchanged. GPIB-PC User Manual scrolls summary up one line scrolls summary down one line...
  • Page 224: Hiding And Showing The Monitor

    Pressing F7 will hide the monitor and restore the contents of the screen. This allows you to view program output written to the screen while active within the monitor. Pressing F7 again will restore the monitor. ©National Instruments Corp. GPIB-PC User Manual...
  • Page 225: Appendix A - Multiline Interface Messages

    The following tables are multiline interface messages (sent and received with ATN TRUE). The subsequent pages contain an interface message reference list, which describes the mnemonics and messages which correspond to the interface functions. ©National Instruments Corp. GPIB-PC User Manual...
  • Page 226 Multiline Interface Messages Multiline Interface Messages H e x O c t D e c ASCII GPIB-PC User Manual H e x O c t D e c ASCII P P C ©National Instruments Corp. Appendix A M s g...
  • Page 227: Multiline Interface Messages

    MTA28 MTA29 MTA30 M s g MSA0,PPE MSA1,PPE MSA2,PPE MSA3,PPE MSA4,PPE MSA5,PPE MSA6,PPE MSA7,PPE MSA8,PPE MSA9,PPE MSA10,PPE MSA11,PPE MSA12,PPE MSA13,PPE MSA14,PPE MSA15,PPE MSA16,PPD MSA17,PPD MSA18,PPD MSA19,PPD MSA20,PPD MSA21,PPD MSA22,PPD MSA23,PPD MSA24,PPD MSA25,PPD MSA26,PPD MSA27,PPD MSA28,PPD MSA29,PPD MSA30,PPD GPIB-PC User Manual...
  • Page 228: Interface Message Reference List

    [PPD] parallel poll disable [PPE] parallel poll enable PPRn parallel poll response n parallel poll unconfigure GPIB-PC User Manual Interface Function(s) L, LE L, LE L, LE SH, AH, T, TE, L, LE, SR, RL, PP, C AH, C T, TE...
  • Page 229 (via C) (via C) (via C) (via C) (via C) (via C) (via C) (via C) (via C) (via C) T, TE (via C) (via C) (via C) (via T, TE) (via C) (via C) (via C) GPIB-PC User Manual...
  • Page 230: Appendix B - Common Errors And Their Solutions

    • Reboot your system after you install the software. ECIC(1) Error Condition: Function requires GPIB-PC to be Controller-In- Charge. Solutions: • Run IBCONF and make sure the board being used (GPIB0 or GPIB1) is configured to be the System Controller.
  • Page 231: Enol(2

    IBCMD call match the device's GPIB address(es) and also that the listen address is in the range 20-3E hex (32-62 decimal) and the secondary address is in the range 60-7E hex (92-126 decimal). GPIB-PC User Manual ©National Instruments Corp. Appendix B...
  • Page 232: Eadr(3

    Appendix B EADR(3) Error Condition: GPIB-PC (GPIB0 or GPIB1) is not addressed correctly. Solutions: • Use IBCMD to send the appropriate Talk or Listen address before attempting an IBWRT or IBRD. • If calling IBGTS with the shadow handshake feature, call IBCMD to ensure that the GPIB ATN line is asserted.
  • Page 233: Esac(5

    Common Errors and Their Solutions ESAC(5) Error Condition: GPIB-PC not System Controller as required. Solutions: • Run IBCONF and make sure the board (GPIB0 or GPIB1) is configured to be System Controller. • Issue a board IBRSC function call with a value of 1 to request System Control.
  • Page 234: Eneb(7

    Appendix B ENEB(7) Error Condition: Non-existent GPIB-PC board. Solution: • Run IBCONF and make sure the board type (GPIB-PCII, PCIIA or PCIII) and base I/O address match the hardware and address switch settings. If you make any changes, reboot after leaving IBCONF.
  • Page 235: Ebus(14

    Using IBIC, attach one device at a time and determine that it is unasserting SRQ after being polled. • Inspect the interconnecting cable to see that the devices are attached and that the connectors are seated properly. GPIB-PC User Manual ©National Instruments Corp. Appendix B...
  • Page 236: Other Error Conditions

    IBSTART. Solution: • IBSTART copies the files to the subdirectory \GPIB-PC on the boot disk. Only GPIB.COM and IBCONF.EXE are copied to the root directory. Change to the \GPIB-PC directory with the DOS command cd \GPIB-PC to run other programs.
  • Page 237 Many do not. • If an interrupt problem persists, configure the hardware and software for non-DMA or non-interrupt operation. You may have a PC compatible that is not totally compatible. GPIB-PC User Manual ©National Instruments Corp. Appendix B...
  • Page 238 • When running a program check for errors after each GPIB-PC function call . If an early call failed but you did not check IBSTA, later functions will behave improperly and give misleading status data.
  • Page 239: Software Revisions

    Revision B and Revision C Interrupts In Rev. C, the software is interrupt driven, improving its performance and taking advantage of the interrupt capabilities of the GPIB-PC interface board. Startup Program The Rev. C standard software package includes a startup program (IBSTART.BAT) to get you started faster.
  • Page 240: New Functions

    GPIB-PC cards and systems. Revision C and Revision D Both Rev. C and Rev. D software are current and are actively supported. The one you receive depends on the GPIB-PC interface hardware you buy. Device Functions Device I/O functions do not unaddress devices at the end of the call.
  • Page 241: Asynchronous I/O

    SRQI Status Bit In Rev. D the SRQI status bit always reflects the current level of the SRQ line whether or not the GPIB-PC is CIC. ATN and/or TIMO With the IBWAIT function, it is not possible to wait for the ATN or TIMO conditions.
  • Page 242: Appendix D - Using Your Printer With The Gpib-Pc

    Appendix D - Using your Printer with the GPIB-PC The Serial/Parallel port redirection feature in the GPIB-PC software allows you to replace default printer drivers so that output can be redirected to a GPIB printer or plotter. After the appropriate configuration, these GPIB devices can be accessed through system calls and other language printer commands (e.g., LPRINT, LPRINT USING,...
  • Page 243 Using your Printer with the GPIB-PC Examples: System PRINT FILE COPY FILE LPT1 BASIC GPIB-PC User Manual LPRINT "hello" OPEN "LPT1" FOR OUTPUT AS #1 PRINT #1, "it works!" Appendix D ©National Instruments Corp.
  • Page 244: Appendix E - Application Notes

    NO and set the primary address of GPIB0 to 1. Exit the IBCONF programs and reboot both computers. Step 2. Establish Communication Run the IBIC facility on both computers, type the respective commands, and press the enter key. Example: Master Slave ibfind GPIB0 ibfind SLAVE ©National Instruments Corp. GPIB-PC User Manual...
  • Page 245: Step 3. Transfer Data

    NOTE: The read and write commands must be executed here within a certain time limit of each other; otherwise the timeout factor which comes at a default of ten seconds will abort the operation. GPIB-PC User Manual Slave GPIB0: Slave...
  • Page 246 Appendix F Customer Communication National Instruments provides comprehensive technical assistance around the world. In the U.S. and Canada, applications engineers are available Monday through Friday from 8:00 a.m. to 6:00 p.m. (central time). In other countries, contact the nearest branch office. You may fax questions to us at any time.
  • Page 247 National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: GPIB-PC User Manual for the IBM Personal Computer and Compatibles Edition Date: April 1988 Part Number: 320014-01 Please comment on the completeness, clarity, and organization of the manual.
  • Page 248 Thank you for your help. Name Title Company Address Phone Mail to: Technical Publications National Instruments Corporation 6504 Bridge Point Parkway, MS 53-02 Austin, TX 78730-5039 Fax to: Technical Publications National Instruments Corporation MS 53-02 (512) 794-5678...
  • Page 249: Glossary

    GPIB-PC interface board or other GPIB device that is the object of the function. See Unit Descriptor. BOARD - One of the GPIB-PC interface boards in the computer. See Device. BOARD FUNCTION - A function that operates on or otherwise pertains to one of the GPIB-PC interface boards in the computer.
  • Page 250 See Commands or Interface Message. DEVICE FUNCTION - A function that operates on or otherwise pertains to a GPIB device rather than to the GPIB-PC interface board in the computer. See Board Function. DIO1-DIO8 - The GPIB lines that are used to transmit command or data bytes from one device to another.
  • Page 251 GPIB ADDRESS - The address of a device on the GPIB, composed of a primary address (MLA and MTA) and perhaps a secondary address (MSA). The GPIB-PC has both a GPIB address and an I/O address. GPIB.COM - The GPIB-PC handler filename.
  • Page 252 GPIB-PC and other devices on the GPIB. I/O ADDRESS - The address of the GPIB-PC from the CPU's point of view, as opposed to the GPIB address of the GPIB-PC. Also called port address or board address.
  • Page 253 NRFD or NOT READY FOR DATA - One of the three GPIB handshake lines. See Handshake. ON PEN STATEMENT - National Instruments uses this statement to intercept SRQ interrupts and make them available to user programs. OPENED DEVICE OR BOARD - One that has been enabled or placed online by the IBFIND function.
  • Page 254 PPU or PARALLEL POLL UNCONFIGURE - A GPIB command used to disable any device from participating in polls. PROGRAMMED I/O - Low speed data transfer between the GPIB-PC and memory in which the CPU moves each data byte according to program instructions.
  • Page 255 TCT or TAKE CONTROL - A GPIB command used to pass control of the bus from the current Controller to an addressed Talker. TIMEOUT - A feature of the GPIB-PC handler that prevents I/O functions from hanging indefinitely when there is a problem on the GPIB.
  • Page 256 Auto serial polling (Boards Only), disable 2-15 Automatic serial polling 4-13 Auxiliary IBIC functions 5-12 Base I/O address (Boards Only) 2-15 BASICA Files 4A-2 GPIB-PC I/O Functions 4A-5 ON SRQ 4A-6 Programming Preparation 4A-3 Board base I/O address 2-15 characteristics 2-12...
  • Page 257 Device map for board GPIBx, upper level 2-10 Device map, concepts and terms 2-11 Device/board characteristics, lower level 2-11 Differences between software revisions C-1 Disable auto serial polling (Boards Only) 2-15 DMA channel (Boards Only) 2-16 GPIB-PC User Manual 2-11 ©National Instruments Corp.
  • Page 258 1-6 data lines 1-3 error codes 4-6 functions 5-7 messages 1-1 operation 1-1 data lines 1-3 handshake lines 1-3 interface management lines 1-4 signals and lines 1-3, related documents 1-9 GPIB-PC Model 2-14 ©National Instruments Corp, I-3GPIB-PC User Manual Index...
  • Page 259 Index GPIB-PC characteristics of 2-7 functions introduction to 3-1 BASICA/QuickBASIC GPIB I/O 4A-2, 4A-5 IBIC 5-7, 5-8 Introduction, GPIB-PC Functions 3-1 model 2-14 software installation 2-3 Using 2-18 using your printer with D-1 Group I 3-2 Group II 3-3 Clearing the Device vs Clearing the GPIB 3-4...
  • Page 260 Local Lockout on all Devices 2-15 Local mode, device 3-5 Low level functions 3-1 Lower level, device/board characteristics 2-12 Messages, types of 1-1 More about Device and Board Functions 3-14 Multiboard capability 3-9 Multiline interface messages A-1 ©National Instruments Corp, I-5GPIB-PC User Manual Index...
  • Page 261 Index n* (repeat function n times) 5-16 Overview, GPIB-PC Functions 4-1 Physical characteristics 1-5 Placing device local mode 3-5 remote mode 3-4 Preparation, software 2-3 Preparations, programming 4A-3, 4A-4 Primary default characteristics 2-18 Primary GPIB address 2-12 PRINT (display the ASCII string) 5-18...
  • Page 262 Turn OFF display (-) 5-14 Turn ON display (+) 5-15 Upper and lower levels of IBCONF 2-10 Upper level, device map for board GPIBx 2-10 Using your GPIB-PC 2-18 Using your Printer with the MC-GPIB D-1 Wait mask layout 4A-84 Write termination 4-11 ©National Instruments Corp,...

Table of Contents