Text preview for : 77860A(KM488DD).pdf part of Keithley 77860A(KM488DD) Keithley Misc 77860A(KM488DD).pdf



Back to : 77860A(KM488DD).pdf | Home

KM-4881DD
IEEE-488 Interface Board




Keifhley MetraByte Corporation
A Subsidiary of Keithle Instruments, Inc.
440 Myles Jandish Boulevard
Taunton, Massachusetts 02780
Part Number: 24407

First Printing: June 1991




Copyright 0 1991


Keithley MetraB te Corporation
440 Myles Stan CT Boulevard
Ish
Taunton, Massachusetts 02780



WARNING
Keithley MetraByte Corporation assumes no liability for damages consequent to the use
of this product. This product is not designed with components of a level of reliability
suitable for use in life support or critical applications.
All rights reserved. No part of this ublication may be reproduced, stored in a retrieval
system, or transmitted, in any form Ey any means, electronic, mechanical, hotoco ing,
recording, or otherwise, without the express prior written permission of I?'
elthley RYetra-
Byte Corporation.
Information furnished by Keithley MetraByte Corporation is believed to be accurate and
reliable. However, no responsibility is assumed b MetraByte Corporation for its use; nor
atents or other rights oYthird parties which may result from its
by implication or otherwise under any patent rights of Keithley

Keithley MetraByte TMis a trademark of Keithley MetraByte Corporation.
BASICM ts a trademark of Dartmouth College.
IBM@ is a registered trademark of International Business Machines Corporation.
PC, XT, and AT@ are trademarks of International Business Machines Corporation.
Microsoft@ is a registered trademark of Microsoft Corporation.
TURBO" is a trademark of Borland International, Inc.
MOTE: This equipment has been tested and found to comply with the limits
br a Class B Digital Device, pursuant to Part 15 of the FCC Rules. These
imits are designed to provide reasonable protection against harmful inter-
:erence in a residential installation. This equipment generates, uses, and can
radiate radio frequency energy and, if not installed in accordance with the
nstructions, may cause harmful interference to radio communications.
Sowever, thereis no guarantee that interference will not occur in a particular
,nstallation. If this equipment does not cause harmful interference to radio
jr television reception, which can be determined by turning the equipment
,ff and on, the user is encouraged to try to correct the interference by one or
nore of the following measures:

. Reorient or relocate the receiving antenna

* Increase the separation between the equipment and receiver.

* Connect the equipment into an outlet on a circuit different
from that to which the receiver is connected.

. Consult the dealer or an experienced radio/tv technician
for help.


EK NOTE: Changes or modifications not expressly approved by the party
responsible for compliance could void the user's authority to operate this
equipment.


ce NOTE: Theuse of a non-shielded interface cable with the referenced device
is prohibited.




IV
CHAPTER 1
INTRODUCTION.. ...... ,.................... ................ ............... .. .. .. ..... .. .I -1
1.1 General Introduction ........................ ................ .............. ........ ................... ............. l-1
1.2 Programming Overview ............................................................................................1-2
; .i
115 Manual ................................................................... ...................... l-9
CHAPTER 2
INSTALLATION AND CONFIGURATION ............................ ........ .... ... ............ ........ 2-1
Part 1 -Hardware Installation
2.1 Unpacking and Ins ection ................................................................................ ....... .2-2
2.2 Jumpers and Switc Res................................................................................................2-3
2.3 Board Installation .......................................................................................................2-8
2.4 Multiple Board Installation Notes ..................... .......................................................2-10
Part 2 - Initial Software Installation and Configuration
2.5 Initial Software Installation and Configuration ............... ... .... .. ....... ... ... .......2-12
Part 3 - Driver Installation
2.6 Loading the KM-488-DD Driver from AUTOEXEC.BAT .............. ....... ........... .2-24
2.7 Loadin the KM-48%DD Driver from DOS .... .............. .... .. .................... .. ........2-26
2.8 Unloa cfmg the KM-488-DD Driver from DOS ..................................... .................. 2-27
Part 4 -Software Re-Configuration
CHAPTER 3
INTRODUCTION TO PROGRAMMING VIA THE FILE I/O COMMANDS ... .. ...3-1
3.1 The DOS File Interface .................................................. ....................................... ......3-1




3.8 Timeout ...............................................................................~........ .................... ...........3-9
.
3.9 Buffered ............................ ................................................................. ...........................3-9
3.10 Trigger ............... ...........................................................................................................3-10
3.11 Status and Spoll .......................................................................................................... 3-10
;:A; I..#&e~nI~teep't.. .3-l 1
.3-12
.......................................................................................................................................
.3-13
3.14 Request.. ......................................................................................................................
CHAPTER 4
USING THE FILE I/O COMMANDS
.4-l
4.1 In BASICA.. ................................................................................................................
4.2 Additional BASICA Routines.. ................................................................................ .4-4
..4-12
4.3 In QuickBASIC.. ........................................................................................................
4.4 In Microsoft PASCAL ................................................................................................ 4-15
4.5 In TURBO PASCAL.. ................................................................................................. .4-20
.4-25
4.6 In Microsoft C.. ...........................................................................................................
,431
4.7 InTURBOC.. ..............................................................................................................

CHAPTER 5
THE FILE I/O COMMANDS ......................................................................................... ....5-l
5.1 Command Description Format.. .............................................................................. .5-l
5.2 .5-2
The File I/O Commands.. ........................................................................................
CHAPTER 6
INTRODUCTION TO PROGRAMMING VIA THE CALL INTERFACE
6.1 Accessing the Call Interface.. ................................................................................... .6-l
6.2 GPIB Terminators ....................................................................................................... 6-2
6.3 KCONFIG.. ................................................................................................................. .6-3
6.4 Clear Devices.. ............................................................................................................ .6-4
6.5 Transmitting Data.. .................................................................................................... .6-3
6.6 Receiving Data.. ......................................................................................................... .6-3
6.7 6-4
KTO.. .............................................................................................................................
6.8 .6-4
KBUFD.. ......................................................................................................................
6.9 KTRIGGER.. ................................................................................................................ 6-4
6.10 KSTATUS and KSPOLL.. .......................................................................................... .6-4
ii:;; Li&tg;;;;dypF; :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;::::::::::::::::::::::::::::
f55;
.6-6
6.13 KREQUEST.. ...............................................................................................................
CHAPTER 7
USING THE CALL INTERFACE IN BASICA
7.1 .7-5
Description Format.. ..................................................................................................
CHAPTER 8
USING THE CALL INTERFACE IN QUICKBASIC
8.1 Description Format .................................................................................. ...................8-4




Vi
CHAPTER 9
USING THE CALL INTERFACE IN MICROSOFT PASCAL
9.1 Description Format ..................................................................... ............. ..................9-4
CHAPTER 10
USING THE CALL INTERFACE IN BASICA
10.1 Description Format ..................... .................................................... .......................... 10-4
CHAPTER 11
USING THE CALL INTERFACE IN C
11.1 Description Format ............................... ........................ .... ........... ........................ 11-3
CHAPTER 12
WARRANTY INFORMATION ...................................... .................. .. ......... .. ... ........... 12-l
12.1 Warranty ...... ................................................................................. .............................. 12-l
12.2 Return to Factory Information ............................................ ......... .. ... ......... ....... .12-l
APPENDIX A - ASCII EQUIVALENCE CHART
APPENDIX B - IEEE-488 TUTORIAL
APPENDIX C - IEEE MULTILINE COMMANDS
APPENDLX D - DEVICE CAPABILITY CODES
APPENDIX E - PRINTER AND SERIAL PORT RE-DIRECTION
APPENDIX F - THE CONFIG.DAT FILE
AI'PENDLX G - ERROR MESSAGES
SUMMARY OF CALLS
SUMMARY OF FILE I/O COMMANDS
GPIB SYSTEM CONFIGURATION WORKSHEET




Vii
LISTOF TABLES

Table l-l. Orderin Information .................................................................. ............ ....... l-9
Table 2-l. Default f umper and Switch Settings .................................. ............... ............2-4
Table 2-2. Wait States ............................................................................................... ...........2-6
Table 2-3. Default Terminator Sequences ............................ ........................ ......... 2-19
Table 2-4. Assigned DOS Devices .............................................. ..................... 2-23
Table 5-l. Lit of File I/O Commands .. ...... ........... ............................... ......... ... .... ..........5-2
Table 5-2. Status Strin .......................................................................... ............................. 5-52
Table 7-1. Default K hf -488-DD Operating Parameters ...... ........................ ..................7-3
;;;;&;;. ~~~ls'~~~~~~~~~~~~~~~~~~~~::~:::~ ::::;::::::::::::;:::::::::::::::::::::::::%;8
Table S-2: Status Strin ........................................................ .......................... ............. ........ 8-76
Table 9-1. Default K hk-488-DD Operating Parameters ................................................ .9-2
Table 9-2. Status Strln ................. .......................................... ......... ... ........... ............... . 9-75
Table 10-l. Default K -488-DD Operating Parameters ........................................ ....... 8-2
Table 10-2. Status Strin . .. ................... .................... ............... ... ... ... ............ . 8-78
Table 11-1 Default K -488-DD Operating Parameters ................................ ............... 11-2
Table 11-2: Stabs S~~~-~~-~-~.......................... .... . .
.......... 11-61

LISTOF FIGURES

Figure l-l. KM-488-DD Block Diagram.. ......................................................................... l-2
Figure l-2. File I/O Interface - Direct Output Path.. ...................................................... l-4
Figure l-3. File I/O Interface - Direct Input Path.. ......................................................... l-5
Figure l-4. File I/O Commands - Buffered Output Path.. ............................................ l-6
Figure l-7
l-5. Call Interface Path.. .........................................................................................
Figure 2-1. Location of Jumpers and Switches.. ............................................................. .2-3
Figure 2-2. Base Address Switch.. .....................................................................................2-4
Figure .2-5
2-3. Interru t Selection.. ........................................................................................
Figure .2-5
2-4. Base A z dress Selection.. ................................................................................
Figure 2-5. I/O Wait State Selections.. ............................................................................ .2-6
Figure 2-6. Interrupt Level Jumpers.. .............................................................................. .2-7
Figure 2-7. DMA Level Jumpers.. .................................................................................... .2-7
Figure 2-8. Clock Source Jumpers.. .2-S
Figure 2-9. Software Installation Screen.. .2-13
....................................................................................................................
Figure 2-10. Selecting Langua es...................................................................................... .2-13
Figure 2-11. Select Command 5 tyle .................................................................................. .2-15
Figure 2-12. Device Confi ration Screen.. ..................................................................... .2-15
Figure 2-13. Selecting the ?z rd Option.. .......................................................................... .2-16
Figure 2-14. Selecting the Default EOL and Bus Terminators.. .................................... .2-19
Figure 3-l. Terminators used with the File I/O Commands.. ..................................... .3-5




Viii
KM-488-DD Programming Guide Introduction




CHAPTER I
/NTRODUCT/ON

1.1 GENERAL INTRODUCTION
Keithley MetraByte's KM-488-DD is an IEEE-488 interface board which allows programs
written on an IBM@ PC/XT/AT/386~ or IBM ES2 models 2S/30 to communicate with the
IEEE-488 bus. The KM-488-DD conforms to the 1978 IEEE-488 (GPIB) standard and thus, is
compatible with other IEEE-488 products currently offered by many other manufacturers.
Up to fourteen other devices may be connected to the IEEE-488 bus, including instruments,
printers, and other computers.

The KM-488-DD's design includes a Wait State Generator to adjust the bus timing. This
allows the KM-488-DD to perform within the operating specifications of the GPIB controller
chip, even on the fastest 386 or 486-based PC's, The KM-488-DD can also be configured to
generate interrupts on any of 6 interrupt request lines and DMA transfers on channels 1,2,
or 3. Figure l-l provides a functional block diagram of the KM-488.DD.

Keithley MetraByte's software allows the KM-488-DD to be accessed either through the use
of the File I/O Commands or from the Call Interface, both of which can be used in programs
written in QuickBASIc?, BASICA, MicrosofP C, TURBOTMC, TURBOTM PASCAL, and
MicrosofP PASCAL. The KM-488-DD is also compatible with a variety of third-party soft-
ware packages, such as Keithley Asyst's Asystant GPIB.




l-l
Introduction KM-488-DD Programming Guide




Figure l-l. KM-488-DD Block Diagram


1.2 PROGRAMMING OVERVIEW
Keithley MetraByte's driver for the KM-488-DD is a Terminate and Stay Resident driver
which provides a means of transferring data between your application program and the
GPIB bus. Once the driver is installed, the application program can access it either through
the DOS file facility or directly by program calls.

Programs which must be optimized for GPIB throughput should employ the CALL inter-
face. If throughput is not a consideration then the choice between the CALL interface and
the FILE interface is a matter of personal preference.

Programmers familiar with using file I/O (Opening files and transferring data between the
program and files) may be more comfortable with the FILE interface. The File I/O Com-
mand interface tends to distance the programmer a bit more from the "mechanics" of the
GPIB bus than the CALL interface. Programming can be as simple as writing strings to a
file opened for output or reading strings from a file opened for input. The File I/O Com-
mands are "English-Language" like representations of the GPIB commands. Through the
use of the CONFIG program, you can create series of facts about a particular GPIB device
(i.e., bus address and terminators) and refer to it as a Named Device through the File I/O



1-2
KM-488-DD Programming Guide Introduction



Command Interface. For example, the GPIB address 12 could have the name "SCOPE",
which when used implies the GPIB address 12 and whatever terminators were associated
with "SCOPE".

With the exception of the fact that Named Devices cannot be referred to directly through the
CALL interface, for most of the File I/O Commands there is an a CALL which performs an
equivalent function.

The following two sections are provided for those who wish to know a bit about how the
driver functions. You do not have to read these sections in order to employ the driver.
Most of what is described occurs automatically without the programmeis knowledge.
FILE l/O COMMAND INTERFACE
To employ the File I/O Command Interface, the programmer will use the facilities of
his/her particular programming language to open a file for outputting to the driver and a
file for inputting from the driver.

Driver Commands/Direct Data Output

Transfers between the application program and the GLIB bus will be initiated by the appli-
cation program sending a command to the driver. Commands take the form of character
strings which are written to the driver output file opened through DOS (Groups of
commands and also data may be placed in one string; but the maximum string length is 255
characters.). This has the effect of calling DOS with a "Write to Device" request as shown in
Figure 1-2. DOS moves the character string one character at a time from the application pro-
gram into the command parser of the KM-48%DD device driver. DOS must make two calls
to the driver for each character that is transferred. This command transfer process is
relatively time consuming.

Once the command is in the driver parser, the driver must interpret the command and jump
to a particular set of code within the driver which will carry out the appropriate function.

If the command is to output data to the GPIB bus, the data can be included in the string
along with the command and follows the same path as the command through DOS. The
amount of data than can be sent in this manner is limited by the string length and must also
pass through DOS character by character. The one exception is the "OUTPUT DEVICE;
data" command in which data can consists of an infinite number of characters. OUTPUT's
of this type are halted when the EOL character sequence is encountered in the data stream
of characters.




l-3
Introduction KM-488-DD Programming Guide




Direct Data Entry

To return information from the driver, the application program sends a command to the
driver requesting data in the manner described above and then initiates an input from the
driver. For example, the returned data may pertain to the status of the driver or be
obtained from the GPIB bus. In either case, the data is buffered in the driver awaiting an
INPUT action.

To bring the data into the application program, the program does an input from the file that
was opened for driver input as shown in Figure l-3. This amounts to employing the DOS
"read from device" request and data will be returned in the same manner as it was sent,
character by character. It is important to input data resulting from a command before issu-
ing a second command which will return data. Otherwise, a driver error will occur.




1-4
KM-488-DD Programming Guide Introduction




DATA




- +y SPIT




Figure 13. File I/O Interface - Direct Input Path

BufferecVDMA Dafa l/O

The amount of data that can be transferred by Direct I/O is limited (except in the case of
"OUTPUT 05; data" and the transfer mechanism is relatively slow. Both these deficiencies
can be overcome by using buffered transfers. In this case, the command sent to the driver
contains information about the location in memory where data will sent to/received from
the GPIB bus. Once set up, the data will move directly between the program memory and
the GPIB bus via the KM-488-DD's hardware. Figure 1-4 illustrates the case of data send. A
data entry would appear similar with the data passing through an ENTER routine in the
opposite direction.

In normal buffered transfers, the driver transfers the data between memory and the GPIB
bus via the KM-488-DD's hardware. The PC's DMA facility can be used to make a buffered
transfer. Although buffered transfers are generally faster, there will be some overhead in
setting them up so direct transfers are probably just as efficient if only small amounts of
data are involved. All transfers through the CALL interface are buffered.




1-5
Introduction KM-488-DD Programming Guide




Figure 1-4. File I/O Commands -Buffered Output Path




To employ the CALL interface, the programmer uses the call facility of his/her particular
programming language. Typically, a Keithley MetraByte provided library(ies) or loadable
module is incorporated when building the application with a supported language. Appro-
priate batch files are provided to assist in remaking these libraries/modules.

When a call is made, the appropriate parameters contained in the call are placed on the cal-
ler's stack for use by the driver and the program enters the code of the interface module as
diagrammed in Figure 1-5. The interface module for the particular language verifies that
the driver is installed and jumps directly to the driver command code which performs the
desired function. The amount of time required to get to the driver command code from the
application by means of the call interface is much less than that by means of the file inter-
face.

If data is to be transferred, then the call parameters include addresses of location(s) in pro-
gram memory where the data is to be found and/or sent. As opposed to the File I/O Com-
mand Interface, the Call Interface always uses the faster buffered transfers (with or without
DMA).




l-6
KM-488-DD Programming Guide




m-
Figure l-5. Call Interface Path


1.3 SPECIFICATIONS
Specifications for the KM-488-DD are as follows:

Dimensions: One Short PC Slot size

Weight: .29 lb.

Data Transfer Rate:' > 300 KB per second

IEEE Controller Chip: NEC @`D7210

Power Consumption: < 650 mA

Operating Temperature: O'to50"C

Storage Temperature: -2o'to +7O"C

Humidity: 0 to 90% non-condensing


tGovemed by the slowest device on the GPIB bus.


1-7
Introduction KM-488-DD Programming Guide



Wait States: Switch Selectable
1,2,3 or 4

I/O BaseAddress: Switch Selectable
&HO2El, &H22El, &H42El, or &H62El

DMA Capability: Switch Selectable
Channels 1,2, or 3 shareable

Interrupt (IRQ) Address: Switch Selectable
Levels 2 through 7

Device Interface Capabilities SHl, AHI, T6, TEO, L4, LEO, SRI, Pl'O, RLO, DCl, DTl, CO,
Supported El 12,

Controller Subsets: Cl, C2, C3, C4, and Cl0
Terminator: Software Selectable characters and/or EOI


1.4 ORDERING INFORMATION
Table l-l provides additional ordering information, in the event that you need additional
KM-488-DD's or appropriate cables.




1-8
KM-488-DD Programmlng Guide Introduction



Table l-l. Ordering Information
Part Number Description
KM-488-DD Includes the KM-488-DD IEEE-488 Interface Board, Software (on
5.25" disks), and appropriate documentation.

KM-488-DD/3.5 Includes the KM-488-DD IEEE-488 Interface Board, Software (on
3.5" disks), and appropriate documentation.

KM-488-DD-BRD Includes the KM-488-DD IEEE-488 Interface Board and appropri-
ate documentation.

CGPIB-1 1 meter IEEE-488 cable.

CGPIB-2 2 meter IEEE-488 cable.

CGPIB-4 4 meter IEEE-488 cable.



1.5 HOW TO USE THISMANUAL
This manual provides you with the information necessary to install and program the KM-
488-DD. It assumes you are familiar with the language in which you are developing your
application program. It also assumes that you are familiar with the GLIB protocol.

Chapter 2, "Installation and Configuration", provides all the necessary information for you
to get the KM-488-DD "up and running". It details how to unpack, inspect, and install the
KM-488-DD. It also describes how to install and configure the software. Jumper and switch
setting information is provided in case you should need to change the factory-selected
defaults.

Chapters 3 through 5 describe the use of the File I/O Command Interface. Chapter 3 pro-
vides introductory information. Chapter 4 describes how to implement the commands in
each supported language: BASICA, QuickBASIC, C, Microsoft PASCAL, and TURBO
PASCAL. Chapter 5 describes each command in detail.

Chapters 6 through 11 described the use of the Call Interface. Chapter 6 provides introduc-
tory information. Chapters 7 through 11 provide a detailed description of each routine and
how it is called from each of the languages supported: BASICA, QuickBASIC, C, Microsoft
PASCAL, and TURBO PASCAL.


l-9
Introduction KM-488-DD Programming Guide



Chapter 12, "Warranty Information", describes Keithley MetraByte's warranty and gives
instructions for returning the board to the factory.

The appendices contain additional useful information. Appendix A contains an ASCII
Equivalence Chart. This gives hexadecimal and decimal equivalents for the ASCII 128 Char-
acter Set. Appendix B is an IEEE-488 tutorial. Appendices C and D contain supplementary
information to the IEEE-488 tutorial (Device Capability Identification Codes and IEEE
Multiline Commands). Appendix E describes how to use the KM-488-DD Printer and COM
Port Re-Director. Appendix F describes the CONFIG.DAT file. Appendix G lists and
describes the Error Messages.




l-10
KM-488-DD Programming Guide Software Installation and
Configuratlon




CHAPTER 2
INSTALLATION AND CONFIGURATION



This chapter outlines all of the steps necessary to get your KM-488-DD "up and running".
The chapter is broken up into four parts;

. PCS'/I - Hardware Insfcrlloti~n. This section describes how to unpack and inspect the
KM-488-DD, set its jumpers and switches, and install the KM-488-DD board(s).

. Part 2 - Initial SofTware Installation and Configuration. This section describes those
procedures which are to be used the first time you install and configure the KM-
488-DD software.

. Par/ 3 - Driver insfallafion. Once you have configured the software, you will need to
load the driver software before you can use the KM-488-DD. This section describes
how to load the driver from your AUTOEXECBAT file or manually from the DOS
prompt.

. Parf 4 - Soffware Re-Conllgumtion. Thii section describes how to change your sys-
tem configuration once it has already been made.

Once you have installed the KM-488-DD and configured the software, you may want to run
the HEEECMD.BAS program. This program will allow you to send Fine I/O Commands
and see the results. Note, however, that this program can only be run in a single board
set-up. To run this program, make sure that BASICA is installed and from the DOS prompt,
type: BASICA KIEEECMD.




2-l
Software Installation and KM-488-DD Programming Guide
Configuration




PART 1 - HARDWARE INSTALLATION

Before you can use your new KM-488-DD board you must unpack and install it correctly.
To do this, follow these steps:

. Unpack and inspect the KM-4&I-DD. This seems like a trivial step; however it is cru-
cial that your board be unpacked correctly. This information is described in section
2.1.

. Set the Jumpers andSwitches on the KM-488-DD. This step is unnecessary if you elect
to use the factory selected defaults shown in Table 2-1. If you want to change any of
these settings, consult section 2.2.

. lnsfa// the KM-488-DD. The KM-488-DD is installed in the same manner as any other
peripheral board. If you are unfamiliar with this process, follow the instructions in
section 2.3.

If you are installing multiple KM-488-DD's in the same GPIB system, be sure to read Section
2.4, Multiple Board Installation Notes.
2.1 UNPACKlNG AND INSPECTION
Confirm that each item on the packing list has been shipped. It is a good idea to retain the
outer packing material in the event that the board must be returned to the factory for repair.

1. Then, if you haven't already done so, unpack the board down to its anti-static
packaging.

2. Hold the board (in its anti-static bag) in one hand. Place the other hand firmly on a
metal portion of the system chassis. This procedure eliminates static electricity
build-up, thus preventing any possible damage to the board.

3. After allowing a moment for static electricity discharge, carefully unwrap the board
from the anti-static material.

4. Inspect the board for any possible shipping damage. If any sign of damage is detected,
return the board to the factory as described in section 12.2.

You are now ready to set the jumpers and switches on the KM-488-DD.

2-2
KM-488-DD User's Manual Software installation and
Configuration



2.2 JUMPERSAND SWITCHES
The KM-488-DD contains one DIP switch, two 12-pin jumper banks, and a single 3-pin
jumper. The locations of these are shown ln Figure 2-1. The Base Address switch controls
the base address, interrupt address, and wait states. The jumper banks are used to select the
interrupt level and DMA Channel to be used. The single jumper is used to select the source
of the master clock signal. The default switch and jumper selections are listed in Table 2-1.




Figure 2-l. Location of Iumpers and Switches

A program, IJCTALL.EXE, Is provided to assist you with setting the switches and jumpers.
To run the INSTALL program:

1. Insert Disk #1 "Installation and Setup" into your computer's floppy drive.

2. Then, change the directory and from the DOS prompt, type:

INSTXUA

It is a good idea to record all switch and jumper selections on the GPIB System Configura-
tion Worksheet found in the rear of this manual.




2-3
Software lnstallatlon and KM-4tWDD Programming Guide
Configuration



Table 2-1. Default Jumper and Switch Settings
Switch/Jumper Default
Base Address Switch (Sl)
Base Address OZEl hex
Interrupt Address 02F7 hex
I/O Wait States 1

Interrupt Level 02) 7

DMA Channel 03) 1

Clock (J4, 8 MHz. On-board



Switches
There is only one switch on the KM-488-DD board. This is the Base Address Switch.
Remember to record your switch selections on the GPIB System Configuration Worksheet
found in the rear of this manual.

The Base Address Switch 611 is a 7-slide,
DIP switch. When a rocker is moved to the
ON position, this sends the signal low (logical
0). The 7 slide switches are used to select the
Base Address, Interrupt Address, and I/O
Wait States.
Figure 2-2. BaseAddress Switch


hferrupf Address. Switches 1,2, and 3 (IO, 11, and I2) are used to select the Interrupt
Response Level Address. This is the address to which the interrupting device must write




2-4
KM-488-DD User's Manual Software Installation and
Configuration



to be reset. The address is 02F.r, where x is
the interrupt level, from 2 to 7. The default OCR
selection is 7. To make another choice, confi- 4
gure the slide switches as shown in Figure
2-3. These switches only need to be set if the ~zy
KM-488-DD is used with software other than
that provided.




Figure 2-3. Interrupt Selection


Base Address. Switches 4 and 5 (A14 and A13) set the address used by the computer to
communicate with the IEEE Controller Chip on the board.
Available base addresses (in hex) are: 02E1,
22E1,42El, and 62E1. The default base Tib Qj
address is 02El. To select another base
address, move the switches to the positions
shown in Figure 2-4. ot, *Et
irzFml,,




Figure 2-4. BaseAddress Selection

f/O Wail States. The KM-488-DD is designed with a switch-selectable wait state generator.
Selectable wait states are provided to insure optimum performance and reliable operation at
the differing bus clocks found in personal computers. The default number of wait states (1)
should be correct for most personal computers. However, if you get garbled data or your
program crashes, you may need to adjust the number of wait states. Some general guide-
lines are presented in Table 2-2. The number of wait states is selected


2-5
Sofhvare lnstallatlon and KM-488-DD Programming Guide
Conflguratlon



by setting switches 6 and 7 (marked WS1 and
WS2) on the DIP switch. You can select one,
two, three, or four wait states. The default
number of wait states is 1. To select a differ-
ent number, set the switches to one of the
positions shown in Figure 2-5.



zVIA" 1WA"
STATES
BTITES
Figure 2-5. I/O Wait State Selections

Table 2-2. Wait States
Bus Clock Frequency Number of Wait States
15h4Hz. 1 fdefault)
5 MHz < freqj 8 MHz.
8 MHz < freq < 10 MHz. ;
10 MHz < freq. 4

Jumpers
There are two jumper blocks and a single 3-pin jumper on the KM-488-DD. These are used
to select the Interrupt Level, DMA Level, and the Clock Source. Remember to record your
jumper selections on the GPIB System Configuration Worksheet found in the rear of this
manual.


lnferrupf Level. If you are using third-partysoftware, note that the KM-488.DD is capable
of interrupting the PC under some circumstances. The interrupt level jumper 02) defines
the interrupt level to be used. Valid interrupt levels (2 through 7) and the jumper positions
used are shown in Figure 2-6.

Be certain that the same Interrupt Level and the Interrupt Response Level (See Base Address
Switch.) are selected. If you are programming the KM-488-DD with Keithley MetraByte's
KM-488-DD driver software, note that this software does not support these interrupts.
Thus, you should place the interrupt level jumper in the disabled position.




2-6
KM-488-DD User's Manual Software Installation and
Configuration




Figure 2-6. Interrupt Level Jumpers

DMA Level. DMA (Direct Memory Access) can be used to/from transfer data quickly
from/to a peripheral to the computer. The PC has four DMA channels of which one or
three may be selected. However, based on your system configuration they may not all be
available. Select an appropriate DMA level using the DMA Level Jumpers. Refer to Figure
2-7 for jumper positions.




8 : i :
i3 8
of.443 of.44
OlsmLEO
CHANNEL
Figure 2-7. DMA Level lumpers




2-7
Software Installation and KMd&DD Programming Guide
Configuration



Clock Source. The IEEE bus interface circuitry on the KM-488DD board requires a master
clock signal. This clock is normally connected to an on-board 8 MHz clock
oscillator. You can, however, elect to drive
this circuitry from the PC's clock. Be aware IpB
IUrn. au8
that the clock speed will vary according to the IWFIULT)
model of computer used. To select the clock
source, place the jumper block between the
appropriate pins. See Figure 2-8.

Figure 2-8. Clock Source Jumper

ns NOTE: The BUS position may be required by certain third party software
uackatxes.

2.3 BOARD lNSTALL4TlON
This section provides general instructions for installing the KM-488-DD Board in an IBM
PC/XT/AT/286/386 or compatible. Some things, such as removing the computer's cover,
are machine-dependent. Consult the documentation provided with your computer, if nec-
essary.



WARNING



DO NOT ATTEMPT TO INSERT OR REMOVE ANY ADAmER BOARD WITH THE
COMPUTER POWER ON! THIS COULD CAUSE DAMAGE TO THE COMPUTER!




To install the KM-488-DD Board:

1. Turn the power to the PC and all attached options OFF.


2. Unplug the power cords of all attached options from the electrical outlets. Then, make
a note of where all the device cables are attached to the rear of the system unit. Discon-
nect the cables.

2-8
KM-488-DD User's Manual Software Installation and
Configuration



3. Remove the cover of the PC. To do this, first remove the cover mounting screws on the
rear panel of the computer. Then, slide the cover of the computer about 3/4 of the way
forward. Tilt the cover upwards to remove.


4. Choose an available option slot. Loosen and remove the screw at the top of the blank
adapter plate. Then slide the plate up and out to remove.


5. Hold the KM-488-DD (in its anti-static bag) in one hand. With the & hand, touch
any metallic part of the PC/AT cabinet. This will safely discharge any static electricity
which has built-up in your body. Unwrap the KM-488-DD from the anti-static bag.


6. If you haven't already done so, set the switches and jumpers as described in section 2.4.


7. Align the gold edge connector with the edge socket and the back adapter plate with the
adapter plate screw opening. Gently press the board downward into the socket. Re
install the adapter plate screw.


8. Replace the computer's cover. Tilt the front of the cover up and slide it onto the sys-
tem's base, making sure the sides of the cover are under the rail along the sides of the
frame. Install the mounting screws.


9. Plug in all cords and cables. Turn the power to the computer back on.




2-9
Sofhvare Installation and KM-408-DD Programming Guide
Configuration



2.4 MULTIPLEBOARD INSTALLATION NOTES
When installing multiple KM-488-DD in the same GPIB system, be sure to:

. Assign a different Base Address to each KM-488-DD

. Assign a different Interrupt Level to each KM-488-DD, if required by your software

. Assign a different DMA Level to each KM-488-DD, if required by your software




2-10
KM-488-DD User's Manual Software Installation and
Configuration




PART 2 - INITIAL SOFTWAREINSTALLATION AND CONFIGURATION

The first time you install the KM-488-DD software and configure your KM-488-DD system,
you will run the SETUP batch file. Subsequent configurations are performed in a different
manner as described in Part 4 -Reconfiguring the Software.

Before you install the software, you will need to determine the following:

Which programming style ore you going to use? Decide whether you want to
develop your applications program using the File I/O Commands or Call Interface. If
absolutely necessary, you can write your program using both interfaces. If you are
having trouble deciding which programming style to use, refer to the Programming
Overview in section 1.2 and glance through the reference chapters for each program-
ming style.

Also, know which language(s) you will be developing your programs in.

Do you wont fo be able fo refer to example programs? A full selection of exam-
ple programs for each language and programming style is provided.

Will you need to recompile the lnterfoce Modules? If so, you may want to access
the batch files which will do thii for you automatically. These are considered source
files.

What kinds of termlnotors do you wonf to use? A discussion of terminator types is
provided in Chapters 3 (for the File I/O Commands) and 6 (for the Call Interface).
You may want to read these sections prior to configuring your system.

/f you ore programming v/o the File l/O Commonds, do you want to use
Named Devices? Named devices are discussed in Chapter 3. If you want to use
named devices, it is a good idea to determine what instruments will be part of your
system before you begin the SETUP program.

Have ready the GPIB System Configuration Worksheet before you begin the configuration
process. This worksheet can be found in the rear of this manual.




2-l 1
Software Installation and KM-488-DD Programming Guide
Configuration



2.5 INITIAL KM-488-DD SOFTWAREINSTALLATION AND CONFIGURATION -
Follow the procedure outlined in this section if you are installing the KM-488-DD software
for the first time. (NOTE: If you have already installed the software and simply need to
change its parameters, see Part 4-Reconfiguring the Software.)

To begin, insert the KM-488-DD Installation and Setup Disk into the floppy disk drive on
your computer. Then:

1. If necessary, return to the DOS prompt. This will look something like:

c:\

2. Change the directory to the drive containing the disk. In most instances, this will be
disk drive A: or B:. Thus, at the DOS prompt type:

A: - for the A: drive

or

B : - for the B: drive

3. Now, type:

SETUP


The SETUP program will now run. This program allows you to copy the KM-488-DD
software to your computer's hard drive, configure the KM-488DD(s), select default
terminators, and configure the other devices in your GPIB System.



1 - Copying the Software to fhe Hard Drive
The first step in the SETUP program is to copy the KM-488-DD software to your hard
drive. This software consists of the KM-488DD driver and language support files.
(A complete list of the files comprising the KM-488-DD software can be found in the
FILESDOC file on the KM-488-DD Utility/Driver disk.) The SETUP program
prompts you for the necessary information by displaying the screen shown in Figure
2-9.



2-12
KM-48%DD User's Manual Software Installation and
Configuration




Figure 2-9. Software Installation Screen

At any time, if you wish to abort from the Software Installation Screen, move the
highlight to EXIT. Select ABORT.

Select the Language(s). The first step is to select the language(s) which
you are going to develop your application programs in. Choice of lan-
guages include: C, Microsoft PASCAL, TURBO PASCAL, BASICA, and
QuickBASIC. Any combination of languages may be chosen. You must
indicate whether or not you want language support for each language
listed. To select/unselect a language:

l Move the highlight to the language desired. (Use @ or @I or press
@iiJ.)

. Use the @ or @ keys to select a YES or NO response. An example
is shown in Figure 2-10.




Figure 2-10. Selecting LunguageW




2-13
Software Installation and KM-488-DD Programmlng Guide
Configuration



Choose the Destincrflon. Next, you will need to tell the SETUP program
which drive to copy the KM-488-DD software from and where to put the
software on your hard drive. The default path is C : \KM488DD. You can
elect to use thii path or select another. To select a different one, type a
new pathname in typical DOS format, i.e., (drive):\(main
directory)\(sub-directory). The directory does not have to already exist
on your hard drive. The SETUP program will create the directory for
you.

Note that when the SETUP program copies the KM-488-DD software to
your hard drive, it will automatically create the necessary sub-directories.
For example, if you elected to copy the C support files and the example
programs, the tree structure that would be created would look like this:




At this time, you will also need to indicate whether or not you want the
Example Programs and Source Programs copied. There are example pro-
grams available for each language using both the File I/O Commands
and the Call Interface. The Source Programs consist of batch files which
can be used to produce executable versions of the example programs.
The example and source programs are further described in the file
FILESDOC.

.%/t?Ct frogfcYmm/ng Sty/e. Next, you need to instruct the SETUP pro-
gram that you will be programming via the File I/O Commands, the Call
Interface, or both. To do this:

. Move the highlight to File I/O Commands. (Use @ or @ or press
[Enterl.)

. Use the @ or @ keys to select a YES or NO response. Repeat this
procedure for Call Interface. Your selections will look something
like Figure 2-l 1.




2-14
KM-488-DD User's Manual Software Installation and
Configuration




Figure 2-l 1. Select Command Style

Exit and COPY. If you want to discontinue or abort from the software
copying procedure, at EXIT select ABORT. Otherwise, review your
selections:

l If they are all correct, select COPY. The program will prompt you to
insert the required disks.

l If your selections are incorrect, return to the selection and alter your
choice. Then, return to EXIT, select COPY, and follow the instructions.

Once the disk copying process has been completed, SETUP will advance
to the Device Configuration Screen.




Figure 2-12. Device Configuration Screen

In this part of the initial software installation process, you will configure the "devices"
which are part of your GPIB application. These devices include the KM-488-DD
board(s) and other GPIB instruments such as meters, scopes, and plotters. The config-
uration parameters needed vary according to your application and whether you are
conflgurlng a KM-488-DD or a GPIB instrument. Note that the parameters selected
must agree with the actual board switch and jumper settings.


2-15
Software lnstallatlon and KM-488-DD Programming Guide
Configuration



For every KM-488-DD installed (you can have up to 4), you must assign it a CPU Base
Address, a GPIB Address, and select various operating parameters. If you are using
the File I/O Command Interface, you also have the option of setting other GPIB
devices as named devices. This means that for every device you can assign it a name, a
GPIB address, and the Bus terminators which it will recognize. The use of named
devices is especially helpful in applications where you have many devices which rec-
ognize different terminator sequences.

A GPIB System Configuration Worksheet is provided in the rear of this manual. You
may find it helpful to keep track of your system configuration. If you have more
devices than there are spaces allocated, simply photocopy the rear side of the work-
sheet.

Once you have completed your System Configuration, you will need to save the
parameters to the CONFIG.DAT file. This file is read into the KM-488-DD driver. The
CONFIG.DAT file is described in more detail in Appendix F.


2 - Configuring the KM-488-DD(s)
The first step is to configure the KM-488-DD(s). Note that bypassing the configuration
forces the KM-488-DD to work with the default settings. To do this, use the @ and @
keys to highlight the CONFIGURE option at the top of the System Configuration
Screen. Then, select CARD. The Card Configuration section of the screen will be
highlighted. (See Figure 2-13.)




Figure 2-13. Selecting the Card Option

Keys Used Within the System Conliguration Screen

The keys listed below have the following general functions. Note that these functions
may change according to the option being configured. Be sure to watch the listing at
the bottom of the System Configuration Screen.

Q&l Changes the highlighted choice.
Q Moves to the next selection.
0 Moves to the previous selection.


2-16
KM-488-DD User's Manual Software Installation and
Configuration



IEnter] Takes action or moves on to the next selection.

If You Cannot Remember Your Switch/Jumper Settings. Refer to your GPIB SYS-
tern Configuration Worksheet.

Adding Board Structures. w have multiole KM-488-DDs, you will
need to add board structures. This is accomplished by moving the cursor
to the Card1 option and pressing f&l.

You are now ready to begin configuring your KM-488-DDfs).


Select the Board fo be Configured. If YOUhave mulQleKM-488-DD&
you will need to select the board to be configured. Move the cursor to the
list of boards, using the cursor keys. Then press @ or @ to move the
highlight to the board to be configured.

Select a Buse Address. The KM-488-DD can be assigned any one of
four base addresses: 02El hex, 22El hex, 42El hex, and 62El hex. The
default base address is 02El hex. To select a different base address:

. Press @I to move to the CPU Base Address option. If the base
address displayed conflicts with (is also assigned to) another KM-
488-DD, it will appear in red.

. Press @ or @I to toggle through the list of valid base addresses.

. Press @Zl or @I to select a base address and advance to the Pri-
mary Address option..

Assign a GPIB PrimarY Address. The KM-488.DD must be assigned a
unique GI'IB Primary Address in the range 00 to 30. To define the GPIB
Primary Address, enter each digit separately. Then, press m.

Enable/D/sable Llghtpen Inferrupfs. It is possible for lightpen interrupts
to occur under certain conditions. However, the Lightpen option must be
enabled for this to occur. Choose enable or disable by pressing the @ or
@I keys. Then press m or @ to advance to the DMA Level option.




2-17
Software Installation and KM-488-DD Programming Guide
Configuration



Select a DMA Level. The KM-488-DD must be assigned one of the fol-
lowing DMA Levels: 0, 1, 23, or none. If the DMA level selected conflicts
with that assigned to another board, it will be displayed in red. To select
an DMA level, toggle through the options by pressing &I. When you
reach the desired value, press (Enterlor @I to select the value and advance
to the Mode option.

Choose a GPlB Operating Mode. The KM-488-DD is capable of acting
as either a Controller (System) or a Peripheral (non-System Controller).
You must indicate which function the KM-488-DD is to perform. Toggle
through the selections by pressing @I or Q. At the appropriate selection,
press Isntcr)or @I to select the mode and advance to the CPU Clock
option.

Select a CPU Clock Speed. The IEEE bus interface circuitry on the
KM-488-DD board requires a master clock signal. This clock is normally
connected to an on-board 8 MHz clock oscillator. You can, however, elect
to drive this circuitry from the PC's clock. The actual clock speed will
vary according to the model of computer used. The CPU Clock option is
used to select the clock speed. (Remember that source of the clock is
selected by Jumper J4. See section 2.2.) Clock speeds range between 1
MHz. and 8 MHz.

To select the clock speed:

. Press @ or @ to toggle through the list of valid clock speeds. Note
that if the clock source is the on-board clock, you must select 8.

. Press IEnter) @I to select the clock speed and advance to the
or
Device Timeout option.

Set o Device Timeout. This parameter sets the maximum amount of
time (in milliseconds) which is to elapse before a Device Timeout Error
occurs. The default value is 10 seconds. Valid Timeouts range from .l to
65535.9 seconds. A timeout value of 0.0 will disable timeout checking.

To change the value, enter each digit separately. Then, press [Enters.

Be sure to specify all of the above parameters for each KM-488-DD board.



2-18
KM-488-DD User's Manual Software lnstallatlon and
Configuration



3 - Choosing the Default Termlnatofs
Next, you will need to select the default terminator sequences to be used. To begin,
use the @I and @I keys to select the TERMINATORS option from the CONFIGURE
menu. The Default EOL and Bus Terminators section of the screen will be highlighted.
(See Figure 2-14.)




The KM-488-DD driver recognizes two types of terminator sequences: Bus Termina-
tors and EOL Terminators. The Bus Terminators are used to delimit data transmitted
between the KM-488-DD driver and the GPlB Bus. The EOL terminators mark the end
of a character string which ls being transferred between your application program and
the KM-488-DD driver. The KM-488-DD driver then replaces these EOL terminators
with a GPIB Bus Terminator sequence when communicating with the GPIB bus
devices. m.ws are only used bv the File I/O Commands, (See Chapter 3
for more information.) The default terminators are listed in Table 2-3.

Table 2-3. Default Terminator Seauences