Text preview for : 77160C(DAS1800).pdf part of Keithley 77160C(DAS1800) Keithley DAS 77160C(DAS1800).pdf



Back to : 77160C(DAS1800).pdf | Home

DAS-1800Series
FunctionCall Driver
User's Guide
Warranty

Hardware
Keithley Instruments, Inc. warrants that, for a period of one (1) year from
the date of shipment (2 years for Model 199 and 3 years for Models 2000,
2001, 2002, and 2010), the Keithley Hardware product will be free from
defects in materials or workmanship. This warranty will be honored
provided the defect has not been caused by use of the Keithley Hardware
not in accordance with the instructions for the product. This warranty
shall be null and void upon: (1) any modification of Keithley Hardware
that is made by other than Keithley and not approved in writing by
Keithley or (2) operation of the Keithley Hardware outside of the
environmental specifications therefore.
Upon receiving notification of a defect in the Keithley Hardware during
the warranty period, Keithley will, at its option, either repair or replace
such Keithley Hardware. During the first ninety days of the warranty
period, Keithley will, at its option, supply the necessary on site labor to
return the product to the condition prior to the notification of a defect.
Failure to notify Keithley of a defect during the warranty shall relieve
Keithley of its obligations and liabilities under this warranty.

Other Hardware
The portion of the product that is not manufactured by Keithley (Other
Hardware) shall not be covered by this warranty, and Keithley shall have
no duty of obligation to enforce any manufacturers' warranties on behalf
of the customer. On those other manufacturers' products that Keithley
purchases for resale, Keithley shall have no duty of obligation to enforce
any manufacturers' warranties on behalf of the customer.
Software
Keithley warrants that for a period of one (I) year from date of shipment
(2 years for Model 199 and 3 years for Models 2000,2001,2002, and
2010), the Keithley produced portion of the software or firmware
(Keithley Software) will conform in all material respects with the
published specifications provided such Keithley Software is used on the
product for which it is intended and otherwise in accordance with the
instructions therefore. Keithley does not warrant that operation of the
Keithley Software will be uninterrupted or error-free and/or that the
Keithley Software will be adequate for the customer's intended
application and/or use. This warranty shall be null and void upon any
modification of the Keithley Software that is made by other than Keithley
and not approved in writing by Keithley.
If Keithley receives notification of a Keithley Software nonconformity
that is covered by this warranty during the warranty period, Keithley will
review the conditions described in such notice. Such notice must state the
published specification(s) to which the Keithley Software fails to conform
and the manner in which the Keithley Software fails to conform to such
published specification(s) with sufficient specificity to permit Keithley to
correct such nonconformity. If Keithley determines that the Keithley
Software does not conform with the published specifications, Keithley
will, at its option, provide either the programming services necessary to
correct such nonconformity or develop a program change to bypass such
nonconformity in the Keithley Software. Failure to notify Keithley of a
nonconformity during the warranty shall relieve Keithley of its
obligations and liabilities under this warranty.

Other Software
OEM software that is not produced by Keithley (Other Software) shall not
be covered by this warranty, and Keithley shall have no duty or obligation
to enforce any OEM's warranties on behalf of the customer.

Other Items
Keithley warrants the following items for 90 days from the date of
shipment: probes, cables, rechargeable batteries, diskettes, and
documentation.
Items not Covered under Warranty
This warranty does not apply to fuses, non-rechargeable batteries,
damage from battery leakage, or problems arising from normal wear or
failure to follow instructions.

Limitation of Warranty
This warranty does not apply to defects resulting from product
modification made by Purchaser without Keithley's express written
consent, or by misuse of any product or part.

Disclaimer of Warranties
EXCEPT FOR THE EXPRESS WARRANTIES ABOVE KEITHLEY
DISCLAIMS ALL OTHER WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. KEITHLEY DISCLAIMS ALL
WARRANTIES WITH RESPECT TO THE OTHER HARDWARE AND
OTHER SOFTWARE.

Limitation of Liability
KEITHLEY INSTRUMENTS SHALL IN NO EVENT, REGARDLESS
OF CAUSE, ASSUME RESPONSIBILITY FOR OR BE LIABLE FOR:
(I) ECONOMICAL, INCIDENTAL, CONSEQUENTIAL, INDIRECT,
SPECIAL, PUNITIVE OR EXEMPLARY DAMAGES, WHETHER
CLAIMED UNDER CONTRACT, TORT OR ANY OTHER LEGAL
THEORY, (2) LOSS OF OR DAMAGE TO THE CUSTOMER'S DATA
OR PROGRAMMING, OR (3) PENALTIES OR PENALTY CLAUSES
OF ANY DESCRIPTION OR INDEMNIFICATION OF THE
CUSTOMER OR OTHERS FOR COSTS, DAMAGES, OR EXPENSES
RELATED TO THE GOODS OR SERVICES PROVIDED UNDER
THIS WARRANTY.
DAS-1800 Series
Function Call Driver
User's Guide




01997, Keithley Instruments, Inc.
All rights reserved.
Cleveland, Ohio, U.S.A.
Third Printing, August 1997
Document Number: 77160 Rev. C
Worldwide Addresses
Keithley Instruments, Inc. ITALY
28775 Aurora Road Keithley Instruments SRL
Clewland, Ohio 44139 Vialc S. Gimignano 38
(440) 248.0400 20146 Milano
Fax: (440) 24X-6168 39-2-4X30300X
http://www,keithley.com Fax: 39-2-48302274

CHINA NETHERLANDS
Keithley Instruments China Keithley Instruments BV
Yuan Chen Xin Building, Room 705 Avelingen West 49
No. 12Yumin Road, Dewei, Madian 4202 MS Gorinchem
Beijing, China 100029 31-(0)1X3-635333
8610.2022856 Fax: 31.(0)183-630X21
Fax: 8610.2022892
SWITZERLAND
FRANCE Keithley Instruments SA
Keithley Instruments SARL Kriesbachstrasse 4
BP 60 8600 Diibendorf
3 all&c des Garays 41-I-8219444
91122 Palaiseau C&da Fax: 41-I-8203081
31-6-0115155
Fax: 31-6-0117726 TAIWAN
Keithley Instruments Taiwan
GERMANY I, Ming-Yu First Street
Keithley Instruments GmbH Hsinchu. Taiwan, R.O.C.
Landsbergcr SwaRc 65 8X6-35-778462
821 IO Garnering Fax: 8X6-35-778455
49-89-849307-0
Fax: 49-89-84930759

GREAT BRITAIN
Keithley Instruments, Ltd.
The Minster
58 Portman Road
Reading, Berkshire RG30 IEA
44-01734-575666
Fax: 44-01734-596469
Manual Print History

The print history shown below lists the printing dates of all Revisions and Addenda created for
this manual. The Revision Level letter increases alphabetically as the manual undergoes
subsequent updates. Addenda, which are released between Revisions, contain important
change information that the user should incorporate immediately into the manual. Addenda
are numbered sequentially. When a new Revision is created, all Addenda associated with the
previous Revision of the manual are incorporated into the new Revision of the manual. Each
new Revision includes a revised copy of this print history page.

Revision B (Document Number 77160
Revision C (Document Number 77160
Safety Precautions

The following safety precautions should be observed before using this
product and any associated instrumentation. Although some instruments
and accessories would normally be used with non-hazardous voltages,
there are situations where hazardous conditions may be present.

This product is intended for use by qualified personnel who recognize
shock hazards and are familiar with the safety precautions required to
avoid possible injury. Read the operating information carefully before
using the product.

The types of product users are:

Responsible body is the individual or group responsible for the use and
maintenance of equipment, and for ensuring that operators are adequately
trained.

Operators use the product for its intended function. They must be trained
in electrical safety procedures and proper use of the instrument. They
must be protected from electric shock and contact with hazardous live
circuits.

Maintenance personnel perform routine procedures on the product to
keep it operating, for example, setting the line voltage or replacing
consumable materials. Maintenance procedures are described in the
manual. The procedures explicitly state if the operator may perform them
Otherwise, they should be performed only by service personnel.

Service personnel are trained to work on live circuits, and perform safe
installations and repairs of products. Only properly trained service
personnel may perform installation and service procedures.
Exercise extreme caution when a shock hazard is present. Lethal voltage
may be present on cable connector jacks or test fixtures. The American
National Standards Institute (ANSI) states that a shock hazard exists
when voltage levels greater than 30V RMS, 42.4V peak, or 60VDC are
present. A good safety practice is to expect that hazardous voltage is
present in any unknown circuit before measuring.

Users of this product must be protected from electric shock at all times.
The responsible body must ensure that users are prevented access and/or
insulated from every connection point. In some cases, connections must
be exposed to potential human contact. Product users in these
circumstances must be trained to protect themselves from the risk of
electric shock. If the circuit is capable of operating at or above 1000 volts,
no conductive part of the circuit may be exposed.

As described in the International Electrotechnical Commission (IEC)
Standard IEC 664, digital multimeter measuring circuits (e.g., Keithley
Models 175A, 199, 2000, 2001,2002, and 2010) measuring circuits are
Installation Category II. All other instruments' signal terminals are
Installation Category I and must not be connected to mains.

Do not connect switching cards directly to unlimited power circuits. They
are intended to be used with impedance limited sources. NEVER connect
switching cards directly to AC mains. When connecting sources to
switching cards, install protective devices to limit fault current and
voltage to the card.

Before operating an instrument, make sure the line cord is connected to a
properly grounded power receptacle. Inspect the connecting cables, test
leads, and jumpers for possible wear, cracks, or breaks before each use.

For maximum safety, do not touch the product, test cables, or any other
instruments while power is applied to the circuit under test. ALWAYS
remove power from the entire test system and discharge any capacitors
before: connecting or disconnecting cables or jumpers, installing or
removing switching cards, or making internal changes, such as installing
or removing jumpers.

Do not touch any object that could provide a current path to the common
side of the circuit under test or power line (earth) ground. Always make
measurements with dry hands while standing on a dry, insulated surface
capable of withstanding the voltage being measured.
Do not exceed the maximum signal levels of the instruments and
accessories, as defined in the specifications and operating information,
and as shown on the instrument or test fixture panels, or switching card

When fuses are used in a product, replace with same type and rating for
continued protection against fire hazard.

Chassis connections most only be used as shield connections for
measuring circuits, NOT as safety earth ground connections.

If you are using a test fixture, keep the lid closed while power is applied to
the device under test, Safe operation requires the use of a lid interlock.

If a @screw is present, connect it to safety earth ground using the wire
recommended in the user documentation.

The A symbol on an instrument indicates that the user should refer to
the operating instructions located in the manual.

The A symbol on an instrument shows that it can source or measure
1000 volts or more, including the combined effect of normal and common
mode voltages, Use standard safety precautions to avoid personal contact
with these voltages.

The WARNING heading in a manual explains dangers that might result
in personal injury or death. Always read the associated information very
carefully before performing the indicated procedure.

The CAUTION heading in a manual explains hazards that could damage
the instrument. Such damage may invalidate the warranty.

Instrumentation and accessories shall not be connected to humans.

Before performing any maintenance, disconnect the line cord and all test
cables,

To maintain protection from electric shock and fire, replacement
components in mains circuits, including the power transformer, test leads,
and input jacks, must be purchased from Keithley Instruments. Standard
fuses, with applicable national safety approvals, may be used if the rating
and type are the same. Other components that are not safety related may
be purchased from other suppliers as long as they are equivalent to the
original component, (Note that selected parts should be purchased only
through Keithley Instruments to maintain accuracy and functionality of
the product.) If you are unsure about the applicability of a replacement
component, call a Keithley Instruments office for information.

To clean the instrument, use a damp cloth or mild, water based cleaner.
Clean the exterior of the instrument only. Do not apply cleaner directly to
the instrument or allow liquids to enter or spill on the instrument.
The information contained in this manual is believed to be accurate and reliable. Howcvcr, Kcithley
Instruments, Inc., assumes no responsibility for its use or for any infringements of patents or other rights
of third parties that may result from its USC. license is granted by implication or otherwise under any
No
patent rights of Keithlcy Instruments, Inc.

KEITHLEY INSTRUMENTS, INC., SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES RELATED 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.

Rcfcr to your Keithley Instruments license agreement and Conditions of Sale document for specific
warranty and liability information.

Keithley is a trademark of Keithley Instruments, Inc. All other brand and product names art! trademarks
or registered trademarks of their respective companies.

0 Copyright Keithley Instruments, Inc., 1991, 1993, 1994.

All rights reserved. Reproduction or adaptation of any part of this documentation beyond that permitted
by Section I17 of the 1976 United States Copyright Act without permission of the Copyright owner is
unlawful.




Keithley Instruments, Inc.
28775 Aurora Road Cleveland, OH 44139
Telephone: (440) 248-0400. FAX: (440) 248-6168
Table of Contents
Preface

1 Getting Started
Technical Support ..................................... 1-4

2 Available Operations
System Operations. .................................. .2-l
Initializing the Driver .............................. .2-2
Initializing a Board ................................ .2-2
Retrieving Revision Levels. ......................... .2-4
Handling Errors. .................................. .2-4
Analog Input Operations .............................. .2-4
Operation Modes. ................................. .2-5
Memory Allocation and Management. ................. .2-6
Gains............................................2- 9
Channels........................................2-10
Specifying Channels When Using EXP- I800 Expansion
Boards (DAS- IEOOSTIHR Series Only). ........... .2-l I
Acquiring Samples from a Single Channel .......... ,2- I3
Acquiring Samples from a Group of Consecutive
Channels.....................................2-I 3
Acquiring Samples Using a Channel-Gain Queue. .... .2-14
Conversion Modes. ............................. .,.2-l 5
ClockSources....................................2-15
PacerClock....................................2-16
Burst Mode Conversion Clock. ................... ,2-l 7
Buffering Modes ................................. .2- I8
Triggers.........................................2-19
TriggerSources ............................... .2-19
Internal Trigger ............................. ,2- 19
Analog Trigger ............................. .2-20
Digital Trigger, .. .......................... .2-22
Post-Trigger Acquisition ........................ .2-23
Pre-Trigger Acquisition ......................... .2-24
About-Trigger Acquisition. ...................... .2-25
Hardware Gates, ...... .......................... .2-25
Analog Output Operations (DA.%I SOOHCSeries Only). .... .2-26
toe Page iv Monday, April 11, 1994 9:50 AM




Operation Modes. ................ ...... ..... .2-21
Memory Allocation and Management ...... ..... .2-27
Channels ....................... ...... .... ..2-2 8
Clock Source. ................... ...... .... ..2-2 9
Buffering Modes. ................ ...... .... ..2-3 0
Digital I/O Operations ............... ...... .... ..2-3 1
Operation Modes. ................ ...... .... ..2-3 1
Memory Allocation and Management ...... ..... .2-33
Digital Input Channel ............. ...... .... ..2-3 4
Digital Output Channel. ........... ...... .... ..2-3 5
Clock Source. ................... ...... .... ..2-3 6
Buffering Modes. ................ ...... .... ..2-3 8

3 Programming with the Function Call Driver
How the Driver Works. ............................... .3-l
Programming Overview. ............................. .3-10
Preliminary Tasks. .................................. .3-11
Operation-Specific Programming Tasks .................. 3-l 1
Analog Input Operations. ........................ .,.3-l 1
Single Mode. ................................. .3-12
Interrupt Mode. ............................... .3-12
DMAMode...................................3-15
Analog Output Operations (DAS-1800HC Series Only) 3-18
Single Mode .................................. .3-18
Interrupt Mode. ............................... .3-18
Digital I/O Operations. ............................ .3-20
Single Mode. ................................. ,3-20
Interrupt Mode. ............................... .3-21
Language-Specific Programming Information ............ ,3-22
C/Ci+ Languages ............................... ..3-2 3
Allocating and Assigning Dynamically Allocated
Memory Buffers ............................ .3-23
Single Memory Buffer ....................... .3-23
Multiple Memory Buffers. .................... .3-N
Accessing the Data .......................... .3-25
Dimensioning and Assigning Local Arrays. ......... ,3-25
Single Array .............................. ..3-2 6
Multiple Arrays. ............................ .3-26
Creating a Channel-Gain Queue .................. .3-27
Programming in Microsoft C/C++. ................ .3-28
Programming in Borland C/C++ .................. .3-29
Programming in Microsoft QuickC for Windows ...... 3-30

iv
+b raft3.toc Page v Monday, April 11, 1994 9:50 AM




Programming in Microsoft Visual C++ ............. .3-31
Pascal Languages ................................ .3-31
Allocating and Assigning Dynamically Allocated
Memory Buffers ............................ ,3-32
Reducing the Memory Heap. .................. .3-32
Single Memory Buffer ....................... .3-33
Multiple Memory Buffers. .................... .3-34
Accessing the Data .......................... .3-35
Dimensioning and Assigning Local Arrays. ......... .3-35
Single Array .............................. ..3-3 6
Multiple Arrays. ............................ .3-36
Creating a Channel-Gain Queue .................. .3-37
Programming in Borland Turbo Pascal (for DOS). .... .3-38
Programming in Borland Turbo Pascal for Windows .. .3-39
Microsoft Visual Basic for Windows ................. .3-40
Allocating and Assigning Dynamically Allocated
Memory Buffers ............................ .3-40
Single Memory Buffer ....................... .3-40
Multiple Memory Buffers. .................... ,3-41
Accessing the Data .......................... .3-42
Dimensioning and Assigning Local Arrays. ......... .3-42
+b Single Array ...............................
Multiple Arrays. ............................
.3-42
.3-43
Creating a Channel-Gain Queue .................. ,344
Programming in Microsoft Visual Basic for Windows .3-45
BASIC Languages. ............................... ,3-46
Allocating and Assigning Dynamically Allocated
Memory Buffers ............................ .3-46
Reducing the Memory Heap. .................. .3-46
Single Memory Buffer ....................... .3-46
Multiple Memory Buffers. .................... .3-47
Accessing the Data .......................... .3-48
Dimensioning and Assigning Local Arrays. ......... .3-48
Single Array ............................... .3-49
Multiple Arrays ............................. .3-49
Creating a Channel-Gain Queue .................. .3-50
Programming in Microsoft QuickBasic (Version 4.0). .3-51
Programmhtg in Microsoft QuickBasic (Version 4.5). .3-52
Programming in Microsoft Professional Basic
(Version 7.0) .............................. ..3-5 3
Programming in Microsoft Visual Basic for DOS. .... .3-55
aft3.toc Page vi Monday, April 11, 1994 9:50 AM




4 Function Reference
DAS1800-DevOpen ......... . ..4-8
DAS1800~GetDevHandle. .... ..4-11
K_ADRead. ................ ..4-14
K-ButListAdd .............. ..4-17
K-BtdListReset ............. ..4-21
K-ClearFrame .............. ..4-23
K-CloseDriver. ............. ..4-25
K-ClrAboutTrig. ............ ..4-27
K-ClrADFreeRun ........... ,.4-29
K~ClrContRun. ............. ..4-31
K-DASDevInit ............. ..4-33
KDAWrite ................ ..4-35
K-DIRead ................. ..4-38
K-DMAAlloc .............. ..4-41
K-DMAFree ............... ..4-45
K-DMAStart ............... ..4-47
K-DMAStatus .............. ..4-49
K-DMAStop ............... ..4-53
K_DOWrite ................ ..4-56
K-ForntatChnGAry .......... ..4-59
K_FreeDevHandle ........... ..4-61
K-FreeFrame ............... ..4-63
K-GetAboutTrig ............ ..4-65
K-GetADCommonMode. . ..4-67
K-GetADConfig ............ ..4-69
K-GetADFrame. ............ ..4-71
K-GetADFreeRun ........... ..4-73
KGetADMode ............. ..4-76
K-GetADTrig .............. ..4-78
KGetBuf. ................. ..4-82
K_GetBurstTicks ............ ..4-85
K-GetChn ................. ..4-88
KGetChnGAry ............. ..4-91
K_GetClk. ................. ..4-93
K-GetClkRate .............. ..4-96
K-GetCoutRun ............. ..4-99
K-GetDAFrame. ............ .4-102
K-GetDevHandle. ........... .4-105
K-GetDIFratne ............. .4-107
K-GetDITrig ............... .4-110
K-GetDOCurVal ............ .4-113
raft3.toc Page vii Monday, April 11, 1994 9:50 AM




K-GetDOFrame ................................... .4-116
K-GetErrMsg ..................................... .4-119
K-GetExtClkEdge ................................. .4-121
KGetG.. ...................................... ..4-124
K-GetGatc. ...................................... .4-126
K-GetSheWer. ................................... .4-129
K_GetSSH........................................4-13 2
KGetStartStopChn. ............................... .4-135
K-GetStartStopG .................................. .4-138
K-GetTrig ....................................... .4-142
K-GetTrigHyst .................................... .4-145
K_GetVer.........................................4-14 8
K_lntAloc........................................4-15 1
K-IntFree. ....................................... .4-154
K-IntStart. ....................................... .4-156
K-IntStatus ...................................... .4-158
K-IntStop. ....................................... .4- 162
KMakeDMABuf .................................. .4- 165
K-MoveArrayToBuf ............................... .4- 167
K-MoveButToArray ............................... .4-169
K-OpenDriver .................................... .4-171
K-RestoreChnGAry ................................ .4-174
K-SetAboutTrig. .................................. .4-176
K~SetADCommonMode ............................ .4-179
K_Seu\DConfig....................................4-18 1
K-SetADFreeRun ................................. .4- 183
K-SetADMode .................................. ..4-18 5
K-SetADTrig. .................................... .4-187
KSetBuf.........................................4-19 1
K-SetBufI.. .................................... ..4-19 4
K-SetBurstTicks .................................. .4-196
K_SetChn.........................................4-19 8
K_SetChnGAry....................................4-20 1
K_SetClk.........................................4-2 .
K-SetClkRate .................................... .4-207
K_SetContRun.....................................4-210
KSetDITrig.......................................4-212
K-SetDMABuf ................................... .4-215
K-SetExtClkEdge ................................. .4-218
K_SetG...........................................4-22 0
K_SetGate........................................4-22 2
K-SetSSH.. .................................... ..4-2 24


vii
4 II
raft3.toc Page viii Monday, April 11, 1994 9:50 AM




K-SetStartStopChn ............................. .4-226
K-SetStartStopG ............................... .4-230
K-SetTrig ..................................... .4-233
K-SetTrigHyst ................................. .4-236

A Error/Status Codes

B Data Formats
Converting Raw Counts to Voltage ................. .B-1
Converting Voltage to Raw Counts ................. .B-3
Specifying an Analog Output Value
(DAS-1800HC Series only). ................. .B-3
Specifying au Analog Trigger Level. ............. .B-4
Specifying a Hysteresis Value. .................. .B-5



Index

List of Figures
Figure 2-1. Example of Logical Channel Assignments . ..2-12
Figure 2-2. Trigger Events for Analog Triggers .. . . ,2-20
Figure 2-3. Using a Hysteresis Value. . .2-22
Figure 2-4. Trigger Events For Digital Triggers .2-23
Figure 2-5. Digital Input Bits. . .. . . .. .2-34
Figure 2-6. Digital Output Bits. . . . . . . . . . . . . . . . .2-35
Figure 3-1. Single-Mode Function. .3-2
Figure 3-2. Interrupt-Mode Operation .3-3
1
+I+
raft3 tot Page ix Monday, April 11.1994 9:50 AM




List of Tables
Table 2- 1. Supported Operations .2-l
Table 2-2. Analog Input Ranges. .2- 10
Table 3-l. A/D Frame Elements. .3-5
Table 3-2. D/A Frame Elements. .3-7
Table 3-3. DI Frame Elements .3-8
Table 3-4. DO Frame Elements .3-9
Table 3-5. Setup Functions for Interrupt-Mode
Analog Input Operations. .3-13
Table 3-6. Setup Functions for DMA-Mode
Analog Input Operations. .3-16
Table 3-7. Setup Functions for Interrupt-Mode
Analog Output Operations. .3- 19
Table 3-8. Setup Functions for Interrupt-Mode
Digital Input and Digital Output Operations. .3-21
Table 4- 1. Functions................................4-2
Table 4-2. Data Type Prefixes .. .4-7
Table A-l. Error/Status Codes.. .. A-l
Table B-l. Span Values For Data Conversion Equations . . .B-2




ix
tot Page x Monday, April 11, 1994 9:50 AM
& reface frm Page xi Monday, April 11, 1994 9:54 AM




Preface
The DAS-I800 Series Function Cull Driver User's Guide describes how
to write application programs for DAS- 1800 Series boards using the
DAS-1800 Series Function Call Driver. The DAS-1800 Series Function
Call Driver supports the following DOS-based languages:
. Microsoft@ QuickBasic" (Versions 4.0 and 4.5)
. Microsoft Professional Basic (Version 7.0 and higher)
. Microsoft Visual Basicm for DOS (Version 1.0)
. Microsoft C/C++ (Version 4.0 and higher)
. Borland' C/C++ (Version 1.0 and higher)
l Borland Turbo Pascal@for DOS (Version 6.0 and higher)

The DAS-1800 Series Function Call Driver also supports the following
WindowsTM-based languages:
. Microsoft Visual Basic for Windows (Version 1.0 and higher)
. Microsoft Quick@ for Windows (Version 1.0)
. Microsoft Visual C++TM(Version 1.0)
. Borland Turbo Pascal for Windows (Version 1.0 and higher)




xi
4 reface.frm Page xii Monday, April 11, 1994 9:54 AM




The manual is intended for application programmers using a DAS-1800
Series board in an IBM" PC AT@ or compatible computer. It is assumed
that users have read the user's guide for their board to familiarize
themselves with the board's features, and that they have completed the
appropriate hardware installation and configuration. It is also assumed
that users are experienced in programming in their selected language and
that they are familiar with data acquisition principles.

The DAS-1800 Series Fun&n Call Driver User's Guide is organized as
follows:
Chapter I contains the information needed to install the DAS- 1800
Series Function Call Driver and to get help.
Chapter 2 contains the background information needed to use the
functions included in the DAS-1800 Series Function Call Driver.
Chapter 3 contains programming guidelines and language-specific
information related to using the DAS-1800 Series Function Call
Driver.
Chapter 4 contains detailed descriptions of the DAS-1800 Series
Function Call Driver functions, arranged in alphabetical order.

4 Appendix A contains a list of the error codes returned by DAS-1800
Series Function Call Driver functions.
Appendix B contains instructions for converting raw counts to
voltage and for converting voltage to raw counts.

An index completes this manual.

Keep the following conventions in mind as you use this manual:
l References to DAS-1800 Series boards apply to all members of the
DAS-1800 family. When a feature applies to a particular board, that
board's name is used.
. References to BASIC apply to all DOS-based BASIC languages
(Microsoft QuickBasic, Microsoft Professional Basic, and Microsoft
Visual Basic for DOS). When a feature applies to a specific language,
the complete language name is used. References to Visual Basic for
Windows apply to Microsoft Visual Basic for Windows.
. Keyboard keys are enclosed in square brackets ([I).




xii




4 4
4 thapOlL.frm Page 1 Monday, April 11, 1994 9:54 AM




Getting Started

The DAS-1800 Series Function Call Driver is a library of data acquisition
and control functions (referred to as the Function Call Driver or FCD
functions). It is part of the following two software packages:
. DAS-1800 standard software package - This is the software
package that is shipped with DAS- 1800 Series boards; it includes the
followhlg:
- Libraries of FCD functions for Microsoft QuickBasic, Microsoft
Professional Basic, and Microsoft Visual Basic for DOS.
- Support files, containing such program elements as function

4 prototypes and definitions of variable types, which are required
by the FCD functions. 4
Utility programs, running under DOS, that allow you to
configure, calibrate, and test the functions of DAS-1800 Series
boards.
- Language-specific example programs.
. ASO- software package -This is the Advanced Software
Option for DAS-1800 Series boards. You purchase the ASO-
software package separately from the board; it includes the following:
Libraries of FCD functions for Microsoft C/C++, Borland
C/C++, and Borland Turbo Pascal.
- Dynamic Link Libraries (DLLs) of FCD functions for Microsoft
Visual Basic for Windows, Microsoft QuickC for Windows,
Microsoft Visual C++, and Borland Turbo Pascal for Windows.
- Support files, containing program elements, such as function
prototypes and definitions of variable types, that are required by
the FCD functions.



l-l




4 4
Utility programs, running under DOS and Windows, that allow
you to configure, calibrate, and test the functions of DAS- I800
Series boards.
- Language-specific example programs.

Before you use the Function Call Driver, make sure that you have
installed the software, set up the board, and created a configuration file
using the setup and installation procedures described in Chapter 3 of the
user's guide for your DAS-1800 Series board.

If you need help installing or using the DAS-I 800 Series Function Call
Driver, call your local sales office or the Keithley Instruments, Inc.
Applications Engineering Department at:

(440) 248-1520
Monday - Friday, S:OOA.M. - 6:OOP.M.,Eastern Time




1-2 Getting Started
.frm Page 3 Monday, April II,1994 954 AM




An applications engineer will help you diagnose and resolve yam
problem over the telephone. Please make sure that you have the following
information available before you call:



DAS-1800ST/HR Model
Series Board Serial #
Configuration Revision code
Base address setting
Interrupt level setting
Number of channels
Input (S.E. or Diff.)
Mode (uni. or hip.)
DMA chax(s)
Number of SSH-8s
Number of EXPs.

Computer Manufacturer
CPU type
Clock speed (MHz)
KB of RAM
Video system
BIOS type
Operating System DOS version
Windows version
Windows mode

Software package Name
Serial #
Version
Invoice/Order #

Compiler Language
(if applicable) Manufacturer
Version
Accessories




-.



1-3
Technical Support

Before returning any equipment for repair, call Keithley Instruments, Inc.,
for technical support at:
(440) 248-1520
Monday - Friday, 8:00 A.M. - 6:OOP.M., Eastern Time

An applications engineer will help you diagnose and resolve your
problem over the telephone.

If a telephone resolution is not possible, the applications engineer will
issue you a Return Material Authorization (RMA) number and ask you to
return the equipment. Include the RMA number with any documentation
regarding the equipment.

When returning equipment for repair, include the following information:
. Your name, address, and telephone number
. The invoice or order number and date of equipment purchase.
. A description of the problem or its symptoms.
. The RMA number on the outside of the package

Repackage the equipment using the original anti-static wrapping, if
possible, and handle it with ground protection. Ship the equipment to:
ATTN: RMA #
Repair Department
Keithley Instruments, Inc.
31300 Bainbridge Road
Cleveland, OH 44139

Telephone (440) 248-1520
FAX (440) 248-6168


Note: If you are submitting your equipment for repair under warranty,
you must include the invoice number and date of purchase.

To enable. Keithley Instruments, Inc., to respond as quickly as possible,
you must include the RMA number on the outside of the package.


Getting Started
& -
hap02 .frm Page 1 Monday, April 11,1994 9:55 AM




2
Available Operations

This chapter contains the background information you need to use the
FCD functions to perform operations on DAS- 1800 Series boards. The
supported operations are listed in Table 2-1.


Table 2-1. Supported Operations
Operation Page Reference
System page z- 1




System Operations

This section describes the miscellaneous operations and general
maintenance operations that apply to DAS-1800 Series boards and to the
DAS-1800 Series Function Call Driver. It includes information on
initializing a driver, initializing a board, retrieving revision levels, and
handling errors.




2-l
+B
hap02-.frm Page 2 Monday, April 11, 1994 955 AM




Initializing the Driver
Before you can use any of the functions included in the DAS-1800 Series
Function Call Driver, you must initialize the driver using one of the
following driver initialization functions:

. Board-specific driver initialization function - If you want to
initialize the DAS-1800 Series Function Call Driver only, use the
board-specific driver initialization function DAN800 DevOpen.
You specify a configuration file; DASlSOO~DevOpe~initializes the
driver according to the configuration file you specify.

. Generic driver initialization function - If you want to initialize
several different Keithley DAS Function Call Drivers from the same
application program, use the generic driver initialization function
K-OpenDriver. You specify the Keithley DAS board you are using,
the configuration file that defines this particular use of the driver, and
the driver handle (a name that uniquely identifies the particular use of
the driver). You can specify a maximum of 30 driver handles for all
the Keithley DAS boards accessed from your application program.

If a particular use of a driver is no longer required and you want to
free some memory or if you have used all 30 driver handles, you can
use the K-CloseDriver function to free a driver handle and close the
associated use of the driver.

If the driver handle you free is the last driver handle specified for a
Function Call Driver, the driver is shut down. (For Windows-based
languages only, the DLLs associated with the Function Call Driver
are shut down and unloaded from memory.)


Initializing a Board
The DAS- 1800 Series Function Call Driver supports up to three boards.
You must use a board initialization function to specify the board(s) you
want to use and the name you want to use to identify each board; this
name is called the board handle. Board handles allow you to
communicate with more than one board. You use the board handle you
specify in the board initialization function in all subsequent function calls
related to the board.



2-2 Available Operations
+b
hap02_.frm Page 3 Monday, April 11, 1994 9:55 AM




The DAS-1800 Series Function Call Driver provides the following board
initialization functions:

. Board-specific board initialization function - If you want to
initialize a DAS-1800 Series board only, use the board-specific board
initialization function DAS1800-GetDevHandle.

. Generic board initialization function - If you want to initialize
several different Keithley DAS boards from the same application
program, use the generic board initialization function
K-GetDevHandle. You can specify a maximum of 30 board handles
for all the Keithley DAS boards accessed from your application
program.

If a board is no longer being used and you want to free some memory
or if you have used all 30 board handles, you can use the
K-FreeDevHandle function to free a board handle.

To reinitialize a board during an operation, use the K-DASDevInit
function, which performs the following tasks:

. Abort all operations currently in progress that are associated with the
+b board identified by the board handle.

l Verify that the board identified by the board handle is the board
specified in the configuration file.




2-3
43 hap02-.frm Page 4 Monday, April 11,1994 9:55 AM




Retrieving Revision Levels
If you are using functions from different Keitbley DAS Function Call
Drivers in the same application program or if you are having problems
with your application program, you may want to verify which versions of
the Function Call Driver, Keithley DAS Driver Specification, and
Keithley DAS Shell are installed on your board. The K-GetVer function
allows you to get both the revision number of the DAS-1800 Series
Function Call Driver and the revision number of the Keithley DAS Driver
Specification to which the driver conforms. The K-GetSheWer function
allows you to get the revision number of the Keithley DAS Shell (the
Keithley DAS Shell is a group of functions that are shared by all DAS
boards).


Handling Errors
Each FCD function returns a code indicating the status of the function. To
ensure that your application program runs successfully, it is recommended
that you check the returned code after the execution of each function. If
the status code equals 0, the function executed successfully and your
program can proceed. If the status code does not equal 0, an error
-@ occurred; ensure that your application program takes the appropriate
action, Refer to Appendix A for a complete list of error codes.

For C-language application programs only, the DAS-1800 Series
Function Call Driver provides the K-GetErrMsg function, which gets
the address of the string corresponding to an error code.


Analog Input Operations

This section describes the following:

. Analog input operation modes available.

. How to allocate and manage memory for analog input operations.

. How to specify the following for an analog input operation: channels
and gains, a conversion mode, a clock source, a buffering mode, a
trigger source, and a hardware gate.


2-4 Available Operations
4 hap02-.frm Page 5 Monday, April 11, 1994 9:55 AM 4

Operation Modes
The operation mode determines which attributes you can specify for an
analog input operation and how data is transferred from the board to the
computer. You can perform analog input operations in one of the
following modes:

. Single mode - In single mode, the board acquires a single sample
from an analog input channel. The driver initiates conversions; you
cannot perform any other operation until the single-mode operation is
complete.

Use the K-ADRead function to start an analog input operation in
single mode. You specify the board you want to use, the analog input
channel, the gain at which you want to read the signal, and the
variable in which to store the converted data.

. Interrupt mode -In interrupt mode, the board acquires a single
sample or multiple samples from one or more analog input channels.
A hardware clock initiates conversions. Once the analog input
operation begins, control returns to your application program. The

4 hardware temporarily stores the acquired data in the onboard FIFO
(first-in, first-out data buffer) and then transfers the data to a 4
user-defined buffer in the computer using an interrupt service routine.

Use the K-IntStart function to start an analog input operation in
interrupt mode. You specify the board, analog input channel(s),
gain(s), clock source, buffering mode, buffer address( trigger
source, and gate use.

You can specify either single-cycle or continuous buffering mode for
interrupt-mode operations. Refer to page Z- 18 for more information
on buffering modes. Use the K-IntStop function to stop a
continuous-mode interrupt operation. Use the K-IntStatus function
to determine the current status of an interrupt operation.

. DMA mode - In DMA mode, the hoard acquires a single sample or
multiple samples from one or more analog input channels. A
hardware clock initiates conversions. Once the analog input operation
begins, control returns to your application program. The hardware
temporarily stores the acquired data in the onboard FfFO (first-in,




4 4 4
4 hapOZ.fim Page 6 Monday, April 11,1994 9:55 AM




first-out data buffer) and then transfers the data to a user-defined
DMA buffer in the computer.


Note: You can perform an analog input operation in single-DMA
mode or dual-DMA mode, depending on whether you specified one
or two DMA channels in your configuration file. Refer to your
DAS-1800 Series board user's guide for more information.


Use the K-DMAStart function to start an analog input operation in
DMA mode. You specify the board, analog input channel(s), gain(s),
clock source, buffering mode, buffer address( trigger source, and
gate use.

You can specify either single-cycle or continuous buffering mode for
DMA-mode operations. Refer to page 2- 18 for more information on
buffering modes. Use the K-DMAStop function to stop a
continuous-mode DMA operation. Use the K-DMAStatus function
to determine the current status of a DMA operation.

The converted data are stored as raw counts. For information on
4 converting raw counts to voltage, refer to Appendix B. 4
Memory Allocation and Management
Interrupt-mode and DMA-mode analog input operations require memory
buffers in which fo store the acquired data. You can reserve a single
memory buffer, or you can reserve multi