National Instruments NI-488.2 User Manual

0 (0)

NI-488.2TM

NI-488.2 User Manual

January 2007 370428F-01

Worldwide Technical Support and Product Information

ni.com

National Instruments Corporate Headquarters

11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100

Worldwide Offices

Australia 1800 300 800, Austria 43 0 662 45 79 90 0, Belgium 32 0 2 757 00 20, Brazil 55 11 3262 3599, Canada 800 433 3488, China 86 21 6555 7838, Czech Republic 420 224 235 774, Denmark 45 45 76 26 00, Finland 385 0 9 725 725 11, France 33 0 1 48 14 24 24, Germany 49 0 89 741 31 30, India 91 80 41190000, Israel 972 0 3 6393737, Italy 39 02 413091, Japan 81 3 5472 2970, Korea 82 02 3451 3400,

Lebanon 961 0 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 0 348 433 466, New Zealand 0800 553 322, Norway 47 0 66 90 76 60, Poland 48 22 3390150, Portugal 351 210 311 210, Russia 7 495 783 68 51, Singapore 1800 226 5886, Slovenia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 0 8 587 895 00, Switzerland 41 56 200 51 51, Taiwan 886 02 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, United Kingdom 44 0 1635 523545

For further support information, see the Technical Support and Professional Services appendix. To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the info code feedback.

© 2002–2007 National Instruments Corporation. All rights reserved.

Important Information

Warranty

The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period. National Instruments does not warrant that the operation of the software shall be uninterrupted or error free.

A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty.

National Instruments believes that the information in this document is accurate. The document has been carefully reviewed for technical accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it.

EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CUSTOMERS RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL

INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER. NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation of

the liability of National Instruments will apply regardless of the form of action, whether in contract or tort, including negligence. Any action against National Instruments must be brought within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties, or other events outside reasonable control.

Copyright

Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation.

National Instruments respects the intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms of any applicable license or other legal restriction.

Trademarks

National Instruments, NI, ni.com, and LabVIEW are trademarks of National Instruments Corporation. Refer to the Terms of Use section on ni.com/legal for more information about National Instruments trademarks.

Other product and company names mentioned herein are trademarks or trade names of their respective companies.

Members of the National Instruments Alliance Partner Program are business entities independent from National Instruments and have no agency, partnership, or joint-venture relationship with National Instruments.

Patents

For patents covering National Instruments products, refer to the appropriate location: Help»Patents in your software, the patents.txt file on your CD, or ni.com/patents.

WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS

(1)NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN.

(2)IN ANY APPLICATION, INCLUDING THE ABOVE, RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY ADVERSE FACTORS, INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY, COMPUTER HARDWARE MALFUNCTIONS, COMPUTER OPERATING SYSTEM SOFTWARE FITNESS, FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO DEVELOP AN APPLICATION, INSTALLATION ERRORS, SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS, MALFUNCTIONS OR FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES, TRANSIENT FAILURES OF ELECTRONIC SYSTEMS (HARDWARE AND/OR SOFTWARE), UNANTICIPATED USES OR MISUSES, OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER (ADVERSE FACTORS SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED “SYSTEM FAILURES”). ANY APPLICATION WHERE A SYSTEM FAILURE WOULD CREATE A RISK OF HARM TO PROPERTY OR PERSONS (INCLUDING THE RISK OF BODILY INJURY AND DEATH) SHOULD NOT BE RELIANT SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE. TO AVOID DAMAGE, INJURY, OR DEATH, THE USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES, INCLUDING BUT NOT LIMITED TO BACK-UP OR SHUT DOWN MECHANISMS. BECAUSE EACH END-USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM NATIONAL INSTRUMENTS' TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS, THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION, INCLUDING, WITHOUT LIMITATION, THE APPROPRIATE DESIGN, PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION.

Contents

About This Manual

Using the NI-488.2 Documentation...............................................................................

xi

Accessing the NI-488.2 Online Help...............................................................

xii

Conventions ...................................................................................................................

xii

Related Documentation..................................................................................................

xiii

Chapter 1

Introduction

Setting Up and Configuring Your System.....................................................................

1-1

Controlling More Than One Interface.............................................................

1-2

Configuration Requirements ...........................................................................

1-2

Chapter 2

Measurement & Automation Explorer (Windows)

Overview........................................................................................................................

2-1

Starting Measurement & Automation Explorer.............................................................

2-2

Troubleshoot NI-488.2 Problems ..................................................................................

2-3

Add a New GPIB Interface............................................................................................

2-4

Remove a GPIB Interface ..............................................................................................

2-4

Scan for GPIB Instruments ............................................................................................

2-5

Instruments Not Found ....................................................................................

2-5

Too Many Listeners on the GPIB....................................................................

2-5

Communicate with Your Instrument .............................................................................

2-6

Basic Communication (Query/Write/Read) ....................................................

2-6

Advanced Communication ..............................................................................

2-8

View NI-488.2 Software Version ..................................................................................

2-8

Monitor, Record, and Display NI-488.2 Calls...............................................................

2-9

View or Change GPIB Interface Settings ......................................................................

2-10

View GPIB Instrumentation Information ......................................................................

2-12

Change GPIB Device Templates ...................................................................................

2-12

Enable/Disable NI-488.2 DOS Support.........................................................................

2-13

Access Additional Help and Resources .........................................................................

2-13

NI-488.2 Online Help......................................................................................

2-13

National Instruments GPIB Web Site..............................................................

2-13

View or Change GPIB-ENET/100 Network Settings....................................................

2-14

Device Configuration ......................................................................................

2-14

Update GPIB-ENET/100 Firmware ................................................................

2-14

© National Instruments Corporation

v

NI-488.2 User Manual

Contents

Chapter 3

GPIB Explorer (Mac OS X and Linux)

Starting GPIB Explorer .................................................................................................

3-2

Mac OS X........................................................................................................

3-2

Linux ...............................................................................................................

3-3

Add a New GPIB Interface............................................................................................

3-4

Delete a GPIB Interface.................................................................................................

3-5

View NI-488.2 Software Version..................................................................................

3-5

View or Change GPIB Interface Settings......................................................................

3-6

Access Additional Help and Resources.........................................................................

3-8

NI-488.2 Online Help .....................................................................................

3-8

National Instruments GPIB Web Site .............................................................

3-8

View or Change GPIB-ENET/100 Network Settings ...................................................

3-8

Device Configuration......................................................................................

3-9

Update GPIB-ENET/100 Firmware................................................................

3-9

Chapter 4

Developing Your NI-488.2 Application

Interactive Instrument Control ......................................................................................

4-1

Choosing Your Programming Methodology .................................................................

4-2

Choosing a Method to Access the NI-488.2 Driver........................................

4-2

Choosing How to Use the NI-488.2 API ........................................................

4-3

Communicating with a Single GPIB Device....................................

4-3

Using Multiple Interfaces and/or Multiple Devices .........................

4-4

Checking Status with Global Variables.........................................................................

4-4

Status Word (ibsta)..........................................................................................

4-5

Error Variable (iberr) ......................................................................................

4-6

Count Variables (ibcnt and ibcntl) ..................................................................

4-6

Using Interactive Control to Communicate with Devices.............................................

4-7

Programming Models ....................................................................................................

4-7

Applications That Communicate with a Single GPIB Device........................

4-7

Items to Include ................................................................................

4-7

General Program Steps and Examples..............................................

4-8

Applications That Use Multiple Interfaces or Communicate

 

with Multiple GPIB Devices........................................................................

4-9

Items to Include ................................................................................

4-9

General Program Steps and Examples..............................................

4-9

Language-Specific Programming Instructions for Windows ........................................

4-11

Microsoft Visual C/C++ (Version 2.0 or Later) .............................................

4-11

Borland C/C++ (Version 4.0 or Later)............................................................

4-12

Visual Basic (Version 4.0 or Later) ................................................................

4-12

NI-488.2 User Manual

vi

ni.com

 

Contents

Direct Entry with C .........................................................................................

4-12

gpib-32.dll Exports............................................................................

4-12

Directly Accessing the gpib-32.dll Exports ......................................

4-13

Language-Specific Programming Instructions for Mac OS X.......................................

4-16

Language-Specific Programming Instructions for Linux ..............................................

4-16

Chapter 5

 

Debugging Your Application

 

NI Spy ............................................................................................................................

5-1

Global Status Variables .................................................................................................

5-1

NI-488.2 Error Codes ....................................................................................................

5-1

Configuration Errors ......................................................................................................

5-2

Timing Errors.................................................................................................................

5-2

Communication Errors...................................................................................................

5-3

Repeat Addressing...........................................................................................

5-3

Termination Method........................................................................................

5-3

Other Errors ...................................................................................................................

5-3

Chapter 6

 

NI Spy Utility

 

Overview........................................................................................................................

6-1

Starting NI Spy ..............................................................................................................

6-1

Windows..........................................................................................................

6-1

Mac OS X and Linux.......................................................................................

6-1

Monitoring API Calls with NI Spy ................................................................................

6-2

Using the NI Spy Online Help .......................................................................................

6-2

Locating Errors with NI Spy..........................................................................................

6-2

Debugging Existing Applications..................................................................................

6-3

Viewing Properties for Recorded Calls .........................................................................

6-3

Exiting NI Spy ...............................................................................................................

6-3

Performance Considerations ..........................................................................................

6-3

Chapter 7

 

Interactive Control Utility

 

Overview........................................................................................................................

7-1

Getting Started with Interactive Control........................................................................

7-1

Interactive Control Syntax .............................................................................................

7-4

Number Syntax................................................................................................

7-4

String Syntax ...................................................................................................

7-5

Address Syntax................................................................................................

7-5

Interactive Control Commands......................................................................................

7-5

© National Instruments Corporation

vii

NI-488.2 User Manual

Contents

Status Word ...................................................................................................................

7-11

Error Information...........................................................................................................

7-11

Count Information .........................................................................................................

7-12

Chapter 8

NI-488.2 Programming Techniques

Termination of Data Transfers ......................................................................................

8-1

High-Speed Data Transfers (HS488).............................................................................

8-2

Enabling HS488 ..............................................................................................

8-2

System Configuration Effects on HS488 ........................................................

8-3

Waiting for GPIB Conditions........................................................................................

8-4

Asynchronous Event Notification in NI-488.2 Applications ........................................

8-4

Calling the ibnotify Function ..........................................................................

8-4

ibnotify Programming Example......................................................................

8-6

Writing Multithreaded NI-488.2 Applications ..............................................................

8-9

Device-Level Calls and Bus Management ....................................................................

8-11

Talker/Listener Applications .........................................................................................

8-12

Serial Polling .................................................................................................................

8-12

Service Requests from IEEE 488 Devices......................................................

8-13

Service Requests from IEEE 488.2 Devices...................................................

8-13

Automatic Serial Polling.................................................................................

8-13

Stuck SRQ State ...............................................................................

8-14

Autopolling and Interrupts................................................................

8-14

SRQ and Serial Polling with Device-Level Traditional NI-488.2 Calls.........

8-15

SRQ and Serial Polling with Multi-Device NI-488.2 Calls............................

8-15

Example 1: Using FindRQS .............................................................

8-16

Example 2: Using AllSpoll...............................................................

8-17

Parallel Polling ..............................................................................................................

8-17

Implementing a Parallel Poll...........................................................................

8-17

Parallel Polling with Traditional NI-488.2 Calls..............................

8-18

Parallel Polling with Multi-Device NI-488.2 Calls ..........................

8-20

Appendix A

GPIB Basics

Appendix B

Status Word Conditions

Appendix C

Error Codes and Solutions

NI-488.2 User Manual

viii

ni.com

Contents

Appendix D

Common Questions

Appendix E

Technical Support and Professional Services

Glossary

Index

© National Instruments Corporation

ix

NI-488.2 User Manual

About This Manual

This manual describes the features and functions of the NI-488.2 software.

You can use the NI-488.2 software with Windows 2000/XP/Vista,

Mac OS X, and Linux.

Using the NI-488.2 Documentation

The following NI-488.2 documentation is available with your NI-488.2 software distribution CD:

The Getting Started/Installation Guide briefly describes how to install the NI-488.2 software and your GPIB hardware.

This manual describes the features and functionality of the NI-488.2 software.

The GPIB Hardware Guide contains detailed instructions on how to install and configure your GPIB hardware. This guide also includes hardware specifications and compliance information.

To view these documents, you need Adobe Acrobat Reader, which you can download from www.adobe.com.

Windows

To view these documents online, insert your NI-488.2 software distribution CD and select the View Documentation option. The View Documentation utility helps you find the documentation that you want to view. You can also view these documents at ni.com.

Mac OS X

To view these documents online, insert your NI-488.2 software distribution CD and open the Documentation folder. You can also view these documents at ni.com.

Linux

To view these documents online, insert your NI-488.2 software distribution CD and browse to the Documentation directory. You can also view these documents at ni.com.

© National Instruments Corporation

xi

NI-488.2 User Manual

About This Manual

Accessing the NI-488.2 Online Help

 

The NI-488.2 Help addresses questions you might have about NI-488.2

 

and includes a function reference and troubleshooting information.

 

Windows

 

Select Start»Programs»National Instruments»Measurement &

 

Automation. Select Help»Help Topics»NI-488.2.

 

Mac OS X

 

Select Applications»National Instruments»NI-488.2»

 

Explore GPIB. Select Help»Help Topics»NI-488.2.

 

Linux

 

Run GPIB Explorer by entering the following command:

 

<InstallDir>/natinst/ni4882/bin/gpibexplorer

 

<InstallDir> is the directory where you chose to install the NI-488.2

 

software. The default is /usr/local.

 

Select Help»Help Topics»NI-488.2.

Conventions

 

 

 

 

The following conventions appear in this manual:

»

The » symbol leads you through nested menu items and dialog box options

 

to a final action. The sequence File»Page Setup»Options directs you to

 

pull down the File menu, select the Page Setup item, and select Options

 

from the last dialog box.

 

This icon denotes a note, which alerts you to important information.

bold

Bold text denotes items that you must select or click in the software, such

 

as menu items and dialog box options. Bold text also denotes parameter

 

names.

IEEE 488 and

IEEE 488 and IEEE 488.2 refer to the ANSI/IEEE Standard 488.1-2003

IEEE 488.2

and the ANSI/IEEE Standard 488.2-1992, respectively, which define the

 

GPIB.

italic

Italic text denotes variables, emphasis, a cross-reference, or an introduction

 

to a key concept. Italic text also denotes text that is a placeholder for a word

 

or value that you must supply.

NI-488.2 User Manual

xii

ni.com

 

About This Manual

monospace

Text in this font denotes text or characters that you should enter from the

 

keyboard, sections of code, programming examples, and syntax examples.

 

This font is also used for the proper names of disk drives, paths, directories,

 

programs, subprograms, subroutines, device names, functions, operations,

 

variables, filenames, and extensions.

monospace bold

Bold text in this font denotes the messages and responses that the computer

 

automatically prints to the screen. This font also emphasizes lines of code

 

that are different from the other examples.

monospace italic

Italic text in this font denotes text that is a placeholder for a word or value

 

that you must supply.

Platform

Text in this font denotes a specific platform and indicates that the text

 

following it applies only to that platform.

Related Documentation

The following documents contain information that you may find helpful as you read this manual:

ANSI/IEEE Standard 488.1-2003, IEEE Standard Digital Interface for Programmable Instrumentation

ANSI/IEEE Standard 488.2-1992, IEEE Standard Codes, Formats, Protocols, and Common Commands

© National Instruments Corporation

xiii

NI-488.2 User Manual

1

Introduction

This chapter describes how to set up your GPIB system.

Setting Up and Configuring Your System

Devices are usually connected with a cable assembly consisting of a shielded 24-conductor cable with both a plug and receptacle connector at each end. With this design, you can link devices in a linear configuration, a star configuration, or a combination of the two configurations. Figure 1-1 shows the linear and star configurations.

Device A

 

 

Device B

Device A

Device D

 

 

Device C

Device B

Device C

 

 

a. Linear Configuration

 

b. Star Configuration

Figure 1-1. Linear and Star System Configuration

© National Instruments Corporation

1-1

NI-488.2 User Manual

Chapter 1

Introduction

Controlling More Than One Interface

Figure 1-2 shows an example of a multi-interface system configuration. gpib0 is a PCI-GPIB and is the access interface for the voltmeter. gpib1 is a GPIB-ENET/100 and is the access interface for the plotter and printer.

One

 

 

 

 

GPIB

Digital

 

 

 

 

 

 

 

 

Voltometer

 

 

 

 

gpib0

 

 

 

Plotter

 

 

 

Another

 

 

 

 

GPIB

 

LINK

GPIB-ENET/100

PWR/RDY

10/100 TX RX

TALK LISTEN

 

 

ENET

GPIB

0

 

 

I

 

 

gpib1

 

 

Printer

 

 

 

Figure 1-2. Example of Multiboard System Configuration

Configuration Requirements

To achieve the high data transfer rate that the GPIB was designed for, you must limit the number of devices on the bus and the physical distance between devices. The following restrictions are typical:

A maximum separation of 4 m between any two devices and an average separation of 2 m over the entire bus.

A maximum total cable length of 20 m.

A maximum of 15 devices or controllers connected to each bus, with at least two-thirds powered on.

NI-488.2 User Manual

1-2

ni.com

Chapter 1

Introduction

For high-speed (HS488) operation, the following restrictions apply:

All devices in the system must be powered on.

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.

If you want to exceed these limitations, you can use a bus extender to increase the cable length or a bus expander to increase the number of device loads. You can order bus extenders and expanders from National Instruments.

© National Instruments Corporation

1-3

NI-488.2 User Manual

2

Measurement & Automation Explorer (Windows)

This chapter describes Measurement & Automation Explorer,

an interactive utility you can use with the NI-488.2 software for Windows.

Mac OS X and Linux

NI-488.2 for Mac OS X and NI-488.2 for Linux have a similar program called GPIB Explorer. For more information, refer to Chapter 3, GPIB Explorer (Mac OS X and Linux).

Overview

You can perform the following GPIB-related tasks in Measurement &

Automation Explorer:

Establish basic communication with your GPIB instruments.

Scan for instruments connected to your GPIB interface.

Launch the NI-488.2 Troubleshooting Utility 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 GPIB interface settings.

Locate additional help resources for GPIB and NI-488.2.

© National Instruments Corporation

2-1

NI-488.2 User Manual

National Instruments NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

Starting Measurement & Automation Explorer

To start Measurement & Automation Explorer, select Start»Programs»

National Instruments»Measurement & Automation. Figure 2-1 shows

Measurement & Automation Explorer.

Note When starting Measurement & Automation Explorer in Windows Vista, you must choose to run as Adminstrator to allow changes to GPIB Interface Settings. To do this, right-click on the Measurement & Automation Explorer icon and select Run as Administrator.

Figure 2-1. Measurement & Automation Explorer

NI-488.2 User Manual

2-2

ni.com

Chapter 2 Measurement & Automation Explorer (Windows)

Troubleshoot NI-488.2 Problems

To troubleshoot NI-488.2 problems, run the NI-488.2 Troubleshooting

Utility, as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Select Help»Troubleshooting»NI-488.2 Troubleshooting Utility.

The Troubleshooting Utility tests your GPIB interface and displays the results, as shown in Figure 2-2.

Figure 2-2. NI-488.2 Troubleshooting Utility

© National Instruments Corporation

2-3

NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

Add a New GPIB Interface

For plug-and-play interfaces (such as PCI or USB), the system automatically detects and installs the hardware.

To add a new GPIB-ENET/100 to your system, complete the following steps:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Right-click on the Devices and Interfaces folder and select

Create New.

3.In the Create New dialog window, select the GPIB-ENET/100 item and click Finish.

The Add GPIB-ENET/100 Wizard appears.

4.Follow the prompts in the Add GPIB-ENET/100 Wizard to add your interface.

5.Measurement & Automation Explorer automatically updates the list of installed GPIB interfaces. You also can select View»Refresh to update the list.

Remove a GPIB Interface

To remove a Plug and Play interface from your computer, disconnect it, making sure to turn off the computer if the interface requires it.

To remove a GPIB-ENET/100 interface from your computer, you must manually delete it from within Measurement & Automation Explorer by completing the following steps:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand Devices and Interfaces by clicking the + next to the folder.

3.Right-click on your GPIB-ENET/100 interface and select Delete from the context menu.

4.When prompted, confirm your selection.

5.Select View»Refresh to update the list of interfaces in Measurement & Automation Explorer.

NI-488.2 User Manual

2-4

ni.com

Chapter 2 Measurement & Automation Explorer (Windows)

Scan for GPIB Instruments

To scan for instruments connected to your GPIB interface or to add a new instrument to your system, complete the following steps:

1.Make sure that your instrument is powered on and connected to your GPIB interface.

2.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

3.Expand the Devices and Interfaces directory by clicking the + next to the folder.

4.Right-click on your GPIB interface and select Scan for Instruments from the drop-down menu that appears.

Measurement & Automation Explorer displays the connected instruments in the right window pane.

Instruments Not Found

If Measurement & Automation Explorer reports that it did not find any instruments, make sure that your GPIB instruments are powered on and properly connected to the GPIB interface with a GPIB cable. Then, scan for instruments again, as described in the Scan for GPIB Instruments section.

Too Many Listeners on the GPIB

If Measurement & Automation Explorer reports that it found too many

Listeners on the GPIB, refer to the following possible solutions:

If you have a running GPIB Analyzer with the GPIB handshake option enabled, disable the GPIB handshake option in the GPIB Analyzer.

If you have a GPIB extender in your system, Measurement & Automation Explorer cannot detect any instruments connected to your GPIB interface. Instead, you can verify communication with your instruments using the Interactive Control utility. To do so, select Tools»NI-488.2»Interactive Control. For more information about verifying instrument communication, type help at the Interactive Control command prompt.

© National Instruments Corporation

2-5

NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

Communicate with Your Instrument

To establish basic or advanced communication with your instruments, refer to the following sections.

For more information about instrument communication and a list of the commands that your instrument understands, refer to the documentation that came with your GPIB instrument. Most instruments respond to the *IDN? command by returning an identification string.

Basic Communication (Query/Write/Read)

To establish basic communication with your instrument, use the NI-488.2

Communicator, as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Select your GPIB interface.

4.If you have not already done so, scan for connected instruments. Right-click on your GPIB interface and select Scan for Instruments from the drop-down menu that appears. Refer to the Scan for GPIB Instruments section for more information.

Measurement & Automation Explorer displays the connected instruments below your GPIB interface.

5.Right-click on your GPIB instrument in the left window pane 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-3.

NI-488.2 User Manual

2-6

ni.com

Chapter 2 Measurement & Automation Explorer (Windows)

Figure 2-3. NI-488.2 Communicator

6.Type a command in the Send String field and do one of the following:

To write a command to the instrument then read a response back, click the Query button.

To write a command to the instrument, click the Write button.

To read a response from the instrument, click the Read button.

To view sample C/C++ code that performs a simple query of a GPIB instrument, click the Show Sample button.

© National Instruments Corporation

2-7

NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

Advanced Communication

For advanced interactive communication with GPIB instruments, use the

Interactive Control utility, as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Right-click on your GPIB interface and select Interactive Control from the drop-down menu that appears. Interactive Control automatically opens a session to the selected GPIB interface.

4.At the command prompt, type NI-488.2 API calls to communicate interactively with the your instrument. For example, you might use ibdev, ibclr, ibwrt, ibrd, and ibonl.

To view the online help for Interactive Control, type help at the Interactive Control command prompt. For more information on using this utility, refer to Chapter 7, Interactive Control Utility.

View NI-488.2 Software Version

To view the NI-488.2 software version, complete the following steps:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Software directory by clicking the + next to the folder.

3.Click NI-488.2.

Measurement & Automation Explorer displays the version number of the NI-488.2 software in the right window pane.

NI-488.2 User Manual

2-8

ni.com

Chapter 2 Measurement & Automation Explorer (Windows)

Monitor, Record, and Display NI-488.2 Calls

To monitor NI-488.2 calls, use NI Spy, as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Select your GPIB interface in the left window pane of Measurement & Automation Explorer.

4.On the toolbar, click the NI Spy button to open the application.

5.On the NI Spy toolbar, click the blue arrow button to start a capture.

6.Start the NI-488.2 application that you want to monitor.

NI Spy records and displays all NI-488.2 calls, as shown in Figure 2-4.

Figure 2-4. NI-488.2 Calls Recorded by NI Spy

For more information about using NI Spy, select Help»Help Topics in NI Spy or refer to Chapter 6, NI Spy Utility.

© National Instruments Corporation

2-9

NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

View or Change GPIB Interface Settings

To view or change your interface settings, complete the following steps:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

Note When starting Measurement & Automation Explorer in Windows Vista, you must choose to run as Adminstrator to allow changes to GPIB Interface Settings. To do this, right-click on the Measurement & Automation Explorer icon and select Run as Administrator.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Select your GPIB interface in the left window pane of Measurement & Automation Explorer.

The interface properties appear in the right window pane of Measurement & Automation Explorer, as shown in Figure 2-5.

NI-488.2 User Manual

2-10

ni.com

Chapter 2 Measurement & Automation Explorer (Windows)

Figure 2-5. GPIB Interface Properties in Measurement & Automation Explorer

4.(Optional) Change the settings for your interface and click Save to apply the settings.

© National Instruments Corporation

2-11

NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

View GPIB Instrumentation Information

To view information about your GPIB instruments, complete the following steps:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Select your GPIB interface.

Measurement & Automation Explorer displays the connected instruments in the right window pane.

4.If you have not already done so, scan for connected instruments. Right-click on your GPIB interface and select Scan for Instruments from the drop-down menu that appears. Refer to the Scan for GPIB Instruments section earlier in this chapter for more information.

5.Double-click on the instrument displayed in the right window pane.

Measurement & Automation Explorer lists all the attributes for the instrument, such as the primary address, the secondary address (if applicable), the instrument’s response to the identification query (*IDN?), and the GPIB interface number to which the device is connected.

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"). Older applications still use ibfind instead of the preferred ibdev to obtain a device handle. In new applications, avoid using ibfind to obtain device handles and use ibdev instead. You can use ibdev to dynamically configure your GPIB device handle. ibdev also eliminates unneccessary device name requirements.

If you must modify a device template, run the GPIB Configuration utility.

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Select Help»Help Topics»NI-488.2 to view the NI-488.2 online help.

3.Search for the topic named How do I change a GPIB Device Template? and click the link to open the GPIB Configuration utility.

4.Double-click the device template you want to modify, such as DEV1.

NI-488.2 User Manual

2-12

ni.com

Chapter 2 Measurement & Automation Explorer (Windows)

5.Rename the template as described in your application documentation.

6.Click the OK button twice to save your changes and exit.

Enable/Disable NI-488.2 DOS Support

Note NI-488.2 DOS support is not available on Windows Vista or later operating systems.

To enable or disable NI-488.2 DOS support, complete the following steps:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Click on your GPIB interface and select Tools»NI-488.2» DOS Support... from the Explorer menu.

3.Enable or disable DOS support in the NI-488.2 Settings dialog box and click OK.

4.If you are prompted to do so, restart your system.

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 Help addresses questions you might have about NI-488.2 and includes a function reference and troubleshooting information. You can access the NI-488.2 online help as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Select Help»Help Topics»NI-488.2.

National Instruments GPIB Web Site

You can access the National Instruments GPIB Web site as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Select Help»National Instruments on the Web»GPIB Home Page.

© National Instruments Corporation

2-13

NI-488.2 User Manual

Chapter 2 Measurement & Automation Explorer (Windows)

View or Change GPIB-ENET/100 Network Settings

To view or change the network settings of your GPIB-ENET/100, refer to the following sections. For more information about your GPIB-ENET/100 network settings, refer to the GPIB-ENET/100 information in the GPIB Hardware Guide.

Device Configuration

Use the NI Ethernet Device Configuration utility if you need to manually configure the network parameters of the GPIB-ENET/100. If your network uses DHCP, the network configuration is performed automatically at startup and you do not need to run this utility unless you want to change the hostname. Consult your network administrator if you do not know whether your network uses DHCP.

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Right-click on your GPIB-ENET/100 interface and select Device Configuration from the drop-down menu that appears.

For more information about the NI Ethernet Device Configuration utility, refer to the GPIB-ENET/100 information in the GPIB Hardware Guide.

Update GPIB-ENET/100 Firmware

You can run the Firmware Update utility in Measurement & Automation

Explorer, as follows:

1.Start Measurement & Automation Explorer as described in the

Starting Measurement & Automation Explorer section.

2.Expand the Devices and Interfaces directory by clicking the + next to the folder.

3.Right-click on your GPIB-ENET/100 interface and select Update Firmware from the drop-down menu that appears.

For more information about the Firmware Update utility, refer to the

GPIB-ENET/100 information in the GPIB Hardware Guide.

NI-488.2 User Manual

2-14

ni.com

3

GPIB Explorer (Mac OS X and Linux)

This chapter describes GPIB Explorer, an interactive utility you can use with the NI-488.2 software for Mac OS X and Linux.

You can perform the following GPIB-related tasks in GPIB Explorer:

Add or remove GPIB interfaces.

Reconfigure GPIB interface settings.

Launch the NI-488.2 Troubleshooting Wizard to troubleshoot GPIB and NI-488.2 problems.

Launch NI Spy to monitor NI-488.2 calls to GPIB interfaces.

Locate additional help resources for GPIB and NI-488.2.

© National Instruments Corporation

3-1

NI-488.2 User Manual

Chapter 3 GPIB Explorer (Mac OS X and Linux)

Starting GPIB Explorer

Mac OS X

To start GPIB Explorer from the Finder, double-click on Applications»

National Instruments»NI-488.2»Explore GPIB.

Figure 3-1 shows GPIB Explorer in Mac OS X.

Figure 3-1. GPIB Explorer (Mac OS X)

NI-488.2 User Manual

3-2

ni.com

Loading...
+ 104 hidden pages