NI-488.2TMNI-488.2 User ManualNI-488.2 User ManualAugust 2008370428G-01
About This ManualNI-488.2 User Manual xii ni.comAccessing the NI-488.2 HelpThe NI-488.2 Help addresses questions you might have about NI-488.2 and inc
© 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
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 Manual• Use the unit descriptor returned from ibdev or ibfind
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-4 ni.comSolutionsPossible solutions for this error are as follows:• Make sure that the GPIB
Appendix C Error Codes and Solutions© National Instruments Corporation C-5 NI-488.2 User Manual• ibppc called with invalid parallel poll configuration
About This Manual© National Instruments Corporation xiii NI-488.2 User Manualitalic Italic text denotes variables, emphasis, a cross-reference, or an
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-6 ni.comENEB (7)ENEB occurs when a GPIB interface is configured for use by the system, but
Appendix C Error Codes and Solutions© National Instruments Corporation C-7 NI-488.2 User ManualSolutionsResynchronize the driver and the application b
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-8 ni.com• Make sure that the access mode of the file is correct.• Make sure there is enough
Appendix C Error Codes and Solutions© National Instruments Corporation C-9 NI-488.2 User ManualSolutionsCheck to see if other devices not used by your
Appendix C Error Codes and SolutionsNI-488.2 User Manual C-10 ni.comSolutionsEnsure that the value being returned by your Callback function is a valid
Appendix C Error Codes and Solutions© National Instruments Corporation C-11 NI-488.2 User ManualERST (27)ERST results when an event notification was c
© 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 award-winni
© National Instruments Corporation 1-1 NI-488.2 User Manual1IntroductionThis chapter describes how to set up your GPIB system.Setting Up and Configuri
Appendix E Technical Support and Professional ServicesNI-488.2 User Manual E-2 ni.comIf you searched ni.com and could not find the answers you need, c
© 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
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 ManualIberrA global function that contains the specific error code associated with a func
GlossaryNI-488.2 User Manual G-6 ni.comMLA My Listen Address—A GPIB command used to address a device to be a Listener. It can be any one of the 31 pr
Glossary© National Instruments Corporation G-7 NI-488.2 User ManualPPU Parallel Poll Unconfigure—The GPIB command used to disable any device from part
GlossaryNI-488.2 User Manual G-8 ni.comstatus byte The IEEE 488.2-defined data byte sent by a device when it is serially polled.status word See Ibsta.
© National Instruments Corporation I-1 NI-488.2 User ManualIndexSymbols! (repeat previous function) function, Interactive Control utility, 7-10$ filen
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
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 ManualEOI (end or identify) line (table), A-4EOIP error code, C-6EOSEOS comparison method, 8
IndexNI-488.2 User Manual I-4 ni.comlinear and star system configuration (figure), 1-1requirements, 1-2interface management lines, A-3overview, A-1sen
Index© National Instruments Corporation I-5 NI-488.2 User ManualIberr() or iberrdetermining error type, 4-8ibnotifyasynchronous event notification, 8-
IndexNI-488.2 User Manual I-6 ni.comaccessing additional help and resources, 2-13accessing online help, 2-13adding new GPIB interface, 2-4changing GPI
Index© National Instruments Corporation I-7 NI-488.2 User ManualNI-488.2 callsexamples in Interactive Control utility, 7-2Interactive Control utility
IndexNI-488.2 User Manual I-8 ni.comSendIFC function, 4-12SendList function, 4-13serial pollingautomatic serial polling, 8-13autopolling and interrupt
Index© National Instruments Corporation I-9 NI-488.2 User ManualWwaiting for GPIB conditions (ibwait), 8-4WaitSRQ routine, 8-16Web resources, E-1
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 ManualThe NI-488.2 Communicator dialog b
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-8 ni.comTo view the online help for Interactive Control, type help at
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-9 NI-488.2 User Manual6. Start the NI-488.2 application
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-10 ni.com3. Select your GPIB interface in the left window pane of Meas
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-11 NI-488.2 User ManualTo toggle between the different m
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-12 ni.comChange GPIB Device TemplatesFor older NI-488.2 applications,
Chapter 2 Measurement & Automation Explorer (Windows)© National Instruments Corporation 2-13 NI-488.2 User ManualAccess Additional Help and Resour
Chapter 2 Measurement & Automation Explorer (Windows)NI-488.2 User Manual 2-14 ni.com3. Right-click on your GPIB-ENET/100 interface and select Dev
© 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 Manual(Linux) Figure 3-4 shows the Properties dialog
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 ManualFor more information about direct entry acces
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-4 ni.comModifying existing applications to use the NI4882 API should require mini
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-5 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-6 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-7 NI-488.2 User Manualif the sizes of ibcnt and ibcntl are the same
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-8 ni.comThe language header file defines each Ibsta status bit. You can test for
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-9 NI-488.2 User ManualCount Function (Ibcnt)The count function is u
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-10 ni.comthen your application invokes it as follows:if (Ibsta() & ERR) {gpib
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-11 NI-488.2 User ManualDevice CommunicationStep 3. Communicate with
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-12 ni.comthen your application invokes it as follows:if (Ibsta() & ERR) {gpib
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 Manualis 0x01; otherwise, if the primary address i
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-14 ni.comLanguage-Specific Programming Instructions for WindowsThe following sect
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-15 NI-488.2 User ManualTo compile and link a Win32 console applicat
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-16 ni.comgpib-32.dll. Thus, to use direct entry to access a particular function a
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-17 NI-488.2 User ManualIn your Win32 application, you need to load
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-18 ni.comlong *Pibcntl;static int(__stdcall *Pibdev)(int ud, int pad, int sad, in
Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-19 NI-488.2 User ManualBefore exiting your application, you need to
Chapter 4 Developing Your NI-488.2 ApplicationNI-488.2 User Manual 4-20 ni.comyour application starts, compile and link your application as shown in t
© 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
Contents© National Instruments Corporation vii NI-488.2 User ManualLanguage-Specific Programming Instructions for Windows ...
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
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:(Windows)1.
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
ContentsNI-488.2 User Manual viii ni.comChapter 7Interactive Control UtilityOverview ...
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
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.comenabled, in which case the EOI line is asserted with the last byte of the writ
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
Contents© National Instruments Corporation ix NI-488.2 User ManualAppendix AGPIB BasicsAppendix BStatus Word ConditionsAppendix CError Codes and Solut
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 1, // EOT mode turned on 0); // EOS mode disabled
Chapter 8 NI-488.2 Programming TechniquesNI-488.2 User Manual 8-8 ni.comchar ReadBuffer[40];// If the ERR bit is set in LocalIbsta, then print an erro
Chapter 8 NI-488.2 Programming Techniques© National Instruments Corporation 8-9 NI-488.2 User Manual// illustrates that.ReadBuffer[ThreadIbcnt()] = ‘\
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 ManualNote If you are using ibnotify in your applicatio
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
© 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 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
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
Comments to this Manuals