background image

© Copyright 1993, 1995 National Instruments Corporation.

All Rights Reserved.

NI-488.2M

Software Reference Manual

for OS/2

January 1995 Edition

Part Number 370950A-01

Summary of Contents for NI-488.2M

Page 1: ... Copyright 1993 1995 National Instruments Corporation All Rights Reserved NI 488 2M Software Reference Manual for OS 2 January 1995 Edition Part Number 370950A 01 ...

Page 2: ...tria 0662 435986 Belgium 02 757 00 20 Canada Ontario 519 622 9310 Canada Québec 514 694 8521 Denmark 45 76 26 00 Finland 90 527 2321 France 1 48 14 24 24 Germany 089 741 31 30 Italy 02 48301892 Japan 03 3788 1921 Mexico 95 800 010 0793 Netherlands 03480 33466 Norway 32 84 84 00 Singapore 2265886 Spain 91 640 0085 Sweden 08 730 49 70 Switzerland 056 20 51 51 Taiwan 02 377 1200 U K 0635 523545 ...

Page 3: ...ent 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 DISC...

Page 4: ...cts National Instruments products are not designed with components and testing intended to ensure a level of reliability suitable for use in treatment and diagnosis of humans Applications of National Instruments products involving medical or clinical treatment can create a potential for accidental injury caused by product failure or by errors on the part of the user or application designer Any use...

Page 5: ...E 488 Standard and GPIB 1 5 Talkers Listeners and Controllers 1 5 Controller In Charge and System Controller 1 6 Sending Messages Across the GPIB 1 6 Data Lines 1 6 Handshake Lines 1 6 Interface Management Lines 1 7 Setting Up and Configuring Your System 1 7 Controlling More Than One Board 1 9 Chapter 2 Application Examples 2 1 Example 1 Basic Communication 2 2 Example 2 Clearing and Triggering De...

Page 6: ...e with Devices 3 7 Writing Your NI 488 Application 3 7 Items to Include 3 7 NI 488 Program Shell 3 8 General Program Steps and Examples 3 9 Writing Your NI 488 2 Application 3 13 Items to Include 3 13 NI 488 2 Program Shell 3 14 General Program Steps and Examples 3 15 Compiling and Linking Your Program 3 20 32 Bit C Applications 3 20 16 Bit C Applications 3 21 Running Your Application Program 3 21...

Page 7: ...ibdev 5 13 ibwrt 5 16 ibrd 5 17 Auxiliary Functions 5 18 Set Select Device or Board 5 19 Help Display Help Information 5 20 Repeat Previous Function 5 21 Turn OFF Display and Turn ON Display 5 21 n Repeat Function n Times 5 22 Execute Indirect File 5 23 Print Display the ASCII String 5 24 ibic Examples 5 24 NI 488 2 Routines Example 5 24 NI 488 Device Functions Example 5 28 NI 488 Board Functions ...

Page 8: ...ter 7 ibconf Interface Bus Configuration Utility 7 1 Overview 7 1 Starting ibconf 7 1 Levels of ibconf 7 2 Input Selection Level 7 2 Map Level 7 4 Device Map of the Boards 7 5 Help 7 5 Rename 7 5 Dis connect 7 6 Edit 7 6 Exit 7 6 Description Level 7 7 Change Characteristics 7 8 Next Board Device 7 8 Help 7 8 Reset Value 7 8 Return to Map 7 8 Output Selection Level 7 9 Board and Device Configuratio...

Page 9: ...Poll Duration 7 13 Use This GPIB Interface 7 14 Base I O Address 7 14 DMA Channel 7 14 Interrupt Jumper Setting 7 15 DMA Transfer Mode 7 15 Serial Poll Timeout 7 15 Enable Repeat Addressing 7 15 Default Configurations in ibconf 7 16 Exiting ibconf 7 17 Appendix A Status Word Conditions A 1 Appendix B Error Codes and Solutions B 1 Appendix C Customer Communication C 1 Glossary G 1 Index I 1 ...

Page 10: ...re 2 8 Program Flowchart for Example 8 2 20 Figure 2 9 Program Flowchart for Example 9 2 22 Figure 3 1 General Program Shell Using NI 488 Device Functions 3 8 Figure 3 2 General Program Shell Using NI 488 2 Routines 3 14 Figure 7 1 Input Selection Level of ibconf 7 2 Figure 7 2 Map Level of ibconf 7 4 Figure 7 3 Description Level of ibconf 7 7 Figure 7 4 Output Selection Level of ibconf 7 9 Tables...

Page 11: ... the programmer s task a program flowchart and numbered steps that correspond to the numbered blocks on the flowchart Chapter 3 Developing Your Application explains how to develop a GPIB application program using NI 488 functions and NI 488 2 routines Chapter 4 Debugging Your Application describes several ways to debug your application program Chapter 5 ibic Interface Bus Interactive Control Utili...

Page 12: ...es The Index contains an alphabetical list of key terms and topics in this manual and it includes the page where you can find each term and topic Conventions Used in This Manual The following conventions are used in this manual italic Italic text denotes emphasis cross references field names or an introduction to a key concept bold italic Bold italic text denotes a note caution or warning monospac...

Page 13: ...you should simultaneously press the named keys for example Control C enter Enter is reserved to mean that the commands immediately succeeding the word must be typed into the computer and then executed by pressing the Return key on the keyboard IEEE 488 and IEEE 488 and IEEE 488 2 refer to the IEEE 488 2 ANSI IEEE Standard 488 1 1987 and the ANSI IEEE Standard 488 2 1987 respectively which define t...

Page 14: ... Users Function and Routine Descriptions Use the getting started manual to install and configure your GPIB hardware and NI 488 2M software for OS 2 Use the software reference manual if you want to learn the basics of GPIB and how to develop an application program The software reference manual also contains debugging information and detailed examples Use the function reference manual for specific i...

Page 15: ...rogramming Guide Volume III ANSI IEEE Standard 488 1 1987 IEEE Standard Digital Interface for Programmable Instrumentation ANSI IEEE Standard 488 2 1987 IEEE Standard Codes Formats Protocols and Common Commands Customer Communication National Instruments wants to receive your comments on our products and manuals We are interested in the applications you develop with our products and we want to hel...

Page 16: ...new features Before you use the software read this file for the most recent information install cmd is an OS 2 command file that performs the software installation It does not modify your config sys file gpib sys is the software driver file that is loaded at system startup by OS 2 gpib ddp is a device driver profile This file is used by the OS 2 command ddinstal to control the installation process...

Page 17: ...t library for the 32 bit Borland C language interface that you must link with your Borland C applications ni488_16 lib is an import library for the 16 bit Microsoft C language interface that you must link with your Microsoft C applications decl h is a 32 bit include file It contains NI 488 functions and NI 488 2 routine prototypes and various predefined constants decl_16 h is a 16 bit include file...

Page 18: ...I subdirectory readme api is a documentation file that contains information about the OS 2 API functions nicode h is a C language declaration file that contains definitions of NI 488 2M function codes and other NI 488 2M related constant and structure definitions nictl_32 h is a C language declaration file that contains a macro definition You can use this definition in place of the DosDevIOCtl def...

Page 19: ...ows two ways you can access the NI 488 2M driver You can use either the NI 488 2 language interface or the OS 2 API Application Program Interface calls Both methods access the NI 488 2M driver through the OS 2 system The driver then accesses your GPIB hardware OS 2 System NI 488 2M Driver GPIB Hardware Interface OR User Application Program IBIC utility for using NI 488 2 commands interactively NI ...

Page 20: ...ard 488 2 1987 Codes Formats Protocols and Common Commands defines a bus communication protocol a common set of data codes and formats and a generic set of common device commands The GPIB General Purpose Interface Bus is a digital 8 bit parallel communications interface with data transfer rates of 1 Mbytes s and above The bus supports one System Controller usually a computer and up to 14 additiona...

Page 21: ...oss the GPIB interface which consists of 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 Handshake Lines Three hardware handshake lines asynchronously control the transfer of message bytes between devices This process is a three wire interlocked hand...

Page 22: ...C REN remote enable System Controller drives the REN line to place devices in remote or local program mode SRQ service request Any device can drive the SRQ line to asynchronously request service from the Controller EOI end or identify Talker uses the EOI line to mark the end of a data message Controller uses the EOI line when it conducts a parallel poll Setting Up and Configuring Your System Devic...

Page 23: ...scription Chapter 1 NI 488 2M SRM for OS 2 1 8 National Instruments Corp Device B Device C Device A Linear Configuration Device D Device C Device B Device A Star Configuration Figure 1 2 Linear and Star System Configuration ...

Page 24: ...l more than one interface board Figure 1 3 shows an example of a multiboard system configuration Printer Plotter Digital Voltmeter gpib0 gpib1 One GPIB Another GPIB Figure 1 3 Example of Multiboard System Setup gpib0 is the access board for the voltmeter and gpib1 is the access board for the plotter and printer The control functions of the devices automatically access their respective boards ...

Page 25: ...c is the source code file for Example 2 It illustrates how you can clear and trigger GPIB devices asynch c is the source code file for Example 3 It illustrates how you can perform non GPIB tasks while data is being transferred over the GPIB eos c is the source code file for Example 4 It illustrates the concept of the end of string EOS character rqs c is the source code file for Example 5 It illust...

Page 26: ...ultimeter to take measurements and record each measurement as it occurs To do this he has written an application that uses some simple high level GPIB commands The following steps correspond to the program flowchart in Figure 2 1 1 The application initializes the GPIB by bringing the interface board in the computer online 2 The application sends the multimeter an instruction setting it up to take ...

Page 27: ... Computer Multimeter INIT Read Measurement from Multimeter Finished Getting Measurements CLEAN UP Yes No ibwrt ibrd VOLTS Tell Multimeter to Take Measurement 5 volts 1 2 3 5 Set Up Multimeter to Take Voltages ibwrt VOLTS DC AUTO 4 GPIB Cable Figure 2 1 Program Flowchart for Example 1 ...

Page 28: ...lloscope This command clears the internal registers of the oscilloscope reinitializing it to default values and settings 3 The application sends a command to the oscilloscope telling it to read a waveform each time it is triggered Predefining the task in this way decreases the execution time required Each trigger of the oscilloscope is now sufficient to get a new run 4 The application sends a GPIB...

Page 29: ...scope to Get Reading Finished Reading CLEAN UP Yes No ibclr ibtrg Clear Command Request Data from Oscilloscope CURV Clear Oscilloscope ibwrt Define Task to Be Done When Oscilloscope is Triggered Trigger Command 1 2 3 4 5 6 Read Data from Oscilloscope Display Waveform Data 7 8 WAV TRIG ibwrt ibrd Figure 2 2 Program Flowchart for Example 2 ...

Page 30: ... acquires and prints images with the aid of an application program she wrote using high level GPIB commands The following steps correspond to the program flowchart in Figure 2 3 1 The application initializes the GPIB by bringing the interface board in the computer online 2 An image is scanned in 3 The application sends the GPIB printer a command to print the new image and immediately returns witho...

Page 31: ...2 Computer INIT Print Image Asynchronously CLEAN UP Non GPIB Activity Save to Disk Color Printer Print Image Image Scan Non GPIB Activity Compute Statistics More Images Yes No Yes No ibwrta 1 2 3 4 5 6 GPIB Cable Is GPIB Printing Done ibwait Figure 2 3 Program Flowchart for Example 3 ...

Page 32: ...d In this case the scanner expects the commands to be terminated with CR LF carriage return r and linefeed n The application sets its end of string EOS byte to LF The linefeed code indicates to the scanner that there is no more data coming and is called the end of string byte It flags an end of string condition for this particular GPIB scanner The same effect could be accomplished by asserting the...

Page 33: ... OS 2 Read Status Computer Scanner INIT Set EOS Mode CLEAN UP ibclr ibeos Change Scan Resolution Reset Internal State RES 3 r n ibwrt Read Data ibwrt ibrd Start Scan OK scan r n Scanned Data ibrd 1 2 3 4 5 6 7 8 Clear Command GPIB Cable Figure 2 4 Program Flowchart for Example 4 ...

Page 34: ... board in the computer online 2 The application brings the film recorder to a ready state by issuing a device clear instruction The film recorder is now set up for operation using its default values The graphic arts designer has previously established that the default values for the film recorder are appropriate for the type of film she is using 3 The application advances the new roll of film into...

Page 35: ...cation issues a command to the film recorder to advance the film by one frame The advance occurs successfully unless the end of film is reached 8 The application waits for RQS which completes when the film recorder asserts the SRQ line to signal it is done advancing the film 9 As soon as the application s wait for RQS completes the application serial polls the film recorder to see whether it reque...

Page 36: ...or the Film Recorder to Request Service Finished Loading Film ibclr ibwait FRM Read Response from the Film Recorder Response Advance Film Clear Film Recorder Clear Command ibrsp 1 2 4 3 5 No ibwrt Yes Exit Application and Repair Film Recorder Request Service Did You Request Service Yes continues Figure 2 5 Program Flowchart for Example 5 ...

Page 37: ...corder to Request Service Advance Film Read Response From Film Recorder 6 6a 6b 6c 7 8 9 10 Yes ibwait These steps are repeated 3 times once for each color pass ibwrt ibwait Reached End of Film No Computer Digital Film Recorder ibrsp ibwrt Data for Red Green or Blue Pass Request Service Did You Request Service Yes Response ADV Request Service Did You Request Service Yes Response Figure 2 5 Program...

Page 38: ...ith these tensile testers he needs to determine what GPIB addresses they have been set to He can do so with the aid of a simple application he has written The following steps correspond to the program flowchart in Figure 2 6 1 The application initializes the GPIB by bringing the interface board in the computer online 2 The application issues a command to detect the presence of listening devices on...

Page 39: ... Who s Listening Get a List of Devices Present on GPIB Device 1 is Here Device 2 is Here Device 3 is Here MUTT 10426 MUTT 10528 1 2 3 4 5 MUTT 10383 GPIB Cable GPIB Cable GPIB Cable Receive Receive Read Response from Device 2 Read Response from Device 3 Tell Device 2 to Identify Itself Tell Device 3 to Identify Itself Send Send IDN IDN Read Response from Device 1 3 4 3 4 Figure 2 6 Program Flowcha...

Page 40: ...lowing steps correspond to the program flowchart in Figure 2 7 1 The application initializes the GPIB by bringing the interface board in the computer online 2 The application configures the strain gauges to request service when they have a significant pressure reading or a mechanical failure occurs They signal their request for service by asserting the SRQ line 3 The application waits for one or m...

Page 41: ...Wait for 1 or More Strain Gauges to Request Service 3 No Did You Request Service Did You Request Service Yes Serial Poll Each Strain Gauge Until One Requesting Service is Located 4 Response Get a Reading From Strain Gauge 5 No Yes Provide Whatever Service is Required Does the Gauge Need Service 6 Mixture is Ready Display Remove Mixture Message SRQ HI Configure Strain Gauges to Request Service When...

Page 42: ...NI 488 2 routines The application obtains information from the multiple units by conducting a parallel poll then determines when to pour the metals into the mixture tank The following steps correspond to the program flowchart in Figure 2 8 1 The application initializes the GPIB by bringing the interface board in the computer online 2 The application configures the temperature transducer in the fir...

Page 43: ...ndicates that all three metals are at the appropriate temperature the application sends a command to each of the three power supplies directing them to power on Then the motors start and the metals pour into the mold If only one or two of the metals is at the appropriate temperature Steps 5 and 6 are repeated until the metals can be successfully mixed 8 The application unconfigures all the transdu...

Page 44: ...onfig PPollConfig PPoll Unconfigure 8 PPoll MIX ON SendList PPollUnconfig Power Supply Configure Transducer 2 for Parallel Polls Configure Transducer 1 for Parallel Polls UNIT 1 GPIB Cable GPIB Cable GPIB Cable GPIB Cable GPIB Cable GPIB Cable Are All Metals Ready Yes Temp Transducer Power Supply UNIT 2 Temp Transducer Power Supply UNIT 3 Parallel Poll Enable Yes Yes Parallel Poll Enable Parallel ...

Page 45: ...ollowing steps correspond to the program flowchart in Figure 2 9 1 The application brings the device online 2 The application waits for any of three events to occur the device becomes listen addressed becomes talk addressed or receives a GPIB clear message 3 As soon as one of the events occurs the application takes an action based upon the event that occurred If the device was cleared the applicat...

Page 46: ...e Controller INIT Wait to be Talk Addressed Listen Addressed or Cleared Write Out New Data No ibwait fffffffffff Is This the Clear Event Is This the Talk Addressed Event Reset Internal State Yes Yes Data No Read In New Data Data ibwrt ibrd 1 2 3 3 3 Figure 2 9 Program Flowchart for Example 9 ...

Page 47: ... You also should use them if you are already using other National Instruments GPIB products because the same format and syntax work regardless of the GPIB hardware product You can make NI 488 or NI 488 2 calls in the ibic interactive program or from your application program When using the NI 488 2 interface your OS 2 application runs with both the AT GPIB driver for OS 2 and MC GPIB driver for OS ...

Page 48: ...while maintaining control over the CPU for non GPIB tasks NI 488 functions include built in file transfer functions ibrdf and ibwrtf The NI 488 function ibconfig dynamically changes the GPIB driver configuration without the need to run the ibconf utility With NI 488 functions you can control the bus in non typical ways or communicate with noncompliant devices The NI 488 functions consist of high l...

Page 49: ...rd level functions are compatible with and can be interspersed within sequences of NI 488 2 routines When you use board level functions within a sequence of NI 488 2 routines you do not need a prior call to ibfind You simply substitute the board index as the first parameter of the board level function call With this flexibility you can handle non standard or unusual situations that you cannot reso...

Page 50: ...88 function and NI 488 2 routine updates the global variables to reflect the status of the device or board that you are using The status word ibsta the error variable iberr and the count variables ibcnt and ibcntl contain useful information about the performance of your application program Your program should check these variables frequently The following sections describe each of these global var...

Page 51: ...dev brd I O completed LOK 7 80 brd Lockout State REM 6 40 brd Remote State CIC 5 20 brd Controller In Charge ATN 4 10 brd Attention is asserted TACS 3 8 brd Talker LACS 2 4 brd Listener DTAS 1 2 brd Device Trigger State DCAS 0 1 brd Device Clear State The language header files included on your distribution disk contain the mnemonic constants for ibsta You can check a bit position in ibsta by using...

Page 52: ...d write or command function ibcnt is a 16 bit integer and ibcntl is a 32 bit integer If you are reading data the count variables indicate the number of bytes read If you are sending data or commands the count variables reflect the number of bytes sent In your application program you can use the count variables to null terminate an ASCII string of data received from an instrument For example if dat...

Page 53: ...ty After you have learned how to communicate with your devices in ibic you are ready to begin writing your application program Writing Your NI 488 Application This section discusses items you should include in your application program general program steps and examples Items to Include Include the GPIB header file This file contains prototypes for the NI 488 functions and constants that you can us...

Page 54: ...evel calls No Yes No No Closed All Boards Devices Yes START or Open Board Device by Specifying Name ibfind Open Device without Knowing Device Name ibdev Are All Boards Devices Open Make a Device Level Call Send Data to Device Receive Data from Device Clear Device Serial Poll Device and so on ibwrt ibrd ibclr ibrsp Finished GPIB Programming Close Board or Device ibonl END Yes Figure 3 1 General Pro...

Page 55: ...t NI 488 function call should be to ibfind or ibdev to open a device ud ibdev 0 1 0 12 1 0 if ibsta ERR gpiberr ibdev error The input arguments of the ibdev function are as follows 0 Board index for gpib0 1 Primary GPIB address of the device 0 No secondary GPIB address for the device 12 I O timeout value 3 s 1 Send END message with the last byte when writing to the device 0 Disable EOS detection m...

Page 56: ... your instrument ibwrt ud RST VAC AUTO TRIGGER 2 SRE 16 35L if ibsta ERR gpiberr ibwrt error The programming instruction in this example resets the multimeter RST The meter is instructed to measure the volts alternating current VAC using autoranging AUTO to wait for a trigger from the GPIB interface board before starting a measurement TRIGGER 2 and to assert the SRQ line when the measurement compl...

Page 57: ...at the ibwait function also returns when the I O timeout value is exceeded printf Waiting for RQS n if ibwait ud TIMO RQS ERR TIMO gpiberr ibwait error When SRQ has been detected serial poll the instrument to determine whether the measured data is valid or whether a fault condition exists For IEEE 488 2 instruments you can find out by checking the message available MAV bit which is bit 4 in the st...

Page 58: ...oating point number it represents ibrd ud rdbuf 10L if ibsta ERR gpiberr ibrd error rdbuf ibcntl 0 printf Read s n rdbuf Output Read 10 98E 3 sum AsciiToFloat rdbuf Step 7 Process the Data Repeat Steps 4 through 6 in a loop until 10 measurements have been read then print the average of the readings as shown printf The average of the 10 readings is f n sum 10 0 Step 8 Place the Device Offline As a ...

Page 59: ... the NI 488 2 routines and constants that you can use in your application program Include the declaration file appropriate for your compiler as follows include decl h 32 bit C compiler include decl_16 h 16 bit C compiler Check for errors after each NI 488 2 routine Declare and define a function to handle GPIB errors This function takes the board offline and closes the application If the function i...

Page 60: ...ice Receive Clear Device DevClear Serial Poll Device ReadStatusByte and so on Address Devices to Listen SendSetup Send Data to Addressed Listener SendDataBytes Address Device to Talk ReceiveSetup Receive Data from Addressed Talker RcvRespMsg and so on Low Level High Level Yes Close Board ibonl Are All Boards Closed Finished GPIB Programming Making High Level or Low Level Call Initialize Specified ...

Page 61: ... 2 Find All Listeners Create an array of all the instruments attached to the GPIB Use the FindLstn routine The first argument is the interface board number the second argument is the list of instruments that was created the third argument is a list of instrument addresses that the procedure actually found and the last argument is the maximum number of devices that the procedure may find that is it...

Page 62: ...n skip the first entry in the result array for loop 1 loop num_Listeners loop Send 0 result loop IDN 5L NLend if ibsta ERR gpiberr Send error Receive 0 result loop buffer 10L STOPend if ibsta ERR gpiberr Receive error buffer ibcntl 0 printf The instrument at address d is a s n result loop buffer if strncmp buffer Fluke 45 9 0 fluke result loop printf Found the Fluke n break if loop num_Listeners p...

Page 63: ...ice specific commands The first argument is the number of the access board The second argument is the GPIB address of the multimeter The third argument is a string of bytes to send to the multimeter The bytes in this example instruct the meter to measure volts alternating current VAC using autoranging AUTO to wait for a trigger from the Controller before starting a measurement TRIGGER 2 and to ass...

Page 64: ... displays it on its front panel then asserts SRQ You can detect the assertion of SRQ by using either the TestSRQ or WaitSRQ routine If you have a process that you want to execute while you are waiting for the measurement use TestSRQ For this example you can use the WaitSRQ routine The first argument in WaitSRQ is the GPIB board number The second argument is a flag returned by WaitSRQ This flag ind...

Page 65: ...the second argument is the GPIB address of the multimeter The third argument is a string into which the Receive function places the data bytes from the multimeter The fourth argument represents the number of bytes to be received The last argument indicates that the Receive message terminates upon receiving a byte accompanied with the END message Receive 0 fluke buffer 10L STOPend if ibsta ERR gpib...

Page 66: ...88 lib nibor lib or ni488_16 lib is included in the SET LIB configuration command in the config sys file For example if the import library is in a directory d at gpib c the SET LIB configuration command may appear as follows SET LIB d toolkt20 os2lib d cset2 lib d at gpib c 32 Bit C Applications Before you compile your application program make sure that the following line is included at the beginn...

Page 67: ...6 bit program by using the following command cl c cprog c then enter the following command to link your compiled program with the NI 488 2 16 bit C language interface link NOI cprog obj ni488_16 lib Running Your Application Program After you have compiled and linked your application program you can begin using it Make sure that the full pathname of the DLL that you are using ni488 dll nibor lib or...

Page 68: ...o correct this situation make certain that the line device y at gpib gpib sys where y refers to the letter of the drive where the NI 488 2M software is installed is in your config sys file then reboot The Use this GPIB Interface field in ibconf might be set to no for board GPIBx If you want to use this board you must set this field to yes Before you run your application program you should run the ...

Page 69: ...t the driver expects No board present for GPIBx Check that the board is properly installed in your computer and run ibconf to make certain that the driver is configured to use the same base I O address as the board Incorrect Interrupt Level The ibtest program outputs dots then hangs if the AT GPIB board under test is installed but configured to use an incorrect interrupt level Run ibconf to config...

Page 70: ...r application does not automatically check for and display errors you can locate an error by using ibic Simply issue the same functions or routines one at a time as they appear in your application program Because ibic returns the status values and error codes after each call you should be able to determine which GPIB call is failing For more information about ibic refer to Chapter 5 ibic Interface...

Page 71: ...lity for operation EFSO 12 File system error EBUS 14 GPIB bus error ESTB 15 Serial poll status byte queue overflow ESRQ 16 SRQ stuck in ON position ETAB 20 Table problem Configuration Errors If your hardware and software settings do not match one of the following problems might occur Application hangs on input or output functions Data is corrupted If these problems occur make sure that the GPIB ha...

Page 72: ...ill always work regardless of the previous driver configuration For more information refer to the description of ibconfig in the NI 488 2M Function Reference Manual for OS 2 Timing Errors If your application fails but the same calls issued in ibic are successful your program might be issuing the NI 488 2 calls too quickly for your device to process and respond to them This problem can also result ...

Page 73: ...ly addressed state Refer to Chapter 7 ibconf Interface Bus Configuration Utility or to the description of ibconfig in the NI 488 2M Function Reference Manual for OS 2 for more information about reconfiguring your software Termination Method You should be aware of the termination method that your device uses By default your NI 488 2M software is configured to send EOI on writes and terminate reads ...

Page 74: ...nstructions refer to the manual that came with your instrument You can use ibic to practice communication with the instrument troubleshoot problems and develop your application program One way ibic helps you to learn about your instrument and to troubleshoot problems is by displaying the following information on your computer screen whenever you enter a command The results of the status word ibsta...

Page 75: ...993 National Instruments Corp Version 2 0 Version Date Apr 30 1993 Version Time 09 42 25 All Rights Reserved Press help for help or q to quit ibic Exiting ibic Typing e or q terminates execution of the ibic program ibic Syntax The syntax of functions in ibic differs from the syntax in a programming language The main difference is that in ibic certain messages ibwrt ibwrta ibrd ibrda ibcmd ibcmda S...

Page 76: ...Return configuration information dev brd 16 ibbna brdname Change access board of device dev 1 ibcac v Become active Controller brd 2 3 ibclr Clear specified device dev ibcmd string Send commands from string brd 4 ibcmda string Send commands asynch from string brd 4 ibconfig mn v Alter configurable parameters dev brd 15 3 ibdev vvvvvv Open an unused device when the device name is unknown dev 9 ibdm...

Page 77: ...ev brd 6 ibrdf flname Read data to file dev brd 7 ibrpp Conduct a parallel poll dev brd ibrsc v Request release system control brd 2 3 ibrsp Return serial poll byte dev ibrsv v Request service dev 3 ibsad v Change secondary address dev brd 3 ibsic Send interface clear brd ibsre v Set clear remote enable line brd 2 3 ibstop Abort asynchronous operation dev brd ibtmo v Change disable time limit dev ...

Page 78: ...ontrol to a device 13 PPoll Parallel poll devices PPollConfig addr line sense Configure device for parallel poll 13 14 PPollUnconfig address Unconfigure device for parallel poll 13 RcvRespMsg address data mode Receive response message 4 12 13 ReadStatusByte address Serial poll a device 13 Receive address data mode Receive data from a device 4 12 13 ReceiveSetup address Receive setup 13 ResetSys li...

Page 79: ...Routine Syntax Description Note SendSetup list Send setup 11 Set 488 2 v Enter into 488 2 mode for board SetRWLS list Put device in remote with lockout state 11 TestSys list Cause multiple devices to perform self tests 11 TestSRQ Test for service request Trigger address Trigger a device 13 TriggerList list Trigger multiple devices 11 WaitSRQ Wait for service request ...

Page 80: ...r followed by the octal value For example octal 40 is represented by 40 A hex byte consists of a backslash character and a character x followed by the hex value For example hex 40 is represented by x40 The two special symbols r for a carriage return character and n for a linefeed character are a more convenient method for inserting the carriage return and linefeed characters into the string as sho...

Page 81: ...address is also required create an integer with the primary address in the low order byte and the secondary address in the high order byte for example pad 3 and sad 0x61 could be expressed as 0x6103 14 line and sense are integers representing the data line to respond on and the sense of the response 15 mn is a mnemonic for a configuration parameter or the equivalent integer value Refer to the desc...

Page 82: ...y used EOS characters the carriage return and the linefeed dev1 0100 cmpl count 8 ibwrt F3R5T1 r n The r and n represent the carriage return and linefeed characters respectively Refer to Appendix A Multiline Interface Messages in the NI 488 2M Function Reference Manual for OS 2 for more information about non printable characters Status Word Return In ibic all NI 488 functions except ibfind and ibd...

Page 83: ... indicating that dev1 is powered off or the GPIB cable is disconnected For a detailed list of the error codes and their meanings refer to Chapter 4 Debugging Your Application Count Return When an I O function completes ibic displays the actual number of bytes sent or received regardless of the existence of an error condition If one of the addresses in an address list of an NI 488 2 routine is inva...

Page 84: ...ing this form of the set command ibic uses the 488 2 prompt to indicate that you are in NI 488 2 mode on board n set 488 2 1 488 2 1 After issuing the set 488 2 command you can use any of the NI 488 2 routines Send The Send routine sends data to a single GPIB device You can use the SendList command to send data to multiple GPIB devices For example suppose you want to send the five character string...

Page 85: ...devices Receive The Receive routine causes the GPIB board to receive data from another GPIB device The following example illustrates the use of the Receive routine 488 2 0 Receive 5 10 STOPend 2124 end cmpl cic lacs count 5 48 65 6c 6c 6f H e l l o The command acquires data from the device at primary address 5 It stops receiving data when 10 characters have been received or when the END message is...

Page 86: ...or board is added to the prompt The unit descriptor of a board or device is returned The following example shows ibfind opening dev1 id 32259 dev1 ibfind dev1 The returned value is the unit descriptor of the board The name used with the ibfind function must be a valid symbolic name known by the driver dev1 is the default name found in the driver For more information about valid names refer to Chap...

Page 87: ...rd for the Device Primary Address Secondary Address Timeout Setting EOT mode EOS mode The following example shows ibdev opening an available device and assigning it to access gpib0 board 0 with a primary address of 6 pad 6 a secondary address of hex 67 sad 0x67 a timeout of 10 ms tmo 7 the END message enabled eot 1 and the EOS mode disabled eos 0 ibdev 0 6 0x67 7 1 0 id 32259 ud0 ...

Page 88: ...board that is not 0 1 2 or 3 or the board has no driver installed The following example illustrates an EDVR error ibdev 4 6 0x67 7 1 0 id 1 8000 err error EDVR 2 ENEB The board index entered refers to a known board such as 0 but the driver cannot find the board In this case run ibconf to verify that the base address of the board is set correctly EARG One of the last five parameters is an illegal v...

Page 89: ... command sends data from one GPIB device to another For example to send the six character data string F3R5T1 from the computer to a device called dev1 you enter the following string at the dev1 prompt dev1 0100 cmpl count 6 ibwrt F3R5T1 The returned status word 0100 indicates a successful I O completion while the byte count indicates that all six characters were sent from the computer and received...

Page 90: ...device The following example illustrates the use of the ibrd function dev1 2100 end cmpl count 18 4e 44 43 56 28 30 30 30 N D C V 0 0 0 2e 30 30 34 37 45 2b 30 0 0 4 7 E 0 0d 0a ibrd 20 This command acquires data from the device and displays it on the screen in hex format and in its ASCII equivalent along with information about the data transfer such as the status word and the byte count ...

Page 91: ...play off Turn display on n function Execute function n times 4 n Execute previous function n times filename Execute indirect file 5 print string Display string on screen 6 buffer option Set the type of display used for buffers 7 e Exit or quit q Exit or quit Notes 1 udname is the symbolic name of the new device or board for example dev1 or gpib0 2 Initially call ibfind to open each device or board...

Page 92: ...for a carriage return character and n for a linefeed character are a more convenient method for inserting the carriage return and linefeed characters into the string as shown in this example F3R5T1 r n Because the carriage return can be represented equally well in hex xD and r are equivalent strings 7 Valid options for buffer are 0 1 2 and 3 which denote off ascii full and brief respectively Set S...

Page 93: ...name You can also use set to switch between NI 488 mode and NI 488 2 mode The argument udname represents any of the symbolic device or board names recognized by the driver The default names are gpib0 gpib1 gpib2 and gpib3 for boards and dev1 through dev32 for devices unless you have changed the device names using ibconf Help Display Help Information The help function displays a menu of topics to c...

Page 94: ...ic gpib0 0130 cmpl cic atn gpib0 cmpl cic atn 0130 Turn OFF Display and Turn ON Display The function causes the bytes received not to be displayed on the screen This function is useful when you want to repeat any I O function quickly without waiting for screen output to be displayed The function causes the display to be restored The following example shows how the and functions are used Twenty fou...

Page 95: ...unt 8 buffer off dev1 dev1 2100 end cmpl count 8 71 72 73 74 75 76 77 78 q r s t u v w x ibrd 8 ibrd 8 ibrd 8 n Repeat Function n Times The n function repeats the execution of the specified function n times where n is an integer In the following example the message Hello is sent to the printer five times printer 5 ibwrt Hello In the following example Hello is first sent 20 more times then 10 more ...

Page 96: ...5 ibwrt Hello Execute Indirect File The function reads a specified file and executes the ibic functions in sequence as if they were entered in that order from the keyboard The following example executes the ibic functions listed in the file usrfile gpib0 usrfile The following example repeats the operation three times gpib0 3 usrfile The display mode in effect before this function was executed is r...

Page 97: ...1 and goodbye print hello print and r n x67 x6f x6f x64 x62 x79 x65 You can also use print to display comments from indirect files The print string appears even if the display is suppressed with the function ibic Examples This section presents examples for using NI 488 2 routines and NI 488 board functions and device functions in ibic NI 488 2 Routines Example This section shows how you might use ...

Page 98: ... 25 NI 488 2M SRM for OS 2 488 2 0 set 488 2 2 Send the interface clear message IFC to all devices IFC clears the bus 488 2 0 0130 cmpl cic atn SendIFC 3 Clear the device The device is assumed to be on the GPIB bus at primary address 2 488 2 0 DevClear 2 0138 cmpl cic atn tacs count 4 ...

Page 99: ...NI 488 2M SRM for OS 2 5 26 National Instruments Corp 4 Write the routine range and trigger source information to a digital voltmeter 488 2 0 Send 2 F3R7T3 DABend 0128 cmpl cic tacs count 6 5 Trigger the device 488 2 0 Trigger 2 0138 cmpl cic atn tacs count 4 ...

Page 100: ... SRQ bus line then read the status byte of the meter 488 2 0 1138 srqi cmpl cic atn tacs SRQ line is asserted 488 2 0 0134 cmpl cic atn lacs Poll 2 0x0040 decimal 64 WaitSRQ ReadStatusByte 2 7 Read the data from the meter Receive 2 20 STOPend 488 2 0 2124 end cmpl cic lacs count 20 0d 0a 4e 44 43 56 2d 30 N D C V 0 30 30 2e 30 30 34 37 45 0 0 0 0 4 7 E 2b 30 0d 0a 0 ...

Page 101: ...mple This section shows how you might use ibic to test a sequence of NI 488 device function calls 1 Find the device name that was given to the device in the ibconf program id 32259 dvm ibfind dvm 2 Clear the device dvm 0100 cmpl ibclr 3 Write the function range and trigger source instructions to the DVM dvm 0100 cmpl count 6 ibwrt F3R7T3 ...

Page 102: ... the device dvm 0100 cmpl ibtrg 5 Wait for a timeout or for DVM to request service If the current timeout limit is too short use ibtmo to change it dvm 0900 rqs cmpl ibwait TIMO RQS 6 Read the serial poll status byte This serial poll status byte varies depending on the device used dvm 0100 cmpl Poll 0x40 decimal 64 ibrsp ...

Page 103: ... 5 30 National Instruments Corp 7 Use the read command to display the data on the screen both in hex values and their ASCII equivalents dvm 0100 cmpl count 18 4e 44 43 56 20 30 30 30 N D C V 0 0 0 2e 30 30 34 37 45 2b 30 0 0 4 7 E 0 0a 0a ibrd 18 8 Terminate the ibic program dvm e ...

Page 104: ...ction shows how you might use ibic to test a sequence of NI 488 board function calls 1 Begin by opening an interface board id 32006 gpib0 ibfind gpib0 2 Send IFC to all devices IFC clears the bus and asserts attention ATN on the bus gpib0 0130 cmpl cic atn ibsic 3 Turn on the remote enable signal REN gpib0 0130 cmpl cic atn previous value 0 ibsre 1 ...

Page 105: ...untalk UNT commands respectively These are sent in ibcmd to reset the bus addressing The character represents the talk address of the GPIB board The character represents the listen address of the device which in this case is at GPIB primary address 1 gpib0 0138 cmpl cic atn tacs count 4 ibcmd _ 5 Write the function range and trigger source instructions to the DVM Be sure an error has not occurred ...

Page 106: ...meout If the current timeout limit is too short use ibtmo to change it gpib0 1138 srqi cmpl cic atn tacs ibwait TIMO SRQI 8 Set up the device for a serial poll The question mark and underscore _ characters represent the unlisten UNL and untalk UNT characters respectively and reset the bus addressing The underscore _ represents the listen address of the Controller The hex value 18 represents the se...

Page 107: ...nt 1 50 P ibrd 1 10 Complete the serial poll by sending the serial poll disable message SPD The hex value 19 represents the serial poll disable function gpib0 0174 cmpl rem cic atn lacs count 1 ibcmd x19 11 Read the measurement The DVM and the computer are still addressed to talk and to listen gpib0 2164 end cmpl rem cic lacs count 20 0d 0a 4e 44 43 56 2d 30 N D C V 0 30 30 2e 30 30 34 37 45 0 0 0...

Page 108: ...Chapter 5 ibic Interface Bus Interactive Control Utility National Instruments Corp 5 35 NI 488 2M SRM for OS 2 12 Terminate the ibic program gpib0 e ...

Page 109: ...n the last byte of a write is sent out on the GPIB If it is disabled the EOI line is not asserted with the last byte of a write You can use the ibeos function to enable disable or configure the EOS modes EOS mode configuration includes the following information A 7 bit or 8 bit EOS byte The EOS comparison method which indicates whether the EOS byte has 7 or 8 significant bits For a 7 bit EOS byte ...

Page 110: ...function to obtain the current ibsta value or to suspend your application until a specified condition occurs on the GPIB If you use ibwait with a parameter of 0 it immediately updates ibsta and returns If you want to use ibwait to wait for one or more events to occur then pass a wait mask to the function The wait mask should always include the TIMO event otherwise your application is suspended ind...

Page 111: ...he GPIB board then you could use a board level ibwait command to wait for CIC Serial Polling You can use serial polling to obtain specific information from GPIB devices when they request service When the GPIB SRQ line is asserted it signals the Controller that a service request is pending The Controller must then determine which device asserted the SRQ line and respond accordingly The most common ...

Page 112: ...e autopolling procedure occurs as follows 1 Use the configuration utility ibconf or the configuration function ibconfig with option IbcAUTOPOLL Autopolling is enabled by default 2 When the SRQ line is asserted the driver automatically serial polls the devices 3 Each positive serial poll response bit 6 or hex 40 is set is stored in a queue associated with the device that sent it If the poll has a p...

Page 113: ...rted a stuck SRQ state is in effect If this happens during an ibwait for RQS the driver reports the ESRQ error If the stuck SRQ state happens no further polls are attempted until either an ibwait for RQS or an ibrsp for the device whose serial poll queue is full is made When either ibwait or ibrsp for the device whose serial poll is full is issued the stuck SRQ state is terminated and a new set of...

Page 114: ...vicing situation when automatic serial polling is enabled include decl h char GetSerialPollResponse int DeviceHandle char SerialPollResponse 0 ibwait DeviceHandle TIMO RQS if ibsta RQS printf Device asserted SRQ n Use ibrsp to retrieve the serial poll response ibrsp DeviceHandle SerialPollResponse return SerialPollResponse SRQ and Serial Polling with NI 488 2 Routines The NI 488 2M software includ...

Page 115: ...e timeout period is exceeded The following examples use NI 488 2 routines to detect SRQ then determine which device requested service In these examples three devices are present on the GPIB at addresses 3 4 and 5 and the GPIB interface is designated as bus index 0 The first example uses FindRQS to determine which device is requesting service and the second example uses AllSpoll to serial poll all ...

Page 116: ...AddrList ibcnt DeviceResponse SerialPollResponse return Example 2 This example illustrates the use of AllSpoll to serial poll three devices void GetAllSerialPollResponses Addr4882_t AddrList short ResponseList int WaitResult WaitSRQ 0 WaitResult if WaitResult printf SRQ is asserted n Use Allspoll to serial poll all the devices at once AllSpoll 0 AddrList ResponseList if ibsta ERR for i 0 AddrList ...

Page 117: ... parallel polls you do not need extensive knowledge of the parallel polling messages However you should use the NI 488 2M functions for parallel polling when the GPIB board is not the Controller and must configure itself for a parallel poll and set its own individual status bit ist Parallel Polling with NI 488 2 Routines Follow these steps to implement parallel polling using NI 488 2 routines Each...

Page 118: ...k the bit in the following statement if response 0x10 printf The ist equals 1 n else printf The ist equals 0 n 3 Unconfigure the device for parallel polling using the PPollUnconfig routine The third step disables parallel polling for device 3 Notice that the NOADDR constant must appear at the end of the array to signal the end of the address list If NOADDR is the only value in the array ALL device...

Page 119: ...tions The device asserts DIO7 if its ist 0 In this example the ibdev command is used to open a generic device that has the desired characteristics The device has a primary address of 3 no secondary address a timeout of 3 s EOS characters disabled and asserts EOI with the last byte of a write operation include decl h char ppr dev ibdev 0 3 0 T3s 1 0 The following call configures the device to respo...

Page 120: ...ue The following example code performs the parallel poll and compares the response to hex 10 which corresponds to DIO5 If that bit is set the ist of the device is 1 ibrpp dev ppr if ppr 0x10 printf ist 1 n 3 Unconfigure the device for parallel polling with ibppc Notice that any value having the parallel poll disable bit set bit 4 in the bit pattern disables the configuration so you can use any val...

Page 121: ...n save the changes to any or all of these files Instead of using ibconf you can configure your driver dynamically by using the ibconfig function to alter any board or device characteristic while your program is running If you use dynamic configuration you do not need to run ibconf before you start your application Also you can run your application on any computer with the appropriate NI 488 2M sof...

Page 122: ...rates at the following four levels Input Selection level determines which configuration file ibconf reads Map level depicts the device connections as defined in the driver Description level consists of screens describing the individual boards and devices that make up the system Output Selection level determines which configuration files are to be updated The four levels are described in detail in ...

Page 123: ...on disk Make sure your distribution disk is write protected Memory resident driver the NI 488 2M driver for OS 2 that is loaded and resident in memory after system startup Changes in the memory resident driver take effect for a given board or device only after all current processes have closed that board or device and a new open is performed Note You cannot change device names board interrupt leve...

Page 124: ...led by the driver It also indicates which devices if any are accessed through each interface board You can move around the map by using the cursor control keys For your convenience cursor control keys and function keys are defined at the bottom of your computer screen The following options are available at the map level Device map of the boards Help Rename Dis connect Edit Exit The following secti...

Page 125: ...vice you want to rename by using the cursor control keys Press F4 then enter the new name of the device You may use up to seven letters to name your device and you may use uppercase or lowercase letters The following restrictions apply when naming a device Extensions xxx are not allowed As specified by OS 2 the device name cannot have the following invalid characters ASCII characters less than hex...

Page 126: ...or device that you want to edit by using the cursor control keys and pressing F8 This places you in the description level of ibconf and lists all the characteristics for the particular board or device that you want to edit To exit edit use F9 or Esc Exit Use F9 or Esc to exit ibconf If you have made changes and have pressed F9 to exit ibconf displays Save configuration Type y yes to save the chang...

Page 127: ...pressing F8 You can use the Up Down PageUp and PageDown cursor keys to select a characteristic For your convenience cursor control keys and function keys are defined at the bottom of your computer screen Selecting the configuration settings for each device and board customizes the communications and other options to be used with that board or device These settings are the characteristics used by t...

Page 128: ... on the right half of the screen inform you about the options for the characteristic Next Board Device If you are viewing the characteristics of a board use Ctrl PageUp and Ctrl PageDown to move to the characteristics screen for the previous or next board If you are viewing the characteristics of a device use Ctrl PageUp and Ctrl PageDown to move to the characteristics screen for the previous or n...

Page 129: ...ted or opened and the new configuration is stored into it If you select yes to copy changes to the memory resident driver ibconf updates the driver that is currently resident in memory If you select yes to copy changes to drivers on disk ibconf updates the driver file on disk Board and Device Configuration Options To view detailed information about each characteristic position the cursor in the fi...

Page 130: ...xample a primary address of hex 10 has a listen address of hex 30 and a talk address of hex 50 Secondary GPIB Address Any device or board using extended addressing must be assigned a secondary address in the range hex 60 to hex 7E 96 to 126 decimal or the option NONE may be selected to disable secondary addressing As with primary addressing the secondary GPIB address of a device is set within that...

Page 131: ...be made with the EOS byte You may state whether all eight bits are to be compared or just the seven least significant bits ASCII or ISO International Standards Organization format The default option for this characteristic is 7 bit Note This field is valid only if a yes response was given for either the Set EOI with EOS on Write field or the Terminate Read on EOS field EOS Byte Some devices can be...

Page 132: ...ontroller Board Characteristic Only This field appears on the board characteristics screen only The System Controller in a GPIB system is the device that maintains ultimate control over the bus In some situations such as a network of computers linked by the GPIB another device may be System Controller and the GPIB board should be designated as not System Controller A no response would designate no...

Page 133: ...eriod the ECIC error is returned If the CIC protocol is disabled ECIC is returned immediately if a device call is made after control has been passed The default option for this characteristic is no Bus Timing Board Characteristic Only This field specifies the T1 delay of the source handshake capability for the board This delay determines the minimum amount of time after the data is placed on the b...

Page 134: ...ame value as the base I O address setting for the GPIB board Setting the base I O address level is explained in the getting started manual that you received with your GPIB interface board Note On Micro Channel systems this field is Read Only and you can change the I O address only by booting the reference diskette DMA Channel Board Characteristic Only This field specifies the DMA channel used by t...

Page 135: ...lt option for this characteristic is Demand Mode DMA Note This characteristic is not applicable to Micro Channel systems Serial Poll Timeout Device Characteristic Only This timeout value controls the length of time the driver waits for a serial poll response from a device The IEEE 488 standard does not specify the length of time a Controller should wait for the response byte The default value of 1...

Page 136: ...aining 16 devices that is devices 17 through 32 are assigned to the access board gpib1 Their GPIB addresses range from 1 through 16 respectively For example dev17 is at address 1 Each GPIB interface board is System Controller for its independent bus and has a GPIB address of 0 The END message is sent with the last byte of each data message to a device No EOS character is recognized The time limit ...

Page 137: ... to delete changes Before exiting if not in expert mode ibconf automatically checks for situations such as the following that can cause problems GPIB addressing conflicts between a device and its access board GPIB boards not present in the host machine at the specified address Timeouts disabled on a device or board Interrupt level of a board is the same as another board If ibconf detects any probl...

Page 138: ...e GPIB board Each bit in ibsta can be set for device calls dev board calls brd or both dev brd The following table lists the status word bits Mnemonic Bit Pos Hex Value Type Description ERR 15 8000 dev brd GPIB error TIMO 14 4000 dev brd Time limit exceeded END 13 2000 dev brd END or EOS detected SRQI 12 1000 brd SRQ interrupt received RQS 11 800 dev Device requesting service CMPL 8 100 dev brd I ...

Page 139: ...the EOS byte has been received if the software is configured to terminate a read on an EOS byte If the GPIB board is performing a shadow handshake as a result of the ibgts function any other function can return a status word with the END bit set if the END condition occurs before or during that call END is cleared when any I O operation is initiated Some applications may need to know the exact I O...

Page 140: ...poll response queue is not empty ibrsp returns the oldest byte stored in the queue To empty the response queue call ibrsp repeatedly until RQS is no longer set in the device s status word CMPL dev brd CMPL indicates the condition of I O operations It is set whenever an I O operation is complete CMPL is cleared while the I O operation is in progress LOK brd LOK indicates whether the board is in a l...

Page 141: ...In Charge CIC is set when the SendIFC routine or ibsic function is executed while the GPIB board is System Controller or when another Controller passes control to the GPIB board CIC is cleared whenever the GPIB board detects Interface Clear IFC from the System Controller or when the GPIB board passes control to another device ATN brd ATN indicates the state of the GPIB Attention ATN line ATN is se...

Page 142: ...ates whether the GPIB board has detected a device trigger command DTAS is set whenever the GPIB board as a Listener detects the Group Execute Trigger GET command has been sent by another Controller DTAS is cleared on any call immediately following an ibwait call if the DTAS bit is set in the ibwait mask parameter DCAS brd DCAS indicates whether the GPIB board has detected a device clear command DC...

Page 143: ...R 0 OS 2 error ECIC 1 Function requires GPIB board to be CIC ENOL 2 No Listeners on the GPIB EADR 3 GPIB board not addressed correctly EARG 4 Invalid argument to function call ESAC 5 GPIB board not System Controller as required EABO 6 I O operation aborted timeout ENEB 7 Nonexistent GPIB board EOIP 10 Asynchronous I O in progress ECAP 11 No capability for operation EFSO 12 File system error EBUS 1...

Page 144: ... is also returned when the driver gpib sys is not installed Solutions 1 Use only device or board names that are configured in the software utility ibconf as parameters in the ibfind function 2 Use the unit descriptor returned from the ibfind function as the first parameter in subsequent NI 488 functions Examine the variable after the ibfind and before the failing function to make sure it was not c...

Page 145: ...red as System Controller 3 In multiple CIC situations always be certain that the CIC bit appears in the status word ibsta before attempting these calls If the CIC bit does not appear you can perform an ibwait for CIC call to delay further processing until control is passed to the board ENOL 2 ENOL usually occurs when a write operation is attempted with no Listeners addressed For a device write thi...

Page 146: ... necessary to match the configured address to the device switch settings 6 Reduce the write byte count to that which is expected by the Controller EADR 3 EADR occurs when the GPIB board is CIC and is not properly addressing itself before read and write functions This error is usually associated with board level functions EADR is also returned by the function ibgts when the shadow handshake feature...

Page 147: ...vel function made with a board descriptor An NI 488 2 routine called with an invalid address PPollConfig called with an invalid data line or sense bit Termination parameter in RcvRespMsg and Receive is neither STOPend or an 8 bit EOS character eotmode parameter in Send SendDataBytes and SendList is not DABend NULLend or NLend In Send SendDataBytes or SendList routine eotmode is DABend and datacnt ...

Page 148: ...ce was expecting Solutions 1 Use the correct byte count in input functions or have the Talker use the END message to signify the end of the transfer 2 Lengthen the timeout period for the I O operation using ibtmo 3 Make sure that you have configured your device to send data before you request data ENEB 7 ENEB occurs when a GPIB board does not exist at the I O address specified in the configuration...

Page 149: ...rogress it causes the driver to return EOIP Solutions 1 Resynchronize the driver and the application before making any further GPIB calls Resynchronization is accomplished by using one of the following three functions ibwait If the returned ibsta contains CMPL the driver and application are resynchronized ibstop The I O is canceled the driver and application are resynchronized ibonl The I O is can...

Page 150: ...ere is enough room on the disk to hold the file EBUS 14 EBUS results when certain GPIB bus errors occur during device functions All device functions send command bytes to perform addressing and other bus management Devices are expected to accept these command bytes within the time limit specified by the configuration program or by ibtmo EBUS results if a timeout occurred during the sending of thes...

Page 151: ...ituation can be caused by the following events Usually a device unknown to the software is asserting SRQ Because the software does not know of this device it can never serial poll the device and unassert SRQ A GPIB bus tester or similar equipment might be forcing the SRQ line to be asserted A cable problem involving the SRQ line might exist The serial poll response queue of a device that is assert...

Page 152: ...es that there was some problem with a table used by these functions In the case of FindLstn ETAB means that the given table did not have enough room to hold all the addresses of the Listeners found In the case of FindRQS ETAB means that none of the devices in the given table were requesting service Solutions 1 Increase the size of result arrays for FindLstn and FindRQS ...

Page 153: ...m central time In other countries contact the nearest branch office You may fax questions to us at any time Corporate Headquarters 512 795 8248 Technical support fax 800 328 2203 512 794 5678 Branch Offices Phone Number Fax Number Australia 03 879 9422 03 879 9179 Austria 0662 435986 0662 437010 19 Belgium 02 757 00 20 02 757 03 11 Denmark 45 76 26 00 45 76 71 11 Finland 90 527 2321 90 502 2930 Fr...

Page 154: ...ur Getting Started Manual Use additional pages if necessary Name Company Address Fax Phone Computer brand Model Processor Operating system Speed MHz RAM MB Display adapter Mouse yes no Other adapters installed Hard disk capacity MB Brand Instruments used National Instruments hardware product model Revision Configuration continues ...

Page 155: ...National Instruments software product Version Configuration The problem is List any error messages The following steps will reproduce the problem ...

Page 156: ...ntation supplied with our products This information helps us provide quality products to meet your needs Title NI 488 2M Software Reference Manual for OS 2 Edition Date January 1995 Part Number 370950A 01 Please comment on the completeness clarity and organization of the manual continues ...

Page 157: ...be the errors Thank you for your help Name Title Company Address Phone Mail to Technical Publications National Instruments Corporation 6504 Bridge Point Parkway MS 53 02 Austin TX 78730 5039 Fax to Technical Publications National Instruments Corporation MS 53 02 512 794 5678 ...

Page 158: ...Handshake and Handshake Access Board The GPIB board that controls and communicates with the devices on the bus that are attached to it ANSI American National Standards Institute API Application Program Interface ASCII American Standard Code for Information Interchange Asynchronous An action or event that occurs at an unpredictable time with respect to the execution of a program ATN Attention A GPI...

Page 159: ...ns the names of the loadable device driver or driver programs that OS 2 loads when it is started up Controller In Charge The device that manages the GPIB by sending CIC interface messages to other devices D DAV Data Valid One of the three GPIB handshake lines See Handshake DCL Device Clear is the GPIB command used to reset the device or internal functions of all devices See SDC Declaration File A ...

Page 160: ...nd memory that is not handled directly by the CPU Not available on some systems See Programmed I O Driver Device driver software installed within the operating system Same as an OS 2 installed device driver DVM digital voltmeter E END or END Message 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 EOI A GPIB line tha...

Page 161: ...A The GPIB board has both a GPIB address and an I O address GPIB Board Refers to the National Instruments family of GPIB interface boards gpib sys The NI 488 2M driver file name Group Executed Trigger See GET GTL Go To Local is the GPIB command used to place an addressed Listener in local front panel control mode H Handshake The mechanism used to transfer bytes from the Source Handshake function o...

Page 162: ...t contains the specific error code associated with a function call that failed ibic The Interface Bus Interactive Control program is used to communicate with GPIB devices troubleshoot problems and develop your application ibsta At the end of each function call this global variable status word contains status information IFC or Interface Clear A GPIB line used by the System Controller to initialize...

Page 163: ...ines to access the driver Listen Address See MLA Listener A GPIB device that receives data messages from a Talker LLO Local Lockout is the GPIB command used to tell all devices that they may or should ignore remote GPIB data messages or local front panel controls depending on whether the device is in local or remote program mode Low Level Function A rudimentary board or device function that perfor...

Page 164: ...device to be a Talker There are 31 primary addresses Multitasking The concurrent processing of more than one program or task OS 2 provides a multitasking environment so that multiple applications can execute at the same time N NDAC One of the three GPIB handshake lines See Not Data Accepted Handshake NRFD One of the three GPIB handshake lines See Not Ready For Data Handshake O Open Device or Board...

Page 165: ...te in polls and to assign a DIO response line There are 16 PPE commands PPU Parallel Poll Unconfigure is the GPIB command Parallel Poll used to disable any device from participating in Unconfigure polls Programmed I O Low speed data transfer between the GPIB board and memory in which the CPU moves each data byte according to program instructions See DMA R RAM random access memory REN Remote Enable...

Page 166: ...used to Serial Poll Enable enable a specific device to be polled That device must also be addressed to talk See SPD SRQ Service Request The GPIB line that a device asserts to notify the CIC that the device needs servicing Status Byte The data byte sent by a device when it is serially polled Status Word See ibsta Synchronous Refers to the relationship between the NI 488 2M driver functions and a pr...

Page 167: ...ts I O functions from hanging indefinitely when there is a problem on the GPIB TLC An integrated circuit that implements most of the GPIB Talker Listener and Controller functions in hardware U ud unit descriptor A variable name and first argument of each function call that contains the unit descriptor of the GPIB interface board or other GPIB device that is the object of the function UNL Unlisten ...

Page 168: ...ces 2 4 to 2 5 end of string mode 2 8 to 2 9 files on distribution disk 1 1 to 1 2 2 1 non controller 2 21 to 2 22 parallel polls 2 18 to 2 20 serial polls using NI 488 2 routines 2 16 to 2 17 service requests 2 10 to 2 13 applications debugging checking global variable status 4 3 communication errors 4 6 configuration errors 4 4 GPIB error codes 4 3 to 4 4 ibic 4 3 ibtest 4 1 to 4 2 reconfiguring...

Page 169: ...3 6 iberr error variable 3 6 ibsta status word 3 4 to 3 5 asynchronous I O EOIP error code B 7 example 2 6 to 2 7 AT GPIB boards ibtest checking of 4 1 to 4 2 ATN attention line table 1 7 ATN status A 4 automatic serial polling enabling 7 13 interrupts and 6 5 procedure for 6 4 to 6 5 stuck SRQ state and 6 5 auxiliary functions ibic See ibic utility B base I O address 7 14 board configuration See ...

Page 170: ...id handshake line table 1 6 DCAS status A 5 debugging applications See applications debugging default configurations in ibconf 7 16 description level of ibconf utility See ibconf utility DevClear routine 3 17 developing applications See applications writing device configuration See ibconf utility device functions See NI 488 functions device level calls 6 2 to 6 3 devices clearing 3 10 configuring ...

Page 171: ...5 15 B 6 ENOL B 3 to B 4 EOIP B 7 ESAC B 5 to B 6 ESRQ B 9 ESTB B 9 ETAB B 10 GPIB 4 3 to 4 4 returned by ibic 5 10 summary table B 1 error variable iberr See iberr error variable errors communication errors 4 6 repeat addressing 4 6 termination method 4 6 configuration errors 4 4 GPIB specific errors selecting 7 12 timing errors 4 5 ESAC error code B 5 to B 6 ESB Event Status bit 6 4 ESRQ error c...

Page 172: ...IEEE 488 devices 6 3 from IEEE 488 2 devices 6 4 SRQ and serial polling with NI 488 device functions 6 6 with NI 488 2 routines 6 6 to 6 8 termination of data transfers 6 1 to 6 2 waiting for GPIB conditions 6 2 H handshake lines DAV table 1 6 NDAC table 1 6 NRFD table 1 6 overview 1 6 Help function ibic utility caps 5 20 I ibclr function 3 10 ibcnt and ibcntl count variables debugging application...

Page 173: ...config function activating CIC protocol 6 3 autopolling 6 4 determining EOI line assertion 6 2 dynamic configuration of drivers 7 1 reconfiguring NI 488 2M software 4 5 ibdev function EARG error 5 15 EDVR error 5 15 ENEB error 5 15 ibic utility 5 13 to 5 16 opening devices 3 9 parallel polling 6 11 ibeos function 6 1 ibeot function 6 1 iberr error variable debugging applications 4 3 description 3 ...

Page 174: ...bsta status word ATN status A 4 CIC status A 4 CMPL status A 3 DCAS status A 5 debugging applications 4 3 description 3 4 to 3 5 DTAS status A 5 END status A 2 ERR status A 2 LACS status A 5 layout table 3 5 LOK status A 3 REM status A 4 returned by ibic 5 9 RQS status A 3 SRQI status A 2 summary table A 1 TACS status A 4 TIMO status A 2 ibtest 4 1 to 4 2 GPIB cables connected 4 2 incorrect interr...

Page 175: ...1 WaitSRQ routine 3 18 Message Available bit MAV 6 4 messages sending across GPIB 1 6 to 1 7 N n repeat function n times function ibic utility 5 22 to 5 23 NDAC not data accepted handshake line table 1 6 NI 488 applications writing See applications writing NI 488 functions 3 2 to 3 3 See also specific functions advantages 3 2 board functions description 3 3 ibic utility examples 5 31 to 5 35 devic...

Page 176: ...el of ibconf utility See ibconf utility P parallel polling example 2 18 to 2 20 implementation of 6 9 to 6 12 with NI 488 functions 6 10 to 6 12 with NI 488 2 routines 6 9 to 6 10 setting duration of 7 13 paths including in LIBPATH statement 3 21 PPoll routine 6 10 PPollUnconfig routine 6 10 primary GPIB address 7 10 print display ASCII string function ibic utility 5 24 program shells NI 488 3 8 N...

Page 177: ...IEEE 488 2 routines 6 6 to 6 8 SRQI status A 2 Set function description 5 19 to 5 20 selecting NI 488 2 function mode 5 11 SRQ service request line application example 2 10 to 2 13 description table 1 7 ESRQ error code B 9 requesting service 6 3 serial polling with NI 488 device functions 6 6 with NI 488 2 routines 6 6 to 6 8 stuck SRQ state 6 5 SRQI status A 2 standards ANSI IEEE Standard 488 1 1...

Page 178: ...5 TIMO status A 2 TRG command 3 18 Trigger routine 3 18 triggering GPIB devices example 2 4 to 2 5 turn off display function ibic utility 5 21 to 5 22 turn on display function ibic utility 5 21 to 5 22 W WaitSRQ routine 3 18 6 7 6 8 writing applications See applications writing ...

Reviews: