Page 2
National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 (512) 794-0100 Technical support fax: (800) 328-2203 (512) 794-5678 Branch Offices: Australia 03 9 879 9422, Austria 0662 45 79 90 0, Belgium 02 757 00 20, Canada (Ontario) 519 622 9310, Canada (Québec) 514 694 8521,...
Page 3
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.
Page 4
Any use or application of National Instruments products for or involving medical or clinical treatment must be performed by properly...
NI-488.2M Driver and Driver Utilities ..........1-6 DOS and 16-bit Windows Support Files........... 1-7 C Language Files................1-7 Sample Application Files ..............1-7 How the NI-488.2M Software Works with Windows NT....... 1-8 Unloading and Reloading the NI-488.2M Driver ..........1-9 Chapter 2 Application Examples ...................
Page 7
Debugging Your Application ................4-1 Running the Software Diagnostic Test ............4-1 Presence Test of Driver ..............4-1 Examining NT Devices to Verify the NI-488.2M Installation................4-1 Examining the NT System Log Using the Event Viewer............... 4-2 GPIB Cables Connected ..............4-2 Running GPIBInfo...................
Page 10
Figure 1-2. Linear and Star System Configuration ............1-4 Figure 1-3. Example of Multiboard System Setup ............1-5 Figure 1-4. How the NI-488.2M Software Works with Windows NT ......1-9 Figure 2-1. Program Flowchart for Example 1 ............. 2-3 Figure 2-2. Program Flowchart for Example 2 ............. 2-5 Figure 2-3.
Use the getting started manual to install and configure your GPIB hardware and NI-488.2M software for Windows NT. Use the NI-488.2M User Manual for Windows NT to learn the basics of GPIB and how to develop an application program. The user manual also contains debugging information and detailed examples.
Organization of This Manual This manual is organized as follows: • Chapter 1, Introduction, gives an overview of GPIB and the NI-488.2M software. • Chapter 2, Application Examples, contains nine sample applications designed to illustrate specific GPIB concepts and techniques that can help you write your own applications.
• Microsoft Win 32 Software Development Kit for Windows NT: Tools 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 help if you have problems with them.
Some devices are capable of playing more than one role. A digital voltmeter, for example, can be a Talker and a Listener. If your personal computer has a National Instruments GPIB interface board and NI-488.2M software installed, it can function as a Talker, Listener, and Controller.
Introduction Controlling More Than One Board The NI-488.2M driver can control up to 10 GPIB boards. Figure 1-3 shows an example of a multiboard system configuration. 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.
The distribution disk contains the following driver and utility files: • readme.txt is a documentation file that contains important information about the NI-488.2M software and a description of any new features. Before you use the software, read this file for the most recent information. •...
• gpibinfo.exe is a utility you can use to obtain information about your GPIB hardware and software, such as the version of the NI-488.2M software and the type of interface board you are using. DOS and 16-bit Windows Support Files •...
Chapter 1 How the NI-488.2M Software Works with Windows NT The main components of the NI-488.2M software are a dynamic link library that runs in user mode and a layered NT device driver that runs in kernel mode. The layered NT...
Double-click on the ibconf icon to start it. The main ibconf window has an Unload button and a Restart button. If you click on the Unload button, the NI-488.2M driver is unloaded. If you click on the Restart button, the NI-488.2M driver is automatically unloaded and then reloaded.
Use this chapter along with your NI-488.2M software, which includes the C source code for each of the nine examples. The programs are listed in order of increasing complexity.
A technician needs to monitor voltage readings using a GPIB multimeter. His computer is equipped with an IEEE 488.2 interface board. The NI-488.2M software is installed, and a GPIB cable runs from the computer to the GPIB port on the multimeter.
This example illustrates how you can clear and trigger GPIB devices. Two freshman physics lab partners are learning how to use a GPIB digital oscilloscope. They have successfully loaded the NI-488.2M software on a personal computer and connected their GPIB board to a GPIB digital oscilloscope. Their current lab assignment is to write a small application to practice using the oscilloscope and its command set using high-level GPIB commands.
The entire operation is computer-controlled. The CAT scan machine sends the images it acquires to a computer that has the NI-488.2M software installed and is connected to a GPIB color printer. The biologist is familiar with the command set of her color printer, as described in the user manual provided by the manufacturer.
IEEE 488.2 interface board installed in her computer. She has installed the NI-488.2M software on the host computer and is familiar with the programming instructions for the film recorder, as described in the user manual provided by the manufacturer.
The GPIB strain gauges are connected to a computer with an IEEE 488.2 interface board and the NI-488.2M software installed. The process is controlled by an application that uses NI-488.2 routines to communicate with the IEEE 488.2-compliant strain gauges.
The three monitoring units are connected to the IEEE 488.2 interface board of a computer that has the NI-488.2M software installed. An application using NI-488.2 routines operates the three monitoring units. The application will obtain information from the multiple units by conducting a parallel poll, and will then determine when to pour the metals into the mixture tank.
Chapter 2 Example 9: Non-Controller Example This example illustrates how you can use the NI-488.2M software to emulate a GPIB device that is not the GPIB Controller. A software engineer has written firmware to emulate a GPIB device for a research project and is testing it using an application that makes simple GPIB calls.
NI-488.2 routines. Choosing How to Access the NI-488.2M DLL Applications can access the NI-488.2M dynamic link library ( gpib-32.dll) either by using an NI-488.2M language interface or with direct access. If you need to access the gpib-32.dll from a language other than C, you must directly access the gpib-32.dll.
You simply substitute the board index as the first parameter of the board function call. With this flexibility, you can handle non-standard or unusual situations that you cannot resolve using NI-488.2M routines only. Using NI-488.2 Routines: Multiple Boards and/or Multiple Devices When your system includes a board that must access multiple devices, use the NI-488.2...
NI-488 example. In this manual the example code is presented in C using the standard C language interface. The NI-488.2M software includes the source code for this example written in C (devsamp.c) and the source code for this example written to use direct entry to access the gpib-32.dll (dlldev.c ).
NI-488.2 routines, general program steps, and an NI-488.2 example. In this manual the example code is presented in C using the standard C language interface. The NI-488.2M software includes the source code for this example written in C (samp4882.c) and the code for this example written to use direct entry to access the gpib-32.dll...
Page 62
The prototypes for each function that gpib-32.dll exports can be found in the NI-488.2M Function Reference Manual for Windows NT . The NI-488.2M direct entry sample programs illustrate how to use direct entry to access gpib-32.dll. Use the LoadLibrary and GetProcAddress functions to load the gpib-32.dll and get...
To run 16-bit Windows GPIB applications, the system uses the special GPIB dynamic link library, gpib.dll. When you install the NI-488.2M software, gpib.dll is copied into the <winnt> \system32 directory, where <winnt> is your Windows NT directory, for example c:\windows).
If the software is not properly installed or if there is a conflict between the GPIB hardware and the other hardware in the system, the NI-488.2M driver fails to start. Two Windows NT utilities are useful in determining the source of the problem: the Devices applet in the Control Panel in the Main group, and the Event Viewer in the Administrative Tools group.
Examining the NT System Log Using the Event Viewer Windows NT maintains a system log. If the NI-488.2M driver is unable to start, it records entries in the system log explaining why it failed to start. You can examine the system log by running the Event Viewer utility in the Administrative Tools window of the Program Manager .
This information helps you determine the capabilities of your NI-488.2M software and is also helpful if you need to call National Instruments for technical support. Run GPIBInfo with no parameters. The program displays software information such as...
You should be aware of the data termination method that your device uses. By default, your NI-488.2M software is configured to send EOI on writes and terminate reads on EOI or a specific byte count. If you send a command string to your device and it does not respond, it might be because it does not recognize the end of the command.
Page 71
Run the GPIBInfo utility. It returns information about the GPIB boards currently configured for use in your system. How can I determine which version of the NI-488.2M software I have installed? Run the GPIBInfo utility. It provides information about the version of the NI-488.2M software currently installed.
Page 73
Then enter the command ibic. Your screen should appear as follows: National Instruments IEEE 488 Interface Bus Interactive Control Program (IBIC) Copyright 1993 National Instruments Corp. Version 3.0 (Win32) Version Date: May 28 1993 Version Time: 09:42:25 All rights reserved Type ‘help’...
EARG and ibic displays the index of the invalid address as the count. The count has a different meaning depending on which NI-488 function or NI -488.2 routine is called. Refer to the function descriptions in the NI-488.2M Function Reference Manual for Windows NT for the correct interpretation of the count return.
GPIB data transfers are terminated either when the GPIB EOI line is asserted with the last byte of a transfer or when a preconfigured end-of-string (EOS) character is transmitted. By default, the NI-488.2M driver asserts EOI with the last byte of writes and the EOS modes are disabled.
IbcEndBitIsNormal option to configure the software to report only the END bit in ibsta when the GPIB EOI line is asserted. By default, the NI-488.2M driver reports END in ibsta when either the EOS byte is read in or the EOI line is asserted during a read.
(option IbaHSCableLength) in your application program. For CFE and CFGn messages, refer to Appendix A, Multiline Interface Messages, in the NI-488.2M Function Reference Manual for Windows NT.
The interface board returns a response byte of hex 42. The current CIC passes control to the GPIB board. If the current CIC does not pass control, the NI-488.2M driver returns the ECIC error code to your application. This error can occur if the current CIC does not understand the CIC Protocol.
In this case, an automatic serial poll can occur even when your application is not making any calls to the NI-488.2M software. Autopolling can also occur when a device-level ibwait for RQS is in progress. Autopolling is not allowed whenever an application calls a board-level NI-488 function or any NI-488.2 routine, or the stuck SRQ...
Chapter 6 SRQ and Serial Polling with NI-488.2 Routines The NI-488.2M software includes a set of NI-488.2 routines that you can use to conduct SRQ servicing and serial polling. Routines pertinent to SRQ servicing and serial polling are AllSpoll, FindRQS , ReadStatusByte, TestSRQ , and WaitSRQ .
If your application program uses ibconfig whenever it needs to modify a configuration option, it is able to run on any computer with the appropriate NI-488.2M software, regardless of the configuration of that computer.
GPIB-related applications and click Restart again, or to shut down and restart your computer. If you need to unload the NI-488.2M software and prevent it from reloading when you restart your computer, click the Unload button. If ibconf cannot unload the NI-488.2M software, it instructs you either to exit all GPIB-related applications, or to...
DMA channel of your board, refer to the getting started manual that came with your GPIB interface board. Use Demand Use this item to select the DMA transfer mode that the NI-488.2M Mode DMA software uses. When this item is selected, the NI-488.2M software uses demand mode for DMA transfers.
GPIB Primary All GPIB boards must be assigned a unique primary address. This Address address, a number in the range 0 to 30 decimal, is used by the NI-488.2M software to compute the talk and listen addresses of the board. The default primary address of all interface boards is zero. GPIB...
EOS byte for a match. When this item is selected, the NI-488.2M software uses all eight bits of the EOS byte when checking for a match. By default this option is not selected.
GPIB EOI line whenever it sends the EOS byte. By default this option is not selected. 8-bit EOS When the NI-488.2M software is configured to use the EOS byte, it can Compare test either seven or eight bits of the EOS byte for a match. When this item is selected, the NI-488.2M software uses all eight bits of the EOS...
The default timeout period is 10 s. Serial Poll Use t his option to select the length of time the NI-488.2M software Timeout waits for a serial poll response from the device. The IEEE 488 standard does not specify the length of time a Controller should wait for the response byte.
This Board field is selected. • If the NI-488.2M driver is installed and configured, but you continue to receive the error EDVR, use the Windows NT Event Viewer to find a solution. The driver maintains a log of errors in this utility and posts possible corrections to any problems that occur while loading.
Filling out a copy of the Technical Support Form before contacting National Instruments helps us help you better and faster. National Instruments provides comprehensive technical assistance around the world. In the U.S.
Page 125
Instruments for technical support helps our applications engineers answer your questions more efficiently. If you are using any National Instruments hardware or software products related to this problem, include the configuration forms from their user manuals. Include additional pages if necessary.
Page 126
National Instruments software product Version Configuration The problem is List any error messages The following steps will reproduce the problem...
Page 127
Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. ™ Title: NI-488.2M User Manual for Windows NT Edition Date: January 1996 Part Number: 320646B-01 Please comment on the completeness, clarity, and organization of the manual.
Page 128
If you find errors in the manual, please record the page numbers and describe the errors. Thank you for your help. Name Title Company Address Phone Mail to: Technical Publications National Instruments Corporation 6504 Bridge Point Parkway Austin, TX 78730-5039 Fax to: Technical Publications National Instruments Corporation (512) 794-5678...
An action or event that occurs at an unpredictable time with respect to the execution of a program. automatic serial polling A feature of the NI-488.2M software in which serial polls (autopolling) are executed automatically by the driver whenever a device asserts the GPIB SRQ line.
Page 131
(MSA). 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. Go To Local is the GPIB command used to place an addressed (Go To Local) Listener in local (front panel) control mode.
Page 132
Hertz. After each NI-488 I/O function, this global variable contains ibcnt the actual number of bytes transmitted. The NI-488.2M driver configuration program. ibconf A global variable that contains the specific error code iberr associated with a function call that failed.
Page 135
The IEEE 488.2-defined 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 process when executing driver functions is predictable; the process is blocked until the driver completes the function. System Controller...
Page 136
The GPIB command used to pass control of the bus from the (Take Control) current Controller to an addressed Talker. timeout A feature of the NI-488.2M driver that prevents I/O functions from hanging indefinitely when there is a problem on the GPIB. An integrated circuit that implements most of the GPIB Talker, Listener, and Controller functions in hardware.
Page 139
Bus Timing option, ibconf utility, 7-4 C language compiling, linking, and running applications, 3-17 to 3-19 direct entry, 3-17 to 3-19 files available with NI-488.2M software, 1-7 cables checking with ibtest, 4-2 setting cable length for high-speed data transfers, 7-4 CIC.
Page 140
4-5 to 4-6 repeat addressing, 4-5 to 4-6 termination method, 4-6 configuration errors, 4-5 examining NT devices to verify NI-488.2M installation, 4-1 to 4-2 global status variables, 4-3 GPIB error codes (table), 4-4, B-1 GPIBInfo utility, 4-3 ibic utility, 4-4...
Page 141
DOS GPIB applications, 3-20 DOS support files, 1-7 drivers configuring, 4-5 driver and driver utilities for NI-488.2M software, 1-6 to 1-7 testing with ibtest, 4-1 to 4-2 DTAS status word condition bit position, hex value, and type (table), 3-4 description, A-5...
Page 151
SendList, 5-13 NI-488.2M DLL choosing how to access, 3-1 requirements for direct access, 3-1 NI-488.2M software, 1-6 to 1-9. See also application development; NI-488 functions; NI-488.2 routines. C language files, 1-7 DOS and 16-bit Windows support files, 1-7 driver and driver utility files, 1-6 to 1-7 interaction with Windows NT, 1-8 reloading NI-488.2M driver, 1-9...
Page 152
1-6, 1-7 ReadStatusByte routine, 6-8 Receive routine reading measurements, 3-16 using in ibic, 5-12 reloading NI-488.2M driver, 1-9, 7-2 REM status word condition bit position, hex value, and type (table), 3-4 description, A-4 REN (remote enable) line Assert REN When SC option, ibconf utility, 7-8...