Tektronix DAS-1800/DAS-1700 Series Function Call Driver Users Guide

DAS-1800 Series
Function Call Driver
User’s Guide
Warranty
Hardware Keithley Instruments, Inc. warrants that, for a period of one (1) year from
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 http://www,keithley.com Fax: 39-2-48302274
39-2-4X30300X
CHINA Keithley Instruments China Yuan Chen Xin Building, Room 705 No. 12Yumin Road, Dewei, Madian Beijing, China 100029
8610.2022856 Fax: 8610.2022892
FRANCE Keithley Instruments SARL BP 60 3 all&c des Garays 91122 Palaiseau C&da 31-6-0115155 Fax: 31-6-0117726
GERMANY Keithley Instruments GmbH Landsbergcr SwaRc 65
821 IO Garnering 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
NETHERLANDS Keithley Instruments BV Avelingen West 49 4202 MS Gorinchem 31-(0)1X3-635333 Fax: 31.(0)183-630X21
SWITZERLAND Keithley Instruments SA
Kriesbachstrasse 4 8600 Diibendorf 41-I-8219444 Fax: 41-I-8203081
TAIWAN
Keithley Instruments Taiwan
I, Ming-Yu First Street Hsinchu. Taiwan, R.O.C. 8X6-35-778462
Fax: 8X6-35-778455
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. No license is granted by implication or otherwise
under any
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 unlawful.
I17 of the 1976 United States Copyright Act without permission of the Copyright owner is
Keithley Instruments, Inc.
28775
Telephone: (440) 248-0400. FAX: (440) 248-6168
Aurora Road Cleveland, OH 44139
Table of Contents
Preface
1 Getting Started
Technical Support .....................................
2 Available Operations
System Operations. ..................................
Initializing the Driver ..............................
Initializing a Board ................................
Retrieving Revision Levels. .........................
Handling Errors. ..................................
Analog Input Operations ..............................
Operation Modes. .................................
Memory Allocation and Management.
Gains............................................2- 9
Channels........................................2-10
Specifying Channels When Using EXP- I800 Expansion
Boards (DAS- IEOOSTIHR Series Only).
Acquiring Samples from a Single Channel
Acquiring Samples from a Group of Consecutive
Channels.....................................2-I 3
Acquiring Samples Using a Channel-Gain Queue.
Conversion Modes. .............................
ClockSources....................................2-15
PacerClock....................................2-16
Burst Mode Conversion Clock.
Buffering Modes .................................
Triggers.........................................2-19
TriggerSources ...............................
Internal Trigger .............................
Analog Trigger .............................
Digital Trigger, .. ..........................
Post-Trigger Acquisition ........................
Pre-Trigger Acquisition .........................
About-Trigger Acquisition.
Hardware Gates, ...... ..........................
Analog Output Operations (DA.%I SOOHC Series Only).
................... ,2-l 7
...................... .2-25
1-4
.2-l .2-2 .2-2 .2-4 .2-4 .2-4 .2-5
................. .2-6
........... .2-l I
.......... ,2- I3
.... .2-14
.,.2-l 5
.2- I8 .2-19
,2- 19 .2-20 .2-22 .2-23 .2-24
.2-25
.... .2-26
toe Page iv Monday, April 11, 1994 9:50 AM
Operation Modes.
................
Memory Allocation and Management
Channels .......................
Clock Source. ...................
Buffering Modes. ................
Digital I/O Operations ...............
Operation Modes.
................
Memory Allocation and Management
Digital Input Channel .............
Digital Output Channel. ...........
Clock Source. ...................
Buffering Modes. ................
3
Programming with the Function Call Driver
How the Driver Works. Programming Overview. Preliminary Tasks.
...............................
.............................
.................................. .3-11
Operation-Specific Programming Tasks
Analog Input Operations.
Single Mode.
.................................
Interrupt Mode.
........................ .,.3-l 1
...............................
DMAMode...................................3-15
Analog Output Operations (DAS-1800HC Series Only) 3-18
Single Mode Interrupt Mode.
Digital I/O Operations.
Single Mode. Interrupt Mode.
.................................. .3-18
............................... .3-18
............................ .3-20
.................................
............................... .3-21
Language-Specific Programming Information
C/Ci+ Languages
............................... ..3-2 3
Allocating and Assigning Dynamically Allocated
Memory Buffers Single Memory Buffer Multiple Memory Buffers. Accessing the Data
............................ .3-23
....................... .3-23
.................... .3-N
.......................... .3-25
Dimensioning and Assigning Local Arrays.
Single Array Multiple Arrays.
Creating a Channel-Gain
.............................. ..3-2 6
............................
Queue
Programming in Microsoft C/C++. Programming in Borland C/C++
Programming in Microsoft QuickC for Windows
......
......
......
......
......
......
......
......
......
......
......
......
..... .2-21
..... .2-27
.... ..2-2 8
.... ..2-2 9
.... ..2-3 0
.... ..2-3 1
.... ..2-3 1
..... .2-33
.... ..2-3 4
.... ..2-3 5
.... ..2-3 6
.... ..2-3 8
.3-l
.3-10
.................. 3-l 1
.3-12 .3-12
,3-20
............ ,3-22
.........
,3-25 .3-26
.................. .3-27
................ .3-28
.................. .3-29
...... 3-30
iv
raft3.toc
+b
Page v Monday, April 11, 1994 9:50 AM
+b
Programming in Microsoft Visual
Pascal Languages
Allocating and Assigning Dynamically Allocated
Memory Buffers Reducing the Memory Heap. Single Memory Buffer Multiple Memory Buffers. Accessing the Data
Dimensioning and Assigning Local Arrays. ......... .3-35
Single Array Multiple Arrays.
Creating a Channel-Gain Queue
Programming in Borland Turbo Pascal (for DOS). .... .3-38
Programming in Borland Turbo Pascal for Windows .. .3-39
Microsoft Visual Basic for Windows
Allocating and Assigning Dynamically Allocated
Memory Buffers Single Memory Buffer Multiple Memory Buffers. Accessing the Data
Dimensioning and Assigning Local Arrays. ......... .3-42
Single Array Multiple Arrays.
Creating a Channel-Gain Queue Programming in Microsoft Visual Basic for Windows .3-45
BASIC Languages.
Allocating and Assigning Dynamically Allocated
Memory Buffers
Reducing the Memory Heap. Single Memory Buffer Multiple Memory Buffers. Accessing the Data
Dimensioning and Assigning Local Arrays. ......... .3-48
Single Array
Multiple Arrays Creating a Channel-Gain Queue 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)
Programming in Microsoft Visual Basic for DOS. .... .3-55
................................
............................
.......................
..........................
..............................
............................
............................
.......................
..........................
...............................
............................ .3-43
...............................
............................
.......................
..........................
...............................
.............................
..............................
C++
.............
..................
.................... .3-34
.................. .3-37
.................
....................
..................
..................
....................
..................
..3-5 3
.3-31 .3-31
,3-32 .3-32 .3-33
.3-35
..3-3 6
.3-36
.3-40 .3-40
.3-40 ,3-41
.3-42 .3-42 ,344 ,3-46 .3-46
.3-46 .3-46 .3-47 .3-48
.3-49 .3-49 .3-50
aft3.toc
Page vi Monday, April 11, 1994 9:50 AM
4 Function Reference
DAS1800-DevOpen DAS1800~GetDevHandle. K_ADRead. K-ButListAdd K-BtdListReset K-ClearFrame K-CloseDriver. K-ClrAboutTrig. K-ClrADFreeRun K~ClrContRun. K-DASDevInit KDAWrite
................
..............
.............
..............
.............
............
...........
.............
.............
................
K-DIRead .................
K-DMAAlloc K-DMAFree K-DMAStart K-DMAStatus K-DMAStop K_DOWrite
K-ForntatChnGAry K_FreeDevHandle K-FreeFrame
..............
...............
...............
..............
...............
................
...........
...............
K-GetAboutTrig ............
K-GetADCommonMode. .
K-GetADConfig ............
K-GetADFrame.
K-GetADFreeRun
KGetADMode K-GetADTrig
............
...........
.............
..............
KGetBuf. .................
K_GetBurstTicks K-GetChn
KGetChnGAry
K_GetClk. K-GetClkRate K-GetCoutRun
............
.................
.............
.................
..............
.............
K-GetDAFrame. ............
K-GetDevHandle. ...........
K-GetDIFratne K-GetDITrig K-GetDOCurVal
.............
...............
............
.........
..........
....
. ..4-8 ..4-11 ..4-14 ..4-17 ..4-21 ..4-23 ..4-25 ..4-27 ,.4-29 ..4-31 ..4-33 ..4-35 ..4-38 ..4-41 ..4-45 ..4-47 ..4-49 ..4-53 ..4-56 ..4-59 ..4-61 ..4-63 ..4-65 ..4-67 ..4-69 ..4-71 ..4-73 ..4-76 ..4-78 ..4-82 ..4-85 ..4-88 ..4-91 ..4-93
..4-96 ..4-99 .4-102
.4-105 .4-107 .4-110 .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. K-GetSheWer.
......................................
...................................
K_GetSSH........................................4-13 2
KGetStartStopChn. ...............................
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.
.......................................
K-IntStatus ...................................... .4-158
K-IntStop. ....................................... .4- 162
KMakeDMABuf .................................. .4- 165
K-MoveArrayToBuf
K-MoveButToArray ............................... .4-169
K-OpenDriver
.................................... .4-171
K-RestoreChnGAry ................................ .4-174
K-SetAboutTrig. ..................................
K~SetADCommonMode ............................ .4-179
K_Seu\DConfig....................................4-18 1
K-SetADFreeRun .................................
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
.................................
K_SetG...........................................4-22 0
K_SetGate........................................4-22 2
K-SetSSH.. .................................... ..4-2 24
...............................
.4-126 .4-129
.4-135
.4-156
.4- 167
.4-176
.4- 183
.4-218
vii
raft3.toc Page viii Monday, April 11, 1994 9:50 AM
II
4
K-SetStartStopChn ............................. .4-226
K-SetStartStopG ............................... .4-230
K-SetTrig ..................................... .4-233
K-SetTrigHyst .................................
A
Error/Status Codes
B
Data Formats
Converting Raw Counts to Voltage .................
Converting Voltage to Raw
Specifying an Analog Output Value
(DAS-1800HC Series only). .................
Specifying au Analog Trigger Level. .............
Specifying a Hysteresis Value. ..................
Index
Counts .................
.4-236
.B-1 .B-3
.B-3 .B-4 .B-5
List of Figures
Figure 2-1. Example of Logical Channel Assignments Figure 2-2. Trigger Events for Analog Triggers . . Figure 2-3. Using a Hysteresis Value. . Figure 2-4. Trigger Events For Digital Triggers
Figure 2-5. Digital Input Bits. . . . . . . .
Figure 2-6. Figure 3-1. Single-Mode Function. Figure 3-2. Interrupt-Mode Operation
Digital Output Bits. . . . . . . . . . . . . .
. ..2-12 . . ,2-20
.2-22 .2-23 .2-34
. . .2-35
.3-2 .3-3
raft3 tot Page ix Monday, April 11.1994 9:50 AM
1
+I+
List of Tables
Table 2- 1. Table 2-2. Table 3-l. Table 3-2. Table 3-3. Table 3-4. Table 3-5.
Table 3-6. Table 3-7. Table 3-8. Table 4- 1.
Table 4-2. Table A-l. Table B-l.
Supported Operations .2-l Analog Input Ranges. .2- 10 A/D Frame Elements. .3-5 D/A Frame Elements. .3-7 DI Frame Elements .3-8 DO Frame Elements .3-9 Setup Functions for Interrupt-Mode Analog Input Operations. .3-13 Setup Functions for DMA-Mode Analog Input Operations. .3-16 Setup Functions for Interrupt-Mode Analog Output Operations. .3- 19 Setup Functions for Interrupt-Mode Digital Input and Digital Output Operations. .3-21
Functions................................4-2
Data Type Prefixes . . .4-7
Error/Status Codes.. . . A-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
The
DAS-I800 Series Function
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)
Cull
Driver
User’s
Preface
Guide
describes how
. 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
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.
is organized as
4
Chapter 4 contains detailed descriptions of the DAS-1800 Series Function Call Driver functions, arranged in alphabetical order.
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).
4
xii
4
hapOlL.frm Page 1 Monday, April 11, 1994 9:54 AM
t
4
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.
Getting Started
4
- Support files, containing such program elements as function prototypes and definitions of variable types, which are required by the FCD functions.
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.
4
4
l-l
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:OO A.M. - 6:OO P.M., Eastern Time
1-2
Getting Started
Page 3 Monday, April II,1994 954 AM
.frm
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
Series Board Configuration
Computer
Operating System
Software package
Model Serial # 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.
Manufacturer CPU type Clock speed (MHz)
KB of RAM Video system BIOS type
DOS version Windows version Windows mode
Name
Serial # Version Invoice/Order #
Compiler (if applicable)
Accessories
Language Manufacturer
Version
-.
1-3
Technical Support
Before returning any equipment for repair, call Keithley Instruments, Inc., for technical support at:
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
(440) 248-1520
Monday - Friday, 8:00
A.M.
- 6:OO
P.M.,
Eastern Time
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
& -
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.
2
Table 2-1. Supported Operations
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.
Operation
System
Page Reference
page z- 1
2-l
hap02-.frm
+B
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 specify in the board initialization function in all subsequent function calls related to the board.
use
the board handle you
2-2
Available Operations
hap02_.frm
+b
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:
+b
. Abort all operations currently in progress that are associated with the
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
hap02-.frm Page 4 Monday, April 11,1994 9:55 AM
43
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
Loading...
+ 354 hidden pages