National Instruments NI-488.2 User Manual

National Instruments NI-488.2 User Manual

National instruments user manual ni-488.2
Hide thumbs Also See for NI-488.2:
Table of Contents

Advertisement

NI-488.2
NI-488.2 User Manual
for Windows
NI-488.2 User Manual for Windows
June 1999 Edition
Part Number 321819D-01

Advertisement

Table of Contents
loading

Summary of Contents for National Instruments NI-488.2

  • Page 1 NI-488.2 ™ NI-488.2 User Manual for Windows NI-488.2 User Manual for Windows June 1999 Edition Part Number 321819D-01...
  • Page 2 Switzerland 056 200 51 51, Taiwan 02 2377 1200, United Kingdom 01635 523545 For further support information, see the Technical Support Resources appendix. To comment on the documentation, send e-mail to techpubs@natinst.com. © Copyright 1998, 1999 National Instruments Corporation. All rights reserved.
  • Page 3: Important Information

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

    Communicate with Your Instrument ...2-6 Basic Communication (Query/Write/Read) ...2-6 Advanced Communication ...2-7 View NI-488.2 Software Version ...2-8 Monitor, Record, and Display NI-488.2 Calls...2-8 View or Change GPIB Interface Settings ...2-9 Windows 98/95...2-9 Windows 2000/NT ...2-10 View GPIB Instrument Information ...2-11 Change GPIB Device Templates ...2-12...
  • Page 5 Directly Accessing the gpib-32.dll Exports... 3-14 Running Existing NI-488.2 Applications ... 3-17 Running Existing Win32 and Win16 NI-488.2 Applications ... 3-17 Running Existing DOS NI-488.2 Applications Under Windows 98/95 ... 3-17 Running Existing DOS NI-488.2 Applications under Windows 2000/NT... 3-18 NI-488.2 User Manual for Windows...
  • Page 6 Interactive Control Utility Overview...6-1 Getting Started with Interactive Control...6-1 Interactive Control Syntax ...6-4 Number Syntax...6-4 String Syntax ...6-4 Address Syntax...6-5 Interactive Control Commands ...6-5 Status Word...6-10 Error Information ...6-10 Count Information...6-11 © National Instruments Corporation NI-488.2 User Manual for Windows Contents...
  • Page 7 Automatic Serial Polling ... 7-13 Stuck SRQ State ... 7-13 Autopolling and Interrupts... 7-14 SRQ and Serial Polling with Device-Level Traditional NI-488.2 Calls... 7-14 SRQ and Serial Polling with Multi-Device NI-488.2 Calls... 7-15 Example 1: Using FindRQS ... 7-16 Example 2: Using AllSpoll... 7-16 Parallel Polling ...
  • Page 8 Viewing Documentation on Your CD...2-3 Figure 2-3. NI-488.2 Troubleshooting Wizard ...2-4 Figure 2-4. NI-488.2 Communicator ...2-7 Figure 2-5. NI-488.2 Calls Recorded by NI Spy ...2-9 Figure 2-6. Properties Dialog Box in Windows 98/95...2-10 Figure 2-7. GPIB Configuration Utility in Windows NT ...2-11 Figure 3-1.
  • Page 9 Table 6-2. Syntax for Board-Level Traditional NI-488.2 Calls in Interactive Control ... 6-7 Table 6-3. Syntax for Multi-Device NI-488.2 Calls in Interactive Control ... 6-8 Table 6-4. Auxiliary Functions in Interactive Control ... 6-9 Table A-1. GPIB Handshake Lines... A-3 Table A-2.
  • Page 10: About This Manual

    The NI-488.2 for Windows Online Help addresses questions you might have about NI-488.2, includes troubleshooting information, and describes the NI-488.2 API. You can access the NI-488.2 online help as follows: © National Instruments Corporation The Getting Started card briefly describes how to install the NI-488.2 software and your GPIB hardware.
  • Page 11: Conventions

    The following documents contain information that you may find helpful as you read this manual: • • NI-488.2 User Manual for Windows ANSI/IEEE Standard 488.1-1987, IEEE Standard Digital Interface for Programmable Instrumentation ANSI/IEEE Standard 488.2-1992, IEEE Standard Codes, Formats, Protocols, and Common Commands...
  • Page 12: Introduction

    © National Instruments Corporation Device A Device B Device C a. Linear Configuration Figure 1-1. Linear and Star System Configuration Device A Device D Device B Device C b. Star Configuration NI-488.2 User Manual for Windows...
  • Page 13: Controlling More Than One Interface

    The following restrictions are typical: • • • NI-488.2 User Manual for Windows gpib0 gpib1 Printer Figure 1-2. Example of Multiboard System Configuration A maximum separation of 4 m between any two devices and an average separation of 2 m over the entire bus.
  • Page 14 Cable lengths must be as short as possible with up to a maximum of 15 m of cable for each system. There must be at least one equivalent device load per meter of cable. Chapter 1 Introduction NI-488.2 User Manual for Windows...
  • Page 15: Measurement & Automation Explorer

    GPIB instrument communication. Launch the NI-488.2 Troubleshooting Wizard to troubleshoot GPIB and NI-488.2 problems. Launch NI Spy to monitor NI-488.2 or VISA API calls to GPIB interfaces. View information about your GPIB hardware and NI-488.2 software. Reconfigure the GPIB interface settings.
  • Page 16: Starting Measurement & Automation Explorer

    Automation Explorer, complete the following steps: NI-488.2 User Manual for Windows Figure 2-1. Measurement & Automation Explorer Refer to your Getting Started card and install the NI-488.2 software and your GPIB hardware. If you do not have a Getting Started card, complete the following steps to view your getting started documentation: Insert the NI-488.2 for Windows CD.
  • Page 17: Figure 2-2. Viewing Documentation On Your Cd

    Note After you install the NI-488.2 software and restart your system, the NI-488.2 Getting Started Wizard runs automatically. To start it within Measurement & Automation Explorer, select Measurement & Automation in the left window pane and select Help»Getting Started»NI-488.2 Getting Started Wizard.
  • Page 18: Troubleshoot Ni-488.2 Problems

    In the right window pane, double-click on the Add Device or Interface icon. The Insert New dialog box appears. Double-click on the GPIB Interface item. If you are using Windows 98/95, the Add GPIB Hardware Wizard appears. If you are using Windows 2000/NT, the NI-488.2 Configuration utility appears. www.natinst.com...
  • Page 19: Delete A Gpib Interface

    © National Instruments Corporation Chapter 2 Use either the Add GPIB Hardware Wizard or the NI-488.2 Configuration utility to add your interface. Select Start»Programs»National Instruments NI-488.2»Explore GPIB to start Measurement & Automation Explorer.
  • Page 20: Instruments Not Found

    GPIB instrument. Most instruments respond to the *IDN? Basic Communication (Query/Write/Read) To establish basic communication with your instrument, use the NI-488.2 Communicator, as follows: NI-488.2 User Manual for Windows Instruments not Found Instruments.
  • Page 21: Advanced Communication

    Right-click on your GPIB instrument and select Communicate with Instrument from the drop-down menu that appears. The NI-488.2 Communicator dialog box appears, as shown in Figure 2-4. Figure 2-4. NI-488.2 Communicator Type a command in the Send String field and do one of the following: •...
  • Page 22: View Ni-488.2 Software Version

    To view the online help for Interactive Control, type Control command prompt. View NI-488.2 Software Version To view the NI-488.2 software version, complete the following steps: Monitor, Record, and Display NI-488.2 Calls To monitor NI-488.2 calls, use NI Spy, as follows: NI-488.2 User Manual for Windows...
  • Page 23: View Or Change Gpib Interface Settings

    To view or change your interface settings in Windows 98/95, complete the following steps: © National Instruments Corporation Chapter 2 NI Spy records and displays all NI-488.2 calls, as shown in Figure 2-5. Figure 2-5. NI-488.2 Calls Recorded by NI Spy NI Spy Select Start»Programs»National Instruments NI-488.2»Explore GPIB to start Measurement &...
  • Page 24: Windows 2000/Nt

    Windows 2000/NT To view or change GPIB interface information, complete the following steps: NI-488.2 User Manual for Windows The Properties dialog box appears. Figure 2-6 shows the Properties dialog box for an AT-GPIB/TNT (Plug and Play) interface. Figure 2-6. Properties Dialog Box in Windows 98/95...
  • Page 25: View Gpib Instrument Information

    Expand the Devices and Interfaces directory by clicking on the + next to the folder. Select your GPIB interface. Measurement & Automation Explorer displays the connected instruments in the right window pane. Table 2-1 describes the 2-11 Measurement & Automation Explorer section earlier in this NI-488.2 User Manual for Windows...
  • Page 26: Change Gpib Device Templates

    Measurement & Automation Explorer Name Type Value Description Change GPIB Device Templates For older NI-488.2 applications, you might need to modify one of the device templates to find a given GPIB instrument by name, for example, ibfind("fluke45") preferred ibfind ibdev eliminates unneccessary device name requirements.
  • Page 27: Windows 2000/Nt

    Click on the Configure button and rename the device template as described in your application documentation. Click on the OK button twice to save your changes and exit. Make sure that no older version of the NI-488.2 DOS device driver is being loaded from your config.sys...
  • Page 28: Access Additional Help And Resources

    To disable DOS support, add Access Additional Help and Resources To access additional help and resources for the NI-488.2 software and your GPIB hardware, refer to the following sections. NI-488.2 Online Help The NI-488.2 for Windows Online Help addresses questions you might have about NI-488.2, includes troubleshooting information, and describes...
  • Page 29: National Instruments Gpib Web Site

    Automation Explorer, as follows: © National Instruments Corporation Chapter 2 Right-click on your GPIB interface and select NI-488.2 Help from the drop-down menu that appears. Contact your network administrator to determine whether you should use the Assign IP Address utility to assign the IP address manually.
  • Page 30: Update Gpib-Enet Firmware

    Explorer, as follows: To view the built-in, context-sensitive help for the Update Firmware utility, click on the Help button. NI-488.2 User Manual for Windows Expand the Devices and Interfaces directory by clicking on the + next to the folder. Right-click on your GPIB-ENET interface and select Advanced IP Settings from the drop-down menu that appears.
  • Page 31: Simple Instrument Control

    Developing Your NI-488.2 Application This chapter describes how to develop an NI-488.2 application using the NI-488.2 API. Simple Instrument Control To establish basic communication with your instrument, use the NI-488.2 Communicator, as follows: © National Instruments Corporation If you have not already done so, scan for connected instruments as...
  • Page 32: Interactive Instrument Control

    Show Sample button. Interactive Instrument Control Before you write your NI-488.2 application, you might want to use the Interactive Control utility to communicate with your instruments interactively by typing individual commands rather than issuing them from an application.
  • Page 33: Choosing Your Programming Methodology

    Choosing Your Programming Methodology Based on your development environment, you can select a method for accessing the driver, and based on your NI-488.2 programming needs, you can choose how to use the NI-488.2 API. Choosing a Method to Access the NI-488.2 Driver Applications can access the NI-488.2 dynamic link library (DLL),...
  • Page 34: Choosing How To Use The Ni-488.2 Api

    Developing Your NI-488.2 Application Choosing How to Use the NI-488.2 API The NI-488.2 API has two subsets of calls to meet your application needs. Both of these sets, the traditional calls and the multi-device calls, are compatible across computer platforms and operating systems, so you can port programs to other platforms with little or no source code modification.
  • Page 35: Using Multiple Interfaces And/Or Multiple Devices

    NI-488.2 calls to have access to all the NI-488.2 functionality. Checking Status with Global Variables Each NI-488.2 API call updates four global variables to reflect the status of the device or interface that you are using. These global status variables are...
  • Page 36: Table 3-1. Status Word Layout

    A bit value of zero (0) indicates that the condition is not in effect. Each bit in NI-488.2 calls (dev), board-level traditional NI-488.2 calls and multi-device NI-488.2 calls (brd), or all (dev, brd). Table 3-1 shows the condition that each bit position represents, the bit mnemonics, and the type of calls for which the bit can be set.
  • Page 37: Error Variable (Iberr)

    The language header file defines each of the for an C/C++). For example, the To check for an NI-488.2 error, use the following statement after each NI-488.2 call: if (ibsta & ERR) Error Variable (iberr) If the ERR bit is set in error occurs, the error type is specified by error, use the following statement after each NI-488.2 call:...
  • Page 38: Programming Models

    . The standard Windows header file, decl-32.h contains definitions used by decl-32.h prototypes for the NI-488.2 calls and constants that you can use in your application. Error checking—Check for errors after each NI-488.2 call. Error handling—Declare and define a function to handle NI-488.2 errors.
  • Page 39 • • • • A successful device-level traditional NI-488.2 calls that communicate with the GPIB instrument. Step 2. Clear the Device the default state. Device Communication Step 3. Communicate with the Device Communicate with the device by sending it the reading back the response.
  • Page 40: Applications That Use Multiple Interfaces Or Communicate With Multiple Gpib Devices

    . The standard Windows header file, decl-32.h contains definitions used by decl-32.h prototypes for the NI-488.2 calls and constants that you can use in your application. Error checking—Check for errors after each NI-488.2 call. Error handling—Declare and define a function to handle NI-488.2 errors.
  • Page 41 Alternately, if you already know your GPIB device’s primary and secondary address, you can create an appropriate GPIB address to use in subsequent NI-488.2 calls, as follows: a GPIB address is a 16-bit value that contains the primary address in the low byte and the secondary address in the high byte.
  • Page 42: Language-Specific Programming Instructions

    Step 5. Place the Interface Offline before Exiting Your Application Language-Specific Programming Instructions The following sections describe how to develop, compile, and link your Win32 NI-488.2 applications using various programming languages. Microsoft Visual C/C++ (Version 2.0 or Later) Before you compile your Win32 C application, make sure that the following lines are included at the beginning of your program: #include <windows.h>...
  • Page 43: Visual Basic (Version 4.0 Or Later)

    For more information about function syntax for Visual Basic, refer to the NI-488.2 online help. For instructions on accessing the online help, refer to the...
  • Page 44: Directly Accessing The Gpib-32.Dll Exports

    , you must define the direct entry prototypes for the , refer to the NI-488.2 online help. For gpib-32.dll section in About This . For more information about direct entry, refer to the gpib-32.dll exports. The following code fragment shows gpib-32.dll...
  • Page 45 For the prototypes for each function, refer to the NI-488.2 online help. For instructions on accessing the online help, refer to the Documentation For functions that return an integer value, like to the function needs to be cast as follows:...
  • Page 46 FreeLibrary(Gpib32Lib); For more examples of directly accessing entry sample programs with the NI-488.2 software. For more information about direct entry, refer to the online help for your development environment. NI-488.2 User Manual for Windows (LPCSTR)"user_ibcnt"); (int, int, int, int, int, int)) GetProcAddress(Gpib32Lib, (LPCSTR)"ibdev");...
  • Page 47: Running Existing Ni-488.2 Applications

    To configure the NI-488.2 software to run existing DOS NI-488.2 applications, complete the following steps: © National Instruments Corporation Chapter 3 Make sure that no older version of the NI-488.2 DOS device driver is being loaded from your config.sys following steps: Locate your config.sys...
  • Page 48: Running Existing Dos Ni-488.2 Applications Under Windows 2000/Nt

    Chapter 3 Developing Your NI-488.2 Application Running Existing DOS NI-488.2 Applications under Windows 2000/NT To run DOS NI-488.2 applications, you must enable NI-488.2 DOS support under Windows 2000/NT. To enable NI-488.2 DOS support in Windows 2000/NT, complete the following steps: To disable DOS support, add NI-488.2 User Manual for Windows...
  • Page 49: Debugging Your Application

    Debugging Your Application This chapter describes several ways to debug your application. NI Spy The NI Spy utility monitors NI-488.2 API calls made by NI-488.2 applications. It records NI-488.2 API input and output values from all Win32, Win16, and DOS NI-488.2 applications.
  • Page 50: Global Status Variables

    If a NI-488.2 call failed, the high bit of failed NI-488.2 call, error cases, the value in You can use NI Spy to determine which NI-488.2 call is failing. Once you know which NI-488.2 call fails, refer to Appendix B, Conditions, and Appendix C, understanding why the NI-488.2 call failed.
  • Page 51: Existing Applications

    To start NI Spy, refer to the After you have an NI Spy capture file, you can use NI Spy to search for failed NI-488.2 calls by searching for calls with the ERR bit set. Once you know which NI-488.2 call fails, refer to Appendix B, Conditions, and Appendix C, understanding why the NI-488.2 call failed.
  • Page 52: Timing Errors

    NI-488.2 call. One way to do this is to have your device communicate its status whenever possible. Although this method is not possible with many devices, it is usually the best option.
  • Page 53: Communication Errors

    You should be aware of the data termination method that your device uses. By default, your NI-488.2 software is configured to send EOI on writes and terminate reads on EOI or a specific byte count. If you send a command string to your device and it does not respond, it might not be recognizing the end of the command.
  • Page 54: Ni Spy Utility

    Overview NI Spy monitors, records, and displays the NI-488.2 calls made from Win32, Win16, and DOS NI-488.2 applications. It is a useful tool for troubleshooting errors in your application and for verifying that the communication with your GPIB instrument is correct.
  • Page 55: Using The Ni Spy Online Help

    Locating Errors with NI Spy All NI-488.2 calls returned with an error are displayed in red within the main NI Spy window. Viewing Properties for Recorded Calls To see the detailed properties of any call recorded in the main NI Spy window, double-click on the call.
  • Page 56: Exiting Ni Spy

    File»Exit to exit the NI Spy utility. Performance Considerations NI Spy can slow down the performance of your NI-488.2 application, and certain configurations of NI Spy have a larger impact on performance than others. For example, configuring NI Spy to record calls to an output file or to use full buffers might have a significant impact on the performance of both your application and your system.
  • Page 57: Interactive Control Utility

    Select Start»Programs»National Instruments NI-488.2»Explore GPIB to start Measurement & Automation Explorer. Expand the Devices and Interfaces directory by clicking on the + next to the folder. ) in hexadecimal notation. ibsta. ) if an error exists iberr NI-488.2 User Manual for Windows...
  • Page 58: Figure 6-1. Instrument Address In Measurement & Automation Explorer

    The instrument shown in Figure 6-1 has a primary address of and no secondary address. NI-488.2 User Manual for Windows Right-click on your GPIB interface and select Interactive Control from the drop-down menu that appears.
  • Page 59 © National Instruments Corporation After you successfully complete new prompt, , represents a device-level handle that you can use for further NI-488.2 calls. To clear the device, use ud0: ibclr [0100] (cmpl) To write data to the device, use documentation that came with your GPIB instrument for recognized command messages.
  • Page 60: Interactive Control Syntax

    ASCII character sequence—You must enclose the entire sequence in quotation marks. Hex byte—You must use a backslash character and an hex value. For example, hex 40 is represented by NI-488.2 User Manual for Windows command properly closes the device handle and the ibonl prompt is no longer available.
  • Page 61: Address Syntax

    Address Syntax Some of the NI-488.2 calls have an address or address list parameter. An address is a 16-bit representation of the GPIB device address. The primary address is stored in the low byte and the secondary address, if any, is stored in the high byte.
  • Page 62 Chapter 6 Interactive Control Utility Table 6-1. Syntax for Device-Level Traditional NI-488.2 Calls in Interactive Control (Continued) Syntax Change/disable EOS message ibeos v Enable/disable END message ibeot v Check for presence of device on the GPIB at ibln pad sad...
  • Page 63: Interactive Control

    Table 6-2. Syntax for Board-Level Traditional NI-488.2 Calls in Interactive Control Syntax Return configuration information where ibask option a configuration parameter Become active Controller ibcac v Send commands ibcmd cmdbuf Send commands asynchronously ibcmda cmdbuf Alter configurable parameters where ibconfig option...
  • Page 64: Table 6-3. Syntax For Multi-Device Ni-488.2 Calls In Interactive Control

    Chapter 6 Interactive Control Utility Table 6-2. Syntax for Board-Level Traditional NI-488.2 Calls in Interactive Control (Continued) Syntax Send interface clear ibsic Set/clear remote enable line ibsre v Abort asynchronous operation ibstop Change/disable time limit ibtmo v Wait for selected event where...
  • Page 65: Table 6-4. Auxiliary Functions In Interactive Control

    Table 6-3. Syntax for Multi-Device NI-488.2 Calls in Interactive Control (Continued) Syntax ReceiveSetup address ResetSys addrlist Send address buffer eotmode SendCmds buffer SendDataBytes buffer eotmode SendIFC SendList addrlist buffer eotmode SendLLO SendSetup addrlist SetRWLS addrlist TestSRQ TestSys addrlist Trigger address...
  • Page 66: Status Word

    For more information about NI-488.2 Error Information If an NI-488.2 call completes with an error, the Interactive Control utility displays the relevant error mnemonic. In the following example, an error condition EBUS has occurred during a data transfer: ud0: ibwrt "*IDN?"...
  • Page 67: Count Information

    Interactive Control utility displays the index of the invalid address as the count. The count has a different meaning depending on which NI-488.2 call is made. For the correct interpretation of the count return, refer to the function descriptions in the NI-488.2 online help.
  • Page 68: Ni-488.2 Programming Techniques

    NI-488.2 Programming Techniques This chapter describes techniques for using some NI-488.2 calls in your application. For more information about each function, refer to the NI-488.2 online help. For instructions on accessing the online help, refer to the NI-488.2 Documentation Termination of Data Transfers...
  • Page 69: High-Speed Data Transfers (Hs488)

    High-Speed Data Transfers (HS488) National Instruments has designed a high-speed data transfer protocol for IEEE 488 called HS488. This protocol increases performance for GPIB reads and writes up to 8 Mbytes/s, depending on your system.
  • Page 70: System Configuration Effects On Hs488

    HS488 configuration message when you use to bring a device online. If you call length, the NI-488.2 software sends out the HS488 message again, the next time you call a device-level function. If you are using board-level traditional NI-488.2 calls or multi-device NI-488.2 calls and you want to configure devices for high-speed, you must...
  • Page 71: Waiting For Gpib Conditions

    GPIB device. Then, when your GPIB device requests service, the NI-488.2 driver automatically notifies your application that the event has occurred by invoking a callback function. The callback function is registered with the NI-488.2 driver when Calling the ibnotify Function ibnotify...
  • Page 72: Ibnotify Programming Example

    GPIB device to request service, you might choose to pass mask The callback function that you register with the by the NI-488.2 driver when one or more of the mask bits passed to ibnotify int __stdcall Callback ( The callback function is passed a unit descriptor, the current values of the NI-488.2 global variables, and the user-defined reference data that was...
  • Page 73 ("unable to write to device.\n"); return 0; // set up the asynchronous event notification on RQS ibnotify (ud, RQS, MyCallback, NULL); NI-488.2 User Manual for Windows long LocalIbcntl, void *RefData); (0,// connect board // primary address of GPIB device...
  • Page 74 0; // If the returned status byte equals the expected response, then // the device has valid data to send; otherwise it has a fault © National Instruments Corporation LocalIberr); Chapter 7 NI-488.2 Programming Techniques NI-488.2 User Manual for Windows...
  • Page 75 // Issue a request to the device to send the data and rearm // callback on RQS. LocalIbsta = ibwrt (LocalUd, "SEND DATA", 9L); if (LocalIbsta & ERR) NI-488.2 User Manual for Windows SpollByte); printf ("ibwrt failed. No more callbacks.\n"); DeviceError = TRUE;...
  • Page 76: Writing Multithreaded Win32 Ni-488.2 Applications

    Thread #2 proceeds to make several NI-488.2 calls that automatically update the NI-488.2 globals. Later, when thread #1 is allowed to run, the NI-488.2 global that it is ready to examine is no longer in a known state and its value is no longer reliable.
  • Page 77 If you are using Notification in Win32 NI-488.2 Applications callback is executed in a separate thread that is created by the NI-488.2 driver. Therefore, if your application makes NI-488.2 calls from the NI-488.2 calls from other places, you must use the...
  • Page 78: Device-Level Calls And Bus Management

    • • If the current CIC does not pass control, the NI-488.2 driver returns the ECIC error code to your application. This error can occur if the current CIC does not understand the CIC protocol. If this happens, you could send a device-specific command requesting control for the GPIB interface.
  • Page 79: Serial Polling

    IEEE 488.2 events occurs. These events include power-on, user request, command error, execution error, device dependent error, query error, request control, and operation complete. The device can assert SRQ when ESB or MAV are set, or when a manufacturer-defined condition occurs. NI-488.2 User Manual for Windows 7-12 www.natinst.com...
  • Page 80: Automatic Serial Polling

    © National Instruments Corporation To enable autopolling, use the configuration function, option , or the NI-488.2 Configuration utility. IbcAUTOPOLL (Autopolling is enabled by default.) When the SRQ line is asserted, the driver automatically serial polls the open devices.
  • Page 81: Autopolling And Interrupts

    NI-488.2 call provided that no GPIB I/O is currently in progress. In this case, an automatic serial poll can occur even when your application is not making any calls to the NI-488.2 software. Autopolling can also occur when a device-level is in progress.
  • Page 82: Srq And Serial Polling With Multi-Device Ni-488.2 Calls

    Then, you must check the RQS bit of each status byte to determine whether that device requested service. is similar to ReadStatusByte polls a single device. It is also similar to the device-level NI-488.2 function. ibrsp serial polls a list of devices until it finds a device that is FindRQS requesting service or until it has polled all of the devices on the list.
  • Page 83: Example 1: Using Findrqs

    Example 2: Using AllSpoll This example shows you how to use with a single call: void GetAllSerialPollResponses ( Addr4882_t AddrList[], short ResponseList[] ) NI-488.2 User Manual for Windows char SerialPollResponse = 0; int WaitResult; Addr4882_t Addrlist[4] = {3,4,5,NOADDR}; WaitSRQ (0, &WaitResult);...
  • Page 84: Parallel Polling

    Implementing a Parallel Poll You can implement parallel polling with either the traditional or multi-device NI-488.2 calls. If you use multi-device NI-488.2 calls to execute parallel polls, you do not need extensive knowledge of the parallel polling messages. However, you should use the traditional NI-488.2 calls...
  • Page 85 NI-488.2 Programming Techniques NI-488.2 User Manual for Windows The following example code configures a device for parallel polling using traditional NI-488.2 calls. The device asserts DIO7 if its is 0. In this example, the command opens a device that has a primary...
  • Page 86: Parallel Polling With Multi-Device Ni-488.2 Calls

    Parallel Polling with Multi-Device NI-488.2 Calls Complete the following steps to implement parallel polling the using multi-device NI-488.2 calls. Each step contains example code. © National Instruments Corporation Configure the device for parallel polling using the unless the device can configure itself for parallel polling. The...
  • Page 87 Some devices are capable of playing more than one role. A digital voltmeter, for example, can be a Talker and a Listener. If your system has a National Instruments GPIB interface and software installed, it can function as a Talker, Listener, and Controller.
  • Page 88: Figure A-1. Gpib Address Bits

    16 signal lines and 8 ground return (shield drain) lines. The 16 signal lines are discussed in the following sections. Data Lines Eight data lines, DIO1 through DIO8, carry both data and command messages. NI-488.2 User Manual for Windows GPIB Primary Address Figure A-1. GPIB Address Bits (range 0–30) www.natinst.com...
  • Page 89: Table A-1. Gpib Handshake Lines

    Controller. Talker uses the EOI line to mark the end of a data message. Controller uses the EOI line when it conducts a parallel poll. Appendix A GPIB Basics Description Description NI-488.2 User Manual for Windows...
  • Page 90: Table B-1. Status Word Layout

    Status Word Conditions This appendix gives a detailed description of the conditions reported in the status word, For information about how to use to the NI-488.2 online help. For instructions on accessing the online help, refer to the Manual. Each bit in (dev, brd).
  • Page 91 EOS character by itself, END is not set. The application should check the last byte of the received buffer to see if it is the EOS character. NI-488.2 User Manual for Windows Error Codes and Solutions, describes error codes that are along with possible solutions.
  • Page 92 . You can also wait for a device to request service ibsta call is inoperative for that interface. LOK is EnableLocal ibloc Appendix B Status Word Conditions with a ibwait call on RQS for a device ibwait to acquire the serial poll ibrsp function. ibrsp NI-488.2 User Manual for Windows...
  • Page 93 Untalk (UNT) command, its own listen address, a talk address other than its own talk address, or Interface Clear (IFC). NI-488.2 User Manual for Windows When REN becomes unasserted. When the GPIB interface as a Listener detects that the Go to Local (GTL) command has been sent either by the GPIB interface or by another Controller.
  • Page 94 , and DCAS is set in ibwrt Send ibsta Appendix B Status Word Conditions function. ibgts ibgts ibwait mask parameter. after the next NI-488.2 ibsta , the I/O operation is ibsta after the next NI-488.2 call. NI-488.2 User Manual for Windows...
  • Page 95: Table C-1. Gpib Error Codes

    EOIP Asynchronous I/O in progress ECAP No capability for operation EFSO File system error EBUS GPIB bus error ESTB Serial poll status byte queue overflow ESRQ SRQ stuck in ON position ETAB Table problem Meaning NI-488.2 User Manual for Windows...
  • Page 96 Use only device or interface names that are configured in the NI-488.2 Configuration utility as parameters to the Use the NI-488.2 Troubleshooting Wizard to ensure that each interface you want to access is working properly, as follows: Select Start»Programs»National Instruments...
  • Page 97 Possible solutions for this error are as follows: • • • • © National Instruments Corporation ibcac ibgts Any NI-488.2 multi-device calls that issue GPIB command bytes: , and SendCmds PPoll Send to make the GPIB interface become CIC on ibsic SendIFC the GPIB.
  • Page 98 A multi-device NI-488.2 call made with an invalid address. called with an invalid data line or sense bit. PPollConfig Make sure that the parameters passed to the NI-488.2 call are valid. Do not use a device descriptor in a board function or vice-versa. when the shadow-handshake...
  • Page 99 GPIB interface does not have System Controller capability. Solutions Give the GPIB interface System Controller capability by calling or by using the NI-488.2 Configuration utility to configure that capability into the software. EABO (6) EABO indicates that an I/O operation has been canceled, usually due to a timeout condition.
  • Page 100 I/O address by running the NI-488.2 Troubleshooting Wizard, as follows: EDMA (8) EDMA occurs if a system DMA error is encountered when the NI-488.2 software attempts to transfer data over the GPIB using DMA. Solutions Possible solutions for this error are as follows: •...
  • Page 101 Make sure that the access mode of the file is correct. Make sure there is enough room on the disk to hold the file. Appendix C Error Codes and Solutions contains CMPL, the driver and call encounters a problem NI-488.2 User Manual for Windows...
  • Page 102 Call more frequently to empty the queue. ibrsp Disable autopolling with the ibconfig ) or the NI-488.2 Configuration utility, as follows: IbcAUTOPOLL Select Start»Programs»National Instruments NI-488.2»Explore GPIB to start Measurement & Automation Explorer. Expand the Devices and Interfaces directory by clicking on the + next to the folder.
  • Page 103 , increase the size of result arrays. In the case of FindLstn , check to see if other devices not used by your application are Appendix C Error Codes and Solutions call with RQS set in ibwait functions. ETAB FindRQS NI-488.2 User Manual for Windows...
  • Page 104 This appendix describes how to troubleshoot problems and answers some common questions about the NI-488.2 software for Windows 98/95. Troubleshooting EDVR Error Conditions In some cases, NI-488.2 calls may return with the ERR bit set in the value EDVR in troubleshooting the error condition.
  • Page 105 EDVR Error Condition with ibcntl Set to 0xE0140035 (–535560139) If a call is made with a device name that is not listed in the logical device templates that are part of the NI-488.2 Configuration utility, an EDVR error condition occurs with EDVR Error Condition with ibcntl Set to 0xE0320029 (–533594071) or...
  • Page 106: Table D-1. Device Manager Status Codes

    GPIB interface should show up without any problems. If the problem persists, contact National Instruments. Free up system resources by disabling other unnecessary hardware so that enough resources are available for the GPIB interface. Solution NI-488.2 User Manual for Windows...
  • Page 107 Enabling Interrupts In Windows 98/95, you can use your GPIB interface without interrupts, but the NI-488.2 software performance is significantly slower without interrupts. For example, transfer sizes between 1 and 10 bytes transfer at a rate of only 2% of the transfer rate with enabled interrupts. As the transfer size increases, the performance degradation decreases slightly, but it remains a significant problem for all transfers under 1 Mbyte.
  • Page 108 GPIB Hardware and follow the instructions on the screen. Common Questions How do I get started? To get started with your GPIB hardware and the NI-488.2 software, use the NI-488.2 Getting Started Wizard. To do so, select Start»Programs» National Instruments NI-488.2»Getting Started Wizard.
  • Page 109 100 GPIB interfaces. How many devices can I configure for use with the NI-488.2 software? You can configure the NI-488.2 software to use up to 1,024 logical devices. The default number of devices is 32. The maximum number of physical devices you should connect to a single GPIB interface is 14, or fewer, depending on your system configuration.
  • Page 110: Interactive Control

    Enabling Interrupts section earlier in this appendix. How can I determine if my GPIB hardware and the NI-488.2 software are installed properly? Run the NI-488.2 Troubleshooting Wizard. To do so, select Start» Programs»National Instruments NI-488.2»Explore GPIB. Then, select Help»Troubleshooting»NI-488.2 Troubleshooting Wizard.
  • Page 111 Windows 98/95: Troubleshooting and Common Questions How can I start communicating with my GPIB instrument? For simple instrument communication, use the NI-488.2 Communicator. For instructions on how to use the NI-488.2 Communicator, refer to the Basic Communication (Query/Write/Read) Measurement & Automation How do I check for errors in my NI-488.2 application?
  • Page 112 Windows 2000/NT. Common Questions How do I get started? To get started with your GPIB hardware and the NI-488.2 software, use the NI-488.2 Getting Started Wizard. To do so, select Start»Programs» National Instruments NI-488.2»Getting Started Wizard. How do I troubleshoot problems? Run the NI-488.2 Troubleshooting Wizard.
  • Page 113 GPIB interfaces. How many devices can I configure for use with the NI-488.2 software? You can configure the NI-488.2 software to use up to 100 logical devices. The default number of devices is 32. Are interrupts and DMA required with the NI-488.2 software? Interrupts are required, but DMA is not.
  • Page 114 Your Application. What information should I have before I call National Instruments? Before you call National Instruments, record the results of the NI-488.2 Troubleshooting Wizard. To start the NI-488.2 Troubleshooting Wizard, select Start»Programs»National Instruments NI-488.2»Explore GPIB. Then, select Help»Troubleshooting»NI-488.2 Troubleshooting Wizard.
  • Page 115 Technical Support Resources This appendix describes the comprehensive resources available to you in the Technical Support section of the National Instruments Web site and provides technical support telephone numbers for you to use if you have trouble connecting to our Web site or if you do not have internet access.
  • Page 116 Web sites from If you have trouble connecting to our Web site, please contact your local National Instruments office or the source from which you purchased your National Instruments product(s) to obtain support. For telephone support in the United States, dial 512 795 8248. For...
  • Page 117 GPIB SRQ line. Also called autopolling. base I/O address See I/O address. BIOS Basic Input/Output System. board-level function A rudimentary function that performs a single operation. © National Instruments Corporation Value –9 –3 NI-488.2 User Manual for Windows...
  • Page 118 A message that signals the end of a data string. END is sent by asserting the GPIB End or Identify (EOI) line with the last data byte. A GPIB line that signals either the last byte of a data message (END) or the parallel poll Identify (IDY) message. NI-488.2 User Manual for Windows www.natinst.com...
  • Page 119 (MLA and MTA) and perhaps a secondary address (MSA). The GPIB board has both a GPIB address and an I/O address. GPIB board Refers to the National Instruments family of GPIB interfaces. Go To Local. The GPIB command used to place an addressed Listener in local (front panel) control mode.
  • Page 120 GPIB reads and writes up to 8 Mbytes/s, depending on your system. Hertz. After each NI-488.2 I/O call, this global variable contains the actual ibcnt number of bytes transmitted. On systems with a 16-bit integer, such as MS-DOS, cross-platform compatibility, use After each NI-488.2 I/O call, this global variable contains the actual...
  • Page 121 An Individual Status bit of the status byte used in the Parallel Poll Configure function. Listen Address. See MLA. language interface Code that enables an application program that uses NI-488.2 calls to access the driver. Listener A GPIB device that receives data messages from a Talker.
  • Page 122 Low-speed data transfer between the GPIB interface and memory in which the CPU moves each data byte according to program instructions. See DMA. resynchronize The GPIB software and the user application must resynchronize after asynchronous I/O operations have completed. Request Service. NI-488.2 User Manual for Windows www.natinst.com...
  • Page 123 The single designated Controller that can assert control (become CIC of the GPIB) by sending the Interface Clear (IFC) message. Other devices can become CIC only by having control passed to them. © National Instruments Corporation ibsta Glossary NI-488.2 User Manual for Windows...
  • Page 124 GPIB interface or other GPIB device that is the object of the function. Unlisten. The GPIB command used to unaddress any active Listeners. Untalk. The GPIB command used to unaddress an active Talker. NI-488.2 User Manual for Windows www.natinst.com...
  • Page 125 3-11 items to include, 3-10 placing device offline, 3-12 single GPIB device, 3-8 to 3-9 clearing device, 3-9 communicating with device, 3-9 general steps and examples, 3-8 to 3-9 initialization, 3-8 to 3-9 NI-488.2 User Manual for Windows...
  • Page 126 Measurement & Automation Explorer, 2-6 to 2-8 advanced communication, 2-7 to 2-8 basic communication, 2-6 to 2-7 using NI-488.2 Communicator, 3-1 to 3-2 communication errors, 4-5 repeat addressing, 4-5 termination method, 4-5 configuration, 1-1 to 1-3. See also Interactive Control utility.
  • Page 127 See NI-488.2 calls. device-level calls and bus management, 7-11 Device Manager device status codes, troubleshooting, D-3 diagnostic resources, online, F-1 direct access to NI-488.2 dynamic link library, 3-3 © National Instruments Corporation documentation accessing NI-488.2 Online Help, xi...
  • Page 128 Interactive Control utility error information, 6-10 to 6-11 timing errors, 4-4 error variable (iberr), 3-7 ESAC error code, C-5 NI-488.2 User Manual for Windows ESRQ error code, C-8 to C-9 ESTB error code, C-8 ETAB error code, C-9 event notification. See asynchronous event notification in Win32 applications.
  • Page 129 3-8 using in Interactive Control utility (example), 6-2 ibeos function, 7-1 ibeot function, 7-1 iberr error variable, 3-7 ibnotify function asynchronous event notification example, 7-5 to 7-9 calling, 7-4 to 7-5 NI-488.2 User Manual for Windows Index...
  • Page 130 B-3 manual. See documentation. Measurement & Automation Explorer, 2-1 to 2-16 accessing additional help and resources, 2-14 to 2-15 National Instruments GPIB Web site, 2-15 NI-488.2 online help, 2-14 to 2-15 adding new GPIB interface, 2-4 to 2-5 www.natinst.com...
  • Page 131 * ! (execute previous function n times) function, Interactive Control utility, 6-10 n * (execute function n times) function, Interactive Control utility, 6-10 National Instruments Web support, F-1 to F-2 NDAC (not data accepted) line (table), A-3 NI-488.2 calls device-level calls and bus...
  • Page 132 Index NI-488.2 DLL choosing access method, 3-3 direct entry access, 3-3 NI-488.2 language interfaces, 3-3 NI-488.2 DOS support. See DOS NI-488.2 applications. NI-488.2 programming techniques. See also application development. asynchronous event notification in Win32 applications, 7-4 to 7-9 calling ibnotify function, 7-4 to 7-5...
  • Page 133 SRQ (service request) line purpose (table), A-3 serial polling automatic serial polling, 7-13 to 7-14 using device-level traditional NI-488.2 calls, 7-14 to 7-15 using multi-device NI-488.2 calls, 7-15 to 7-17 stuck SRQ state, 7-13 SRQI status word condition bit position, hex value, and type...
  • Page 134 F-1 using Measurement & Automation Explorer, 2-4 Windows 98/95, D-1 to D-8 common questions, D-5 to D-8 NI-488.2 User Manual for Windows Device Manager device status code, D-3 EDVR error conditions, D-1 to D-2 enabling interrupts, D-4 to D-5...
  • Page 135 2-13 to 2-14 running existing DOS NI-488.2 applications, 3-18 troubleshooting and common questions, E-1 to E-3 viewing or changing GPIB interface settings, 2-10 to 2-11 Worldwide technical support, F-2 © National Instruments Corporation I-11 NI-488.2 User Manual for Windows Index...

Table of Contents