NI-488.2TMNI-488.2 User ManualNI-488.2 User ManualJanuary 2007370428F-01
About This ManualNI-488.2 User Manual xii ni.comAccessing the NI-488.2 Online HelpThe NI-488.2 Help addresses questions you might have about NI-488.2
Appendix B Status Word ConditionsNI-488.2 User Manual B-4 ni.comREM (brd)REM indicates whether the interface is in the remote state. REM is set whenev
Appendix B Status Word Conditions© National Instruments Corporation B-5 NI-488.2 User ManualLACS (brd)LACS indicates whether the GPIB interface is add
© National Instruments Corporation C-1 NI-488.2 User ManualCError Codes and SolutionsThis appendix lists a description of each error, some conditions
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-2 ni.comEDVR (0)EDVR is returned when the interface or device name passed to ibfind, or the
Appendix C Error Codes and Solutions© National Instruments Corporation C-3 NI-488.2 User ManualLinuxEnter the following command:<InstallDir>/nat
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-4 ni.comENOL (2)ENOL usually occurs when a write operation is attempted with no Listeners a
Appendix C Error Codes and Solutions© National Instruments Corporation C-5 NI-488.2 User ManualEARG (4)EARG results when an invalid argument is passed
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-6 ni.comSolutionsPossible solutions for this error are as follows:• Use the correct byte co
Appendix C Error Codes and Solutions© National Instruments Corporation C-7 NI-488.2 User ManualEOIP (10)EOIP occurs when an asynchronous I/O operation
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-8 ni.comEFSO (12)EFSO results when an ibrdf or ibwrtf call encounters a problem performing
About This Manual© National Instruments Corporation xiii NI-488.2 User Manualmonospace Text in this font denotes text or characters that you should en
Appendix C Error Codes and Solutions© National Instruments Corporation C-9 NI-488.2 User ManualESRQ (16)ESRQ can only be returned by a device-level ib
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-10 ni.comELCK (21)ELCK indicates that the requested operation could not be performed becaus
Appendix C Error Codes and Solutions© National Instruments Corporation C-11 NI-488.2 User Manual•A boardID outside the range of 0–99 is passed in to a
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-12 ni.comSolutionsDo not call ibonl with ibwait calls still pending in the driver.Prevent o
© National Instruments Corporation D-1 NI-488.2 User ManualDCommon QuestionsThis appendix answers some common questions about the NI-488.2 software.Ge
Appendix D Common QuestionsNI-488.2 User Manual D-2 ni.comHow do I check for errors in my NI-488.2 application?Examine the value of ibsta after each N
Appendix D Common Questions© National Instruments Corporation D-3 NI-488.2 User ManualWindowsHow can I determine which version of the NI-488.2 softwar
© National Instruments Corporation E-1 NI-488.2 User ManualETechnical Support and Professional ServicesVisit the following sections of the National In
© National Instruments Corporation G-1 NI-488.2 User ManualGlossarySymbol Prefix Valuennano10–9m milli 10–3Mmega106Aacceptor handshake Listeners use t
GlossaryNI-488.2 User Manual G-2 ni.comCCFE Configuration Enable—The GPIB command which precedes CFGn and is used to place devices into their configur
© National Instruments Corporation 1-1 NI-488.2 User Manual1IntroductionThis chapter describes how to set up your GPIB system.Setting Up and Configuri
Glossary© National Instruments Corporation G-3 NI-488.2 User ManualEOS or EOS Byte A 7- or 8-bit end-of-string character that is sent as the last byte
GlossaryNI-488.2 User Manual G-4 ni.comhex Hexadecimal—A number represented in base 16. For example, decimal 16 is hex 10.high-level function See devi
Glossary© National Instruments Corporation G-5 NI-488.2 User ManualLLAD Listen Address. See also MLA.language interface Code that enables an applicati
GlossaryNI-488.2 User Manual G-6 ni.comNNDAC Not Data Accepted—One of the three GPIB handshake lines. See also handshake.NRFD Not Ready For Data—One
Glossary© National Instruments Corporation G-7 NI-488.2 User ManualSs Seconds.SDC Selected Device Clear—The GPIB command used to reset internal or de
GlossaryNI-488.2 User Manual G-8 ni.comTTAD Talk Address. See also MTA.Talker A GPIB device that sends data messages to Listeners.TCT Take Control—The
© National Instruments Corporation I-1 NI-488.2 User ManualIndexSymbols! (repeat previous function) function, Interactive Control utility, 7-10$ filen
IndexNI-488.2 User Manual I-2 ni.comusing Measurement & Automation Explorer, 2-6using NI-488.2 Communicator, 2-6communication errorsrepeat address
Index© National Instruments Corporation I-3 NI-488.2 User ManualELCK error code, C-10END status word condition, 4-5, B-1, B-2ENEB error code, C-6ENOL
IndexNI-488.2 User Manual I-4 ni.comGglobal variablescount variables (ibcnt and ibcntl), 4-6debugging applications, 5-1error variable (iberr), 4-6stat
Chapter 1 IntroductionNI-488.2 User Manual 1-2 ni.comControlling More Than One InterfaceFigure 1-2 shows an example of a multi-interface system config
Index© National Instruments Corporation I-5 NI-488.2 User ManualIibask function, 8-3ibclr functionclearing a device, 4-8using in Interactive Control u
IndexNI-488.2 User Manual I-6 ni.comKKnowledgeBase, E-1LLACS status word condition, 4-5, B-1, B-5language interfaces, 4-2LinuxGPIB Explorer, 3-1progra
Index© National Instruments Corporation I-7 NI-488.2 User Manualstarting, 6-1viewing properties for recorded calls, 6-3NI support and services, E-1NI-
IndexNI-488.2 User Manual I-8 ni.comRReadStatusByte routine, 8-15Receive function, 4-11recording calls in NI Spy, 6-3related documentation, xiiiREM st
Index© National Instruments Corporation I-9 NI-488.2 User ManualThreadIbcnt function, 8-10ThreadIbcntl function, 8-10ThreadIberr function, 8-10ThreadI
Chapter 1 Introduction© National Instruments Corporation 1-3 NI-488.2 User ManualFor high-speed (HS488) operation, the following restrictions apply:•
© National Instruments Corporation 2-1 NI-488.2 User Manual2Measurement & Automation Explorer (Windows)This chapter describes Measurement & Au
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-2 ni.comStarting Measurement & Automation ExplorerTo start Measure
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-3 NI-488.2 User ManualTroubleshoot NI-488.2 ProblemsTo t
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-4 ni.comAdd a New GPIB InterfaceFor plug-and-play interfaces (such as
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-5 NI-488.2 User ManualScan for GPIB InstrumentsTo scan f
SupportWorldwide Technical Support and Product Informationni.comNational Instruments Corporate Headquarters11500 North Mopac Expressway Austin, Texas
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-6 ni.comCommunicate with Your InstrumentTo establish basic or advanced
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-7 NI-488.2 User ManualFigure 2-3. NI-488.2 Communicator
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-8 ni.comAdvanced CommunicationFor advanced interactive communication w
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-9 NI-488.2 User ManualMonitor, Record, and Display NI-48
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-10 ni.comView or Change GPIB Interface SettingsTo view or change your
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-11 NI-488.2 User ManualFigure 2-5. GPIB Interface Prope
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-12 ni.comView GPIB Instrumentation InformationTo view information abou
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-13 NI-488.2 User Manual5. Rename the template as describ
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-14 ni.comView or Change GPIB-ENET/100 Network SettingsTo view or chang
© National Instruments Corporation 3-1 NI-488.2 User Manual3GPIB Explorer (Mac OS X and Linux)This chapter describes GPIB Explorer, an interactive uti
Important InformationWarrantyThe media on which you receive National Instruments software are warranted not to fail to execute programming instructio
Chapter 3 GPIB Explorer (Mac OS X and Linux)NI-488.2 User Manual 3-2 ni.comStarting GPIB ExplorerMac OS XTo start GPIB Explorer from the Finder, doubl
Chapter 3 GPIB Explorer (Mac OS X and Linux)© National Instruments Corporation 3-3 NI-488.2 User ManualLinuxTo start GPIB Explorer, enter the followin
Chapter 3 GPIB Explorer (Mac OS X and Linux)NI-488.2 User Manual 3-4 ni.comAdd a New GPIB InterfaceTo add a new GPIB interface to your system, complet
Chapter 3 GPIB Explorer (Mac OS X and Linux)© National Instruments Corporation 3-5 NI-488.2 User ManualDelete a GPIB InterfaceTo remove a GPIB interfa
Chapter 3 GPIB Explorer (Mac OS X and Linux)NI-488.2 User Manual 3-6 ni.comView or Change GPIB Interface SettingsTo view or change your interface sett
Chapter 3 GPIB Explorer (Mac OS X and Linux)© National Instruments Corporation 3-7 NI-488.2 User ManualLinuxFigure 3-4 shows the Properties dialog box
Chapter 3 GPIB Explorer (Mac OS X and Linux)NI-488.2 User Manual 3-8 ni.comAccess Additional Help and ResourcesTo access additional help and resources
Chapter 3 GPIB Explorer (Mac OS X and Linux)© National Instruments Corporation 3-9 NI-488.2 User ManualDevice ConfigurationMac OS XTo run the NI Ether
© National Instruments Corporation 4-1 NI-488.2 User Manual4Developing Your NI-488.2 ApplicationThis chapter describes how to develop an NI-488.2 appl
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-2 ni.comLinux1. To launch the Interactive Control utility, enter the following co
© National Instruments Corporation v NI-488.2 User ManualContentsAbout This ManualUsing the NI-488.2 Documentation...
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-3 NI-488.2 User ManualLinuxNI-488.2 has libgpibapi.so—a dynamic lib
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-4 ni.comThe set of low-level functions are called board-level functions. They acc
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-5 NI-488.2 User ManualStatus Word (ibsta)All NI-488.2 calls update
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-6 ni.comThe language header file defines each of the ibsta status bits. You can t
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-7 NI-488.2 User ManualIf you are reading data, the count variables
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-8 ni.comGeneral Program Steps and ExamplesThe following steps show you how to use
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-9 NI-488.2 User ManualStep 3a.Use ibwrt to send the "*IDN?&quo
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-10 ni.comInitializationStep 1. Become Controller-In-Charge (CIC)Use SendIFC to in
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-11 NI-488.2 User ManualDevice CommunicationStep 4. Communicate with
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-12 ni.comBorland C/C++ (Version 4.0 or Later)Before you compile your Win32 C appl
ContentsNI-488.2 User Manual vi ni.comChapter 3GPIB Explorer (Mac OS X and Linux)Starting GPIB Explorer ...
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-13 NI-488.2 User Manualto get a pointer to the exported function, y
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-14 ni.comIn your Win32 application, you need to load gpib-32.dll before accessing
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-15 NI-488.2 User Manuallong *Pibcntl;static int(__stdcall *Pibdev)(
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-16 ni.comBefore exiting your application, you need to free gpib-32.dll with the f
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-17 NI-488.2 User Manualyour application starts, compile and link yo
© National Instruments Corporation 5-1 NI-488.2 User Manual5Debugging Your ApplicationThis chapter describes several ways to debug your application.NI
Chapter 5 Debugging Your ApplicationNI-488.2 User Manual 5-2 ni.comConfiguration ErrorsSeveral applications require customized configuration of the NI
Chapter 5 Debugging Your Application© National Instruments Corporation 5-3 NI-488.2 User ManualCommunication ErrorsThe following sections describe com
© National Instruments Corporation 6-1 NI-488.2 User Manual6NI Spy UtilityThis chapter introduces you to NI Spy, a utility that monitors and records m
Chapter 6 NI Spy UtilityNI-488.2 User Manual 6-2 ni.comMonitoring API Calls with NI SpyTo display NI-488.2 API calls as they are made, do the followin
Contents© National Instruments Corporation vii NI-488.2 User ManualDirect Entry with C ...
Chapter 6 NI Spy Utility© National Instruments Corporation 6-3 NI-488.2 User ManualDebugging Existing ApplicationsIf the application does not have bui
© National Instruments Corporation 7-1 NI-488.2 User Manual7Interactive Control UtilityThis chapter introduces you to the Interactive Control utility,
Chapter 7 Interactive Control UtilityNI-488.2 User Manual 7-2 ni.comTo start the Interactive Control utility, complete the following steps:Windows1. S
Chapter 7 Interactive Control Utility© National Instruments Corporation 7-3 NI-488.2 User ManualNote If you type a command and no parameters, Interact
Chapter 7 Interactive Control UtilityNI-488.2 User Manual 7-4 ni.comOr, equivalently:ud0: ibrd 29[0100] (cmpl)count: 2946 4C 55 4B 45 2C 20 34 FLUKE,
Chapter 7 Interactive Control Utility© National Instruments Corporation 7-5 NI-488.2 User ManualDecimal numbers—Enter the number only. For example, ib
Chapter 7 Interactive Control UtilityNI-488.2 User Manual 7-6 ni.comTable 7-1. Syntax for Device-Level Traditional NI-488.2 Calls in Interactive Cont
Chapter 7 Interactive Control Utility© National Instruments Corporation 7-7 NI-488.2 User Manualibwait mask Wait for selected event where mask is a he
Chapter 7 Interactive Control UtilityNI-488.2 User Manual 7-8 ni.comibnotify mask Start an asynchronous wait for selected events where mask is a hex o
Chapter 7 Interactive Control Utility© National Instruments Corporation 7-9 NI-488.2 User ManualTable 7-3. Syntax for Multi-Device NI-488.2 Calls in
ContentsNI-488.2 User Manual viii ni.comStatus Word ...
Chapter 7 Interactive Control UtilityNI-488.2 User Manual 7-10 ni.comTestSys addrlist Cause multiple devices to perform self-tests.Trigger address Tri
Chapter 7 Interactive Control Utility© National Instruments Corporation 7-11 NI-488.2 User ManualStatus WordIn the Interactive Control utility, all NI
Chapter 7 Interactive Control UtilityNI-488.2 User Manual 7-12 ni.comCount InformationWhen an I/O function completes, the Interactive Control utility
© National Instruments Corporation 8-1 NI-488.2 User Manual8NI-488.2 Programming TechniquesThis chapter describes techniques for using some NI-488.2 c
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-2 ni.com• EOS read method—If this is enabled, ibrd, ibrda, and ibrdf calls are termina
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-3 NI-488.2 User ManualIf you are using device-level calls, the NI-488.2
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-4 ni.comWaiting for GPIB ConditionsYou can use the ibwait function to obtain the curre
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-5 NI-488.2 User ManualBoth board-level and device-level ibnotify calls a
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-6 ni.comibnotify Programming ExampleThe following code is an example of how you can us
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-7 NI-488.2 User Manual 0); // EOS mode disabledif (ud < 0) {printf (
Contents© National Instruments Corporation ix NI-488.2 User ManualAppendix DCommon QuestionsAppendix ETechnical Support and Professional ServicesGloss
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-8 ni.com// If the ERR bit is set in LocalIbsta, then print an error// message and retu
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-9 NI-488.2 User Manual// Convert the data into a numeric value.sscanf (R
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-10 ni.comAssume that a process has two separate threads that make NI-488.2 calls, thre
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-11 NI-488.2 User ManualA quick way to convert your application to use pe
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-12 ni.comTalker/Listener ApplicationsAlthough designed for Controller-In-Charge applic
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-13 NI-488.2 User ManualService Requests from IEEE 488 DevicesIEEE 488 de
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-14 ni.com4. The polling continues until SRQ is unasserted or an error condition is det
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-15 NI-488.2 User ManualSRQ and Serial Polling with Device-Level Traditio
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-16 ni.com• FindRQS serial polls a list of devices until it finds a device that is requ
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-17 NI-488.2 User ManualExample 2: Using AllSpollThis example shows you h
© National Instruments Corporation xi NI-488.2 User ManualAbout This ManualThis manual describes the features and functions of the NI-488.2 software.
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-18 ni.comParallel Polling with Traditional NI-488.2 CallsComplete the following steps
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-19 NI-488.2 User ManualIn the following example, the GPIB interface is t
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-20 ni.com2. Conduct the parallel poll using PPoll, store the response, and check the r
© National Instruments Corporation A-1 NI-488.2 User ManualAGPIB BasicsThe ANSI/IEEE Standard 488.1-2003, also known as the General Purpose Interface
Appendix A GPIB BasicsNI-488.2 User Manual A-2 ni.comGPIB AddressingAll GPIB devices and interfaces must be assigned a unique GPIB address. A GPIB add
Appendix A GPIB Basics© National Instruments Corporation A-3 NI-488.2 User ManualData LinesEight data lines, DIO1 through DIO8, carry both data and co
Appendix A GPIB BasicsNI-488.2 User Manual A-4 ni.comSRQ (service request)Any device can drive the SRQ line to asynchronously request service from the
© National Instruments Corporation B-1 NI-488.2 User ManualBStatus Word ConditionsThis appendix gives a detailed description of the conditions reporte
Appendix B Status Word ConditionsNI-488.2 User Manual B-2 ni.comERR (dev, brd)ERR is set in the status word following any call that results in an erro
Appendix B Status Word Conditions© National Instruments Corporation B-3 NI-488.2 User ManualSRQI (brd)SRQI indicates that a GPIB device is requesting
Comments to this Manuals