GPIB 232CT a GettingStarted
GPIB 232CT a GettingStarted
Branch Offices:
Australia (03) 879 9422, Austria (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
Limited Warranty
The GPIB-232CT-A is warranted against defects in materials and
workmanship for a period of two years from the date of shipment, as
evidenced by receipts or other documentation. National Instruments will, at
its option, repair or replace equipment that proves to be defective during the
warranty period. This warranty includes parts and labor.
Copyright
Under the copyright laws, this publication may not be reproduced or
transmitted in any form, electronic or mechanical, including photocopying,
recording, storing in an information retrieval system, or translating, in
whole or in part, without the prior written consent of National Instruments
Corporation.
Trademarks
LabVIEW ®, NI-488 ®, and NI-488.2™ are trademarks of National
Instruments Corporation.
Product and company names listed are trademarks or trade names of their
respective companies.
Instructions to Users
These regulations are designed to provide reasonable protection against
harmful interference from the equipment to radio reception in commercial
areas. Operation of this equipment in a residential area is likely to cause
harmful interference, in which case the user will be required to correct the
interference at his own expense.
There is no guarantee that interference will not occur in a particular
installation. However, the chances of interference are much less if the
equipment is installed and used according to this instruction manual.
• Move the equipment away from the receiver with which it is interfering.
• Be sure that the equipment is plugged into a grounded outlet and that
the grounding has not been defeated with a cheater plug.
Chapter 1
Introduction......................................................................................... 1-1
GPIB-232CT-A Overview.......................................................... 1-1
What You Need to Get Started................................................... 1-2
Optional Equipment....................................................................1-3
Inspection ................................................................................... 1-3
Hardware Description................................................................. 1-3
Software Description ..................................................................1-4
Chapter 2
Install Your Hardware ................................................................... 2-1
Step 1. Verify the Voltage Requirement ..................................2-1
Step 2. Shut Down Your System..............................................2-1
Step 3. Connect the Cables ....................................................... 2-2
Step 4. Power On Your System and Switch On the
GPIB-232CT-A ............................................................2-2
Chapter 3
Install the NI-488.2 Software for MS-DOS ............................3-1
Main Programs and Files ............................................................3-1
Additional Programs and Files ................................................... 3-2
Terminology ............................................................................... 3-3
Step 1. Run INSTALL ............................................................. 3-3
Quick Installation ......................................................... 3-3
Interactive Installation..................................................3-4
Step 2. Configure the Software ................................................3-5
Step 3. Verify the Software Installation ................................... 3-6
Step 4. Developing Your Application Program ....................... 3-7
Interactive Control Program (IBIC) ............................. 3-7
Applications Monitor ................................................... 3-8
The Application Program............................................. 3-8
Chapter 4
Install the NI-488.2 Software for Windows ............................4-1
NI-488.2 Files for the Windows Operating Environment ..........4-1
NI-488.2 Files for the Development of Windows
Applications................................................................................ 4-2
GPIB Sample Windows Application Program ........................... 4-2
Step 1. Run INSTALL ............................................................. 4-3
Quick Installation ......................................................... 4-3
Interactive Installation..................................................4-4
Step 2. Set Up the Windows Applications ............................... 4-5
Step 3. Configure the Software ................................................4-5
Step 4. Verify the Software Installation ................................... 4-5
Using WIBIC ..............................................................................4-6
Writing Windows Programs That Use the GPIB ....................... 4-7
The WINSAMP Sample............................................... 4-7
General Rules for Using GPIB.LIB with Windows..... 4-8
Chapter 5
Configure Your Software with IBCONF ................................5-1
Overview of IBCONF................................................................. 5-1
Upper and Lower Levels of IBCONF ........................................ 5-3
Upper Level Device Map ............................................. 5-3
Device Maps of the Boards............................5-4
Help................................................................ 5-4
Rename .......................................................... 5-4
(Dis)connect................................................... 5-5
Edit................................................................. 5-5
Output GPIB Driver Configuration
(IBCONF.EXE only) ..................................... 5-6
Autoconfigure (IBCONF.EXE only)............. 5-6
Exit................................................................. 5-6
Lower Level Device/Board Characteristics ................. 5-7
Change Characteristics................................... 5-8
Change Board or Device................................5-8
Help................................................................ 5-8
Reset Value .................................................... 5-8
Return to Map ................................................5-8
Default Configurations ............................................................... 5-9
Default Values..............................................................5-9
Appendix A
Hardware Configuration ............................................................... A-1
Configure the RS-232 Serial Port............................................... A-1
Appendix B
Hardware Specifications ................................................................ B-1
Appendix C
Troubleshooting ................................................................................. C-1
Troubleshooting Hardware Problems......................................... C-1
Troubleshooting Software Problems ..........................................C-2
Appendix D
DLL Direct Entry NI-488 Functions and
NI-488.2 Routines ............................................................................. D-1
Appendix E
Interfacing to a Serial Device ....................................................... E-1
The RS-232C Standard............................................................... E-1
Description of the RS-232 Port................................................... E-1
Interfacing Serial Devices to the RS-232 Serial Port ................. E-3
Interfacing the GPIB-232CT-A to a DCE with
Handshaking................................................................. E-3
Interfacing the GPIB-232CT-A to a DCE without
Handshaking................................................................. E-5
Minimum Configuration Cable...................... E-6
Custom Cables ............................................... E-7
Interfacing the GPIB-232CT-A to a DTE with
Handshaking................................................................. E-7
Interfacing the GPIB-232CT-A to a DTE without
Handshaking................................................................. E-9
Minimum Configuration Cable...................... E-9
Custom Cables ............................................... E-10
Appendix F
Customer Communication ............................................................F-1
Glossary...................................................................................... Glossary-1
Figures
Figure 1-1. GPIB-232CT-A................................................................ 1-1
Figure A-1. Factory Default Setting (S Mode) for DIP Switch........... A-1
Tables
Table 5-1. IBCONF Options ............................................................. 5-2
This manual contains instructions for installing and configuring the National
Instruments GPIB-232CT-A RS-232-to-GPIB Controller and NI-488.2
software for MS-DOS/Windows. This manual is meant to be used with the
NI-488.2 Software Reference Manual for MS-DOS.
italic monospace Italic text in this font denotes that you must
supply the appropriate words or values in the
place of these items.
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 the GPIB.
Related Documentation
The following documents contain information that you may find helpful as
you read this manual:
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. To make it
easy for you to contact us, this manual contains comment and configuration
forms for you to complete. These forms are in Appendix F, Customer
Communication, at the end of this manual.
GPIB-232CT-A Overview
The GPIB-232CT-A is a high-performance serial-to-GPIB interface. It
provides a computer with an RS-232 port, a means of controlling, talking,
and listening on the GPIB. The GPIB-232CT-A is also capable of
interfacing RS-232 instruments and peripherals to the GPIB.
The GPIB-232CT-A has all the software and logic required to implement
the physical and electrical specifications of the IEEE 488 and RS-232
standards. It can interpret and execute high-level commands that you send
to it over the serial port, and perform GPIB-to-RS-232 protocol conversion.
The GPIB-232CT-A also conforms to all versions of the IEEE 488
standard, including IEEE 488.2. The NAT4882 Controller chip implements
all IEEE 488 Talker/Listener/Controller functionality.
GPIB-232CT-A
RS-232 IEEE 488 Controller
ER
EN
Y
D
NATIONAL
K
W
Q
ST
EA
N
L
PO
SR
TA
AT
INSTRUMENTS
LI
R
Optional Equipment
You can call National Instruments to order the following optional
equipment.
Inspection
Before you operate the GPIB-232CT-A, inspect the shipping container and
its contents for damage. Keep the packaging material for possible
inspection and/or reshipment.
Hardware Description
The GPIB-232CT-A is a high-performance serial-to-GPIB interface product.
It uses the NAT4882 GPIB Controller chip for complete IEEE 488.2
compatibility. You can connect the personal computer serial port to the
RS-232 port for controlling, talking, and listening on the GPIB. The
GPIB -232CT-A is also capable of interfacing RS-232 instruments and
peripherals to the GPIB.
Software Description
NI-488.2 software is part of your GPIB-232CT-A kit. It is a comprehensive
set of programs and drivers for transforming the PC into a GPIB Controller
with complete communications and bus management capability. The
NI-488.2 software also includes the Microsoft C, Microsoft BASIC,
QuickBASIC, and BASICA language interfaces.
The default hardware settings for the GPIB-232CT-A are compatible with
the default software settings. If you need more information or want to
change the defaults, follow the directions in Appendix A, Hardware
Configuration . If you change the hardware settings, make sure that you also
change the software settings so that they are compatible.
Caution: Operating the GPIB-232CT-A at any voltage other than the one
specified could damage the unit. Replacement fuses for the AC
version must be the proper type and size. Refer to Appendix B,
Hardware Specifications, for fuse specifications.
2. If you have an AC version, use the front panel rocker switch to power
on your GPIB-232CT-A. If you have a DC version, use the power
switch on the rear panel to power on your GPIB-232CT-A.
Before installing the software, you should understand the files that will
be installed from the distribution disks and their purpose.
Terminology
The term source disk or source directory refers to the NI-488.2 distribution
disk. The term destination directory refers to the location on your hard disk
or disk where the software will be installed (usually C:\GPIB-CT ). The
term boot drive refers to the drive that is read by your computer when you
power-on or restart your computer.
Quick Installation
This quick version of the INSTALL program assumes that C: is your boot
drive. INSTALL copies files to the GPIB destination directory, named
C:\GPIB-CT and makes a change to your C:\CONFIG.SYS file.
Note: If your boot drive is not C:, or you do not want the default
destination directory to be created, you must install the NI-488.2
software interactively. Refer to the following section, Interactive
Installation, for more information.
After starting your computer, run the INSTALL program located on the
distribution disk by entering the following command:
X:install /q
where X is the name of the drive containing the distribution disk (usually A
or B).
The quick version of INSTALL copies the NI-488.2 files and then
automatically modifies the C:\CONFIG.SYS file. If no error message
appears, the NI-488.2 software is successfully installed and you can proceed
to Step 2. Configure the Software. If an error occurs during the quick
installation, you may need to run the INSTALL program interactively, as
described in the next section. For more information on error codes, refer to
Chapter 3, Understanding the NI-488.2 Software, in the NI-488.2 Software
Reference Manual for MS-DOS.
Interactive Installation
If you choose to interactively install the NI-488.2 software, complete the
following instructions.
After starting your computer, run the INSTALL program on the distribution
disk by entering the following command:
X:install
where X is the name of the drive containing the distribution disk (this is
usually A).
Select the type of installation that you want to use (Partial or Full). If you
select Partial GPIB Installation, you are prompted to choose which parts
of the NI-488.2 software to install. If you select Full GPIB Installation,
all of the NI-488.2 software is installed.
Next, you are prompted to give your boot drive and the name of a new
directory into which the files can be copied. The INSTALL program creates
the specified destination directory and copies the files listed in the previous
section to their appropriate directories.
You must run IBCONF if you have made any changes to the
GPIB-232CT-A hardware switches or you need to change any of the default
software configuration options. If you have not changed the hardware in
any way and the default software configuration is acceptable, there is no
need to run IBCONF. You can, however, run IBCONF just to examine the
software configuration.
Caution: In DOS, devices must NOT have the same names as files,
directories, or subdirectories. The MS-DOS GPIB device
driver uses the names GPIB0, GPIB1, GPIB2, GPIB3 and
DEV1, DEV2, DEV3 through DEV32. If you have files,
• Did you restart your computer after installing and configuring the
NI-488.2 software? If not, restart your computer and run IBTEST
again.
If you have performed these steps and there is still a problem, refer to
Appendix C, Troubleshooting, for more information on installing or using
the NI-488.2 software.
If no errors occurred, you can proceed to learn how to use the software and
how to develop your application program.
With IBIC , you can program your instruments interactively from the
keyboard rather than from an application program. Using IBIC helps you
quickly understand how the instruments and the NI-488.2 software work.
IBIC is fully described in Chapter 6, IBIC, of the NI-488.2 Software
Reference Manual for MS-DOS.
While running IBIC, you should study the descriptions of each function
given to fully understand their purpose or you can use the online help
available if you have questions.
To use IBIC.EXE , connect your instrument to the bus and enter the
following commands:
cd \ dir
where dir is the name of the directory to which INSTALL copied the
NI -488.2 software. By default, dir is c:\GPIB-CT.
IBIC
Applications Monitor
The program APPMON.EXE is the Applications Monitor. It is a DOS
memory-resident program that is used to monitor and record GPIB calls that
are made to the MS-DOS driver. It can also be used to halt the execution of
an application when a particular bit, for example, ERR, is set in ibsta.
The Applications Monitor stores up to 255 previous GPIB calls and is
invaluable for debugging your application. The Applications Monitor is
fully described in Chapter 7, Applications Monitor, of the NI-488.2
Software Reference Manual for MS-DOS.
Before installing the software, you should understand the files that will be
copied from the distribution disk(s) and the purpose of each file. The
following section describes the files contained on the distribution disk(s).
• GPIB.LIB is the import library for the DLL. You must link it to your
NI-488.2 application for Windows just like any other library.
• WINSAMP.RC is the resource script file that defines the menus and the
dialog-box template for the About dialog box.
Quick Installation
This quick version of the INSTALL program assumes that Windows is
installed in the default directory ( C:\WINDOWS). INSTALL copies files to
C:\WINDOWS and the GPIB destination directory, named C:\GPIB-CTW.
Note: If Windows is not in its default directory or you do not want the
default destination directory to be created, you must install the
NI-488.2 software for Windows interactively. Refer to the
following section, Interactive Installation.
After starting your computer, run the INSTALL program located on the
distribution disk by entering the following command:
X:install /qw
where X is the name of the drive containing the distribution disk (this is
usually A).
Interactive Installation
If you choose to interactively install the NI-488.2 software, complete the
following instructions.
After starting your computer, run the INSTALL program on the distribution
disk by entering the following command:
X:install
where X is the name of the drive containing the distribution disk (this is
usually A).
Select the type of installation that you want to use (Partial or Full). If you
select Partial GPIB Installation, you are prompted to choose which parts
of the NI-488.2 software to install. If you select Full GPIB Installation,
all of the NI-488.2 software is installed.
Next, you are prompted to give the location of your Windows directory and
you are prompted for the name of the directory where Windows is stored
and the name of a new directory into which the files can be copied. The
INSTALL program creates the specified destination directory and copies
the NI-488.2 files to the appropriate directories.
If you have performed these steps and there is still a problem, refer to
Appendix C, Troubleshooting, for more information on installing the
GPIB-232CT-A.
If no errors occur, you can proceed to learn how to use the software and how
to develop your application program.
Using WIBIC
The easiest way to learn to communicate with your instrument is by
controlling it interactively. Located in your GPIB directory is the Interface
Bus Interactive Control program called WIBIC.EXE. You can use this
program to communicate with your instrument; the program displays the
status and any error after each NI-488.2 call.
With WIBIC, you can program your instruments interactively from the
keyboard rather than from an application program. Using WIBIC helps you
quickly understand how the instruments and the NI-488.2 software work.
The WIBIC program is the Windows version of the NI-488.2 software for
MS-DOS IBIC program. It has the same general appearance and same
function as the DOS IBIC program. Refer to Chapter 6, IBIC, of your
NI-488.2 Software Reference Manual for MS-DOS for a complete
description of how to use IBIC.
While running WIBIC, you should study the descriptions of each function
given to fully understand their purpose or you can use the online help
available if you have questions.
The remainder of this chapter describes the WINSAMP sample program that
illustrates how GPIB calls can be made from a simple Microsoft C
Windows application using the National Instruments Microsoft C language
interface. It also lists a general set of rules to follow when using the DLL in
your own Windows application.
make
• Make the same GPIB calls that you do under DOS (refer to the
NI-488.2 Software Reference Manual for MS-DOS for a list of these
calls).
Note: All NI-488.2 GPIB.DLL files for Windows share the same
.LIB file; therefore, you do not have to relink applications
to switch between GPIB boxes.
In this chapter, the term IBCONF is used to refer to both IBCONF.EXE and
WIBCONF.EXE . When you complete your software configuration using
IBCONF , you are ready to begin developing your application program. If
you need more information on IBCONF, refer to the online help screens in
the configuration utility.
Note: Throughout this chapter and IBCONF, the terms interface board ,
access board, and board are used to refer the GPIB-232CT-A.
Overview of IBCONF
IBCONF is a screen-oriented, interactive program that is used to modify the
configuration parameters for your GPIB-232CT-A and the GPIB devices
connected to it.
In DOS, changes to the device driver using IBCONF.EXE take effect in the
memory-resident device driver in two ways:
IBCONF
For Windows, you can run WIBCONF.EXE either from DOS or Windows.
WIBCONF.EXE finds the GPIB.INI file that contains the configuration
information by going through the following process:
• Help
• Rename
• (Dis)connect
• Edit
• Exit
Use <PageUp> or <PageDown> to toggle between the device maps for the
different GPIB boards. Each board is referred to as an access board by
IBCONF . The maps show which devices are assigned to each box. The
default settings attach 16 devices to GPIB0 and 16 devices to GPIB1.
Help
Rename
Use <F4> to rename a device. Move to the device you want to rename by
using the cursor control keys. Press <F4> and enter the new name of the
device. The device name may contain up to eight characters and uses the
same rules as MS-DOS for naming files, except that suffixes ( .xxx) are not
allowed.
. " / \ [ ] :
| < > + = ; ,
CON NUL
Uppercase and lowercase letters are treated the same. The string PLOTTER
is treated the same as the string plotter, for example. For this reason,
IBCONF maps all lowercase letters to uppercase.
Caution: In DOS, devices must not have the same names as files,
directories, or subdirectories. The MS-DOS GPIB device
driver uses the names GPIB0, GPIB1, GPIB2, GPIB3 and
DEV1, DEV2, DEV3 through DEV32. If you have files,
directories, or subdirectories with one these names, you must
rename them.
The string representing a device or access board name is the first variable
argument of the function ibfind called at the beginning of your
application program. Refer to Chapter 4, NI-488.2 Software Characteristics
and Routines, and Chapter 5, NI-488 Software Characteristics and
Functions, of the NI-488.2 Software Reference Manual for MS-DOS for
more explanations of ibfind.
(Dis)connect
Edit
board or device that you want to edit. To exit edit mode, use <F9> or
<Escape>.
When configuring a GPIB device driver, you can write a text version of the
driver to a disk file. Use <F2> to direct IBCONF to create a text file named
GPIB.TXT in the current directory. This file contains a description of the
current GPIB driver and should be used only for information purposes.
Note: All the devices in the system must be connected and powered on
before running Autoconfigure.
Exit
The lower level screens of IBCONF display the currently defined values for
characteristics of a device or board, such as addressing and timeout
information, as shown in Figure 5-2. You access these screens from the
upper level of IBCONF by selecting a board or device and pressing <F8> or
<Enter>. The configuration settings selected for each device and each
board are a means of customizing the communications and other options
used with that board or device. The settings for devices specify the
characteristics used by the access board for that device when device
functions are used. The settings for boards specify the characteristics used
when board functions are used.
• Change Characteristics
• Help
• Reset Value
• Return to Map
Change Characteristics
Help
Reset Value
Return to Map
At the lower level, <F9> or <Escape> returns you to the upper level device
map of IBCONF .
Default Configurations
The NI-488.2 software has factory default configurations. For example, the
default device names of the 32 GPIB devices are DEV1 through DEV32 .
You may want to change the names to more descriptive ones, such as
METER for a digital multimeter.
You can use IBCONF to look at the current default settings in the software
file.
If you do not use IBCONF to make changes to the NI-488.2 software, the
default configurations of the software remain in effect.
Default Values
The following are the default values of the NI-488.2 software.
• There are four access boards with symbolic names GPIB0, GPIB1,
GPIB2, and GPIB3. You cannot change access board names.
• The GPIB addresses of the first 16 devices are the same as the device
number. For example, DEV1 is at address 1. These devices are
assigned to the access board GPIB0.
• The END message is sent with the last byte of each data message to a
device. No End-of-String (EOS) character is recognized.
• The time limit on I/O and wait function calls is set for approximately
10 s.
Timeout Settings
The timeout value is the approximate minimum length of time that I/O
functions such as ibrd, ibwrt, and ibcmd can take before a timeout
occurs. It is also the length of time that the ibwait function waits for an
event before returning if the TIMO bit is set in the event mask. The default
option for this characteristic is 10sec.
EOS Byte
You can program some devices to terminate a read operation when a
selected character is detected. A linefeed character (hex 0A) is a common
EOS byte.
Note: The driver does not automatically append an EOS byte to the end
of data strings on write operations. You must explicitly include
this byte in your data string. The designation of the EOS byte is
only for the purpose of informing the driver of its value so that
I/O can terminate correctly.
There are other factors that may affect the choice of the T1 delay, although
they are unlikely to affect you. Refer to the ANSI/IEEE 488.2-1987
Standard, IEEE Standard Codes, Formats, Protocols, and Common
Commands, for more information about these other factors.
returns the error ENEB as soon as a program tries to access the board. The
default is yes for GPIB0 and no for all other GPIB boards.
* If you change these software settings, you must change your hardware
settings to match. Refer to Appendix A, Hardware Configuration, for
more information on changing these settings.
Exiting IBCONF
After you have made all your changes, you can exit IBCONF by pressing
<F9> or <Escape>. The program asks if you want to save the changes to
the disk before exiting. Typing a y (yes) response causes the changes to be
written to the file on disk.
Before exiting, the program checks for situations that can cause problems,
such as the following:
• Are GPIB boards not present in the host machine at the specified
address?
If any of these situations are found, you are notified and given the option of
re-entering or exiting IBCONF.
The default hardware settings for the GPIB-232CT-A are compatible with
the default software settings. If you change the hardware settings, make
sure that you also change the software settings so that they are compatible.
The DIP switch is used to configure the serial port parameters of the
GPIB -232CT-A while in S mode. In G mode, the GPIB-232CT-A is used to
interface an RS-232 device as a GPIB Talker/Listener.
Figure A-1 shows the factory default setting of the DIP switch. In
Figure A-1, the black side of the switch represents the position of the switch
handle.
S MODE
DATA FORMAT
BAUD RATE OFF
ON
GPIB ADDRESS
G MODE
Note: For the purpose of this explanation, the switches have been
assigned numbers as a point of reference. These numbers do
NOT appear on the GPIB-232CT-A itself. In this explanation,
the three switches labeled BAUD RATE are switches 1 through
3, the DATA FORMAT switches are switches 4 through 7, and
the S MODE switch is switch 8.
In Figure A-1, switches 1 through 3 are ON, OFF, and ON, respectively,
indicating that the serial port is operating at 9600 baud. Switches 4 and 5
are both OFF, which indicates that parity is disabled. Switch 6 is OFF,
indicating 1 stop bit/character. Switch 7 is ON, indicating that the
GPIB -232CT-A is using 8 bits per character for serial data transfers.
Switch 8 is OFF, indicating that the GPIB-232CT-A is operating in S mode.
Tables A-1 and A-2 show the possible configurations of the eight switches
and what each configuration indicates. The factory default settings are in
bold italics .
Switches
1 2 3 Indication
Characteristic Specification
Fuse Rating and Type 100-120 VAC 300 mA, UL/CSA approved or
220-240 VAC 500 mA, IEC approved
Characteristic Specification
Characteristic Specification
Characteristic Specification
Characteristic Specification
Weight 12 oz (340 g)
Characteristic Specification
Weight 7 oz (198 g)
If you still have problems after completing the steps in this appendix,
complete the appropriate forms in Appendix F, Customer Communication
and then contact National Instruments for technical support.
• Check the DIP switch settings on the GPIB-232CT-A. This DIP switch
selects the serial port configuration. Most applications require the
default setting, which is shown in Figure A-1. Refer to Appendix A,
Hardware Configuration, for information on setting the GPIB-232CT-A
configuration using this switch.
This appendix explains and gives examples of how to use the DLL Direct
Entry NI-488 functions and NI-488.2 routines to access the GPIB.DLL
file. Following the examples are tables that list all NI-488.2 routines and
NI-488 functions, including their calling syntax and ordinal entry values.
The DLL Direct Entry NI-488 functions and NI-488.2 routines can be used
to access the GPIB.DLL file from any language or programming
environment that runs under Windows and supports access to standard
Windows DLL functions. As with all functions exported by a DLL, these
functions conform to the PASCAL calling conventions. A few examples of
using these entry points follow. Tables D-1 and D-2 contain a complete list
of all of the entry points.
Example 1, accessing the GPIB.DLL file from Turbo Pascal for Windows:
(* First, import the DLL functions you plan to use. *)
(* or *)
BoardHandle% =
DLLibfind("GPIB0", ibsta%, iberr%, ibcntl&)
'or
Routine Syntax
(ordinal entry value)
Routine Syntax
(ordinal entry value)
(continues)
Routine Syntax
(ordinal entry value)
(continues)
Routine Syntax
(ordinal entry value)
Functions Syntax
(ordinal entry value)
Functions Syntax
(ordinal entry value)
(continues)
Functions Syntax
(ordinal entry value)
Functions Syntax
(ordinal entry value)
This appendix describes the RS-232 serial port on the GPIB-232CT-A and
explains how to interface a DCE or DTE serial device to the RS-232 serial
port.
DC Power Jack
(DC version only)
GPIB-232CT-A
RS-232 IEEE 488 Controller
ER
EN
Y
D
NATIONAL
K
W
Q
ST
EA
N
L
PO
SR
TA
AT
INSTRUMENTS
LI
R
Standard Standard
GPIB-232CT-A Signal to DTE to DCE DTE to DCE
DCE Serial Device Signal 9-pin 9-pin 9-pin 25-pin
RXD to RXD 2 to 2 2 to 3
TXD to TXD 3 to 3 3 to 2
DTR to DTR 4 to 4 4 to 20
GND to GND 5 to 5 5 to 7
RTS to RTS 7 to 7 7 to 4
CTS to CTS 8 to 8 8 to 5
Note: Connections in bold italics must be implemented.
Figure E-2 shows a properly configured 9-pin DTE to 9-pin DCE cable
including the hardware handshake lines RTS, CTS, and DTR. With this
configuration, the GPIB-232CT-A can function properly (handshake) on
buffer full conditions. Figure E-3 shows an equivalent 9-pin DTE to 25-pin
DCE cable configuration.
1 5
6 9
7 8
8 7
9 6
5 1
Figure E-2. Cable Configuration for 9-pin DTE to 9-pin DCE with
Handshaking
1
1
6 14
7 15
8 16
9 17
5 18
19
20
GPIB-232CT-A 8 21
9 22
9-pin DTE 10 23
11 24
12 25
13
Serial Device
25-pin DCE
Figure E-3. Cable Configuration for 9-pin DTE to 25-pin DCE with
Handshaking
The minimum configuration cable assumes that the DCE does not require
external hardware handshaking. The minimum configuration for a DTE
9-pin to DCE 9-pin cable is shown in Figure E-4. Figure E-5 shows an
equivalent 9-pin to 25-pin cable.
1 5
6 9
7 8
8 7
9 6
5 1
1 1
6 14
7 15
8 16
9 4 17
5 18
5 6
19
20
GPIB-232CT-A 8 21
9 22
9-pin DTE 10 23
11 24
12 25
13
Serial Device
25-pin DCE
Custom Cables
If your application requires a custom cable, you can construct one if you
have a thorough knowledge of the handshaking protocols involved. Review
the RS-232 characteristics of your serial device and build the cable to
properly connect the handshake lines of the two devices. Because the
DTE-to -DCE connection is a straight across connection, it often involves
only connecting RTS to RTS, CTS to CTS, DTR to DTR, and so on. If the
documentation for your serial device does not provide a thorough
explanation of its handshaking protocol, the ANSI/EIA-232-C standard is a
good reference, provided your device conforms to the RS-232 protocol.
Standard Standard
GPIB-232CT-A Signal to DTE to DTE DTE to DTE
DTE Serial Device Signal 9-pin 9-pin 9-pin 25-pin
RXD to TXD 2 to 3 2 to 2
TXD to RXD 3 to 2 3 to 3
DTR to DSR 4 to 6 4 to 6
GND to GND 5 to 5 5 to 7
RTS to CTS 7 to 8 7 to 5
CTS to RTS 8 to 7 8 to 4
Note: Connections in bold italics must be implemented.
Figure E-6 shows a typical 9-pin to 9-pin null modem cable with the RTS,
CTS, and DTR handshake lines implemented. Figure E-7 shows an
equivalent 9-pin DTE to 25-pin DTE cable configuration.
The cable configuration in Figure E-6 allows you to connect to the 9-pin
serial port of a personal computer. The cable in Figure E-7 shows how to
connect to the 25-pin serial port of a personal computer.
1 5
6 9
7 8
8 7
9 6
5 1
Figure E-6. Cable Configuration for 9-pin DTE to 9-pin DTE with
Handshaking
1 1
6 14
7 15
8 16
9 17
5 18
19
20
GPIB-232CT-A 8 21
9
9-pin DTE 10
22
23
11 24
12 25
13
Serial Device
25-pin DTE
Figure E-7. Cable Configuration for 9-pin DTE to 25-pin DTE with
Handshaking
• Use a minimum configuration null modem cable which does not support
the hardware handshake lines and use XON/XOFF software
handshaking (if necessary). To create a minimum configuration cable,
connect the signals shown in bold italics in Table E-3.
The minimum cable configuration assumes that the serial device does not
require external hardware handshaking. The minimum configuration for a
9-pin to 9-pin null modem cable is shown in Figure E-8. Figure E-9 shows
an equivalent 9-pin to 25-pin cable.
1 5
6 9
7 8
8 7
9 6
5 1
1 1
6 14
7 15
8 16
9 17
5 18
6 19
20
GPIB-232CT-A 8 21
9
9-pin DTE 10
22
23
11 24
12 25
13
Serial Device
25-pin DTE
Custom Cables
If your application requires a custom cable, you can construct one if you
have a thorough knowledge of the handshaking protocols involved. Review
the RS-232 characteristics of your serial device and build the cable to
properly connect the handshake lines of the two devices. If the
documentation for your serial device does not provide a thorough
explanation of its handshaking protocol, the ANSI/EIA-232-C standard is a
good reference, provided your device conforms to the RS-232 protocol.
Corporate Headquarters
(512) 795-8248
Technical support fax: (800) 328-2203
(512) 794-5678
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
National Instruments software product
Version
Configuration
(continues)
The problem is
PC
Other Products
• Computer Make and Model
• Type of Monitor
Documentation Comment Form
(continues)
If you find errors in the manual, please record the page numbers and
describe the errors.
Phone ( )
n- nano- 10-9
m- milli- 10-3
k- kilo- 103
M- mega- 106
° degrees
% percent
A amperes
AC alternating current
ANSI American National Standards Institute
ASCII American Standard Code for Information
Interchange
boot drive Refers to the drive your computer reads when
you power on or restart your computer
C Celsius
CIC Controller-in-Charge
CSA Canadian Standards Association
CTS Clear to Send
DAV Data Valid
destination directory Refers to the location on your hard disk where
you install the NI-488.2 software
DIP dual inline package
DLL dynamic link library
DTR Data Terminal Ready
ECIC Enable Controller-In-Charge
EDVR DOS error
EIA Electronic Industries Association
EMI electromagnetic interference
ENEB Nonexistent GPIB board
EOI end or identify