Text preview for : 86770A(DAS800).pdf part of Keithley 86770A(DAS800) Keithley DAS 86770A(DAS800).pdf



Back to : 86770A(DAS800).pdf | Home

cover.frm Black 1




DAS-800 Series
Function Call Driver
User's Guide
1 titlepgfrm Black 1




DAS-800 Series
Function Call Driver
User's Guide




Revision A - December 1993
Part Number: 66770
noticep.frm Black 1
+b

The information contained in this manual is believed to be accurate and reliable. However. the
manufacturer assumes no responsibility for its use; nor for any infringements or patents or other rights
of third parties that may result from its use. No license is granted by implication or otherwise under any
patent rights of the manufacturer.

THE MANUFACTURER 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 THAT IS SUITED
FOR USE IN LIFE SUPPORT OR CRITICAL APPLICATIONS.

All brand and product names are trademarks or registered trademarks of their respective companies.

0 Copyright Keithley Instruments, Inc., 1993.

All rights reserved. Reproduction or adaptation of any part of this documentation beyond that permitted
by Section I I7 of the 1976 United States Copyright Act without permission of the Copyright owner is
unlawful.
800fcd.toc Black iii




Table of Contents
Preface

1 Getting Started
Installing the Software.. 1-2
Installing the DAS-800 Series Standard Software Package 1-2
Installing the ASO- Software Package 1-3
DOS Installation.. 1-3
Windows Installation 1-4
Setting Up the Boards . . . . l-5
Getting Help.. . . l-6

2 Avallable Operations
Analog Input Operations .......................... ,.,2-l
Operation Modes. ............................. 2-2
Memory Allocation and Management ............. .2-3
Input Range Qpe ............................. 2-5
Gains ....................................... 2-5
Channels .................................... .2-6
Single Channel, ............................ .,.2-x
Multiple Channels Using a Group of Consecutive
Channels ................................ .2-9
Multiple Channels Using a Channel-Gain List .... .2-9
Conversion Clocks ............................ .2-13
Buffering Mode. .............................. .2-16
Triggers ..................................... .2-16
Analog Triggers ............................ .2-17
Digital Triggers ............................ .2-20
Hardware Gates. .............................. .2-22
Digital I/O Operations ............................ ,2-24
Counternimer I/O Operations. .....................
System Operations. .............................. : : 2-26
2-27
Initializing the Driver. ......................... .2-28
Initializing a Board ............................ .2-29
Retrieving the Revision Level. ................... : : 2-30
Handling Errors. ..............................
8OOfcd.toc Black iv




3 Programming with the Function Call Driver
How the Driver Works ................................ ,3-l
Programming Overview ............................... .3-5
Preliminary Tasks. ................................... .3-6
Operation-Specific Programming Tasks ,3-6
Analog Input Operations. .3-6
Single Mode, .................................. .3-7
Synchronous Mode ............................. .3-7
Interrupt Mode. ................................ .3-9
Digital I/O Operations............................. .3-12
Language-Specific Programming Information ............ (3-12
Microsoft C/C++. ................................ .3-13
Borland C/C++ .................................. .3-14
Microsoft QuickC for Windows ..................... .3-I5
Microsoft Visual C++ ............................. .3-16
Borland Turbo Pascal ............................. .3-16
Borland Turbo Pascal for Windows .................. .3-17
Specifying the Buffer Address (Pascal) ............... .3-1X
Specifying the Channel-Gain List Starting
Address (Pascal). ............................... .3-19
Microsoft QuickBASIC (Version 4.0) ................ .3-20
Microsoft QuickBasic (Version 4.5). ................. .3-21
Microsoft Professional Basic (Version 7.0) ............ .3-22
Microsoft Visual Basic for DOS ...................... 3-23
Microsoft Visual Basic for Windows .................. 3-24
Specifying the Buffer Address (All BASIC Languages) .. .3-25

4 Function Reference
DASXOO-DevOpen ........ ........ .4-6
DAS800-GetADGainMode. ........ .4-9
DAS800-GetDevHandle . ... ........ .4-II
DAS800-Get8254 : ........ ........ .4-13
DAS800&SetADGainMode . ........ .4-15
DAS800-Set8254 ......... ........ .4-17
K-ADRead. .............. ........ .4-19
K-BufListAdd ............ ........ .4-22
K-BufListReset ........... ........ .4-24
K-ClearFrame ............ ........ ,4-26
K-CloseDriver ............ ........ ,4-28
K-ClrConiRun ............ ........ .4-30
K-DASDevInit ........... ........ 4-32
K-DIRead ............... ........ .4-33

iv
800fcd.toc Black v




K-DOWrite .............. .4-35
K-FormatChanGAry .4-37
K-FreeDevHandle ......... .4-3x
K-FreeFrame ............. .4-39
K-GetADFrame. .......... .4-40
KGetADTrig ............ .4-42
K-GetBuf. ............... .4-44
K-GetChn ............... ,446
K-GetChnGAry . ..4-48
K-GetClk ................ .4-50
K-GetClkRate ............ .4-52
K-GetContRun ........... .4-54
K-GetDevHandIe. ......... .4-56
K-GetDITrig ............. . ..4-58
K-GetErrMsg. ............ .4-60
K-GetG ................. .4-61
K-GetGate ............... .4-63
K-GetStartStopChn ........ .4-65
KGetStartStopG .......... ,4-67
K-GetTrig ............... .4-70
K-GetTrigHyst. ........... .4-72
K-GetVer ................ ,4-14
K-InitFrame. ............. .4-76
K-IntAlloc ............... .4-7x
K-IntFree ................ ,4-80
K-IntStart. ............... .4-81
K-IntStatus .............. .4-x3
KJntStop. ............... .4-X6
K-MoveBuffoArray ....... 4-88
K-OpenDriver ............ .4-x9
K-RestoreChanGAry ....... .4-92
K-SetADTrig. ............ .4-93
K_SetBuf ................ .4-95
K-SetBufI ............... .4-97
K-SetChn. ............... .4-99
K-SetChnGAry ........... ,4-101
K-SetClk ................ .4-103
K-SetClkRate ............ .4-I05
K-SetContRun. ........... .4-107
K-SetDITrig. ............. .4-109
K-SetG. ................. ..4-111
K-SetGate ............... .4-113
SOOfcd.toc Black vi




K-SetStartStopChn ............................ .4-115
K-SetStartStopG .............................. .4-l I7
K-SetTrig .................................... .4-120
K-SetTrigHyst ................................ 4-122
K-SyncStart .................................. 4-124

A Error/Status Codes

B Data Formats
Converting Raw Counts to Voltage B-2
Converting Voltage to Raw Counts .B-3
Specifying an Analog Trigger Level. .B-3
Specifying a Hysteresis Value. .B-5

Index

List of Figures
Figure 2-l. Analog Input Channels .2-x
Figure 2-2. Channel-Gain List (C or Pascal) .2-IO
Figure 2-3. Sample Channel-Gain List (C or Pascal). .2-I1
Figure 2-4. Channel-Gain List (BASIC) .2-I2
Figure 2-5. Sample Channel-Gain List (BASIC). .2-12
Figure 2-6. Initiating Conversions .2-I5
Figure 2-7. Analog Trigger Conditions .2-I7
Figure 2-8. Using a Hysteresis Value. . . 2-19
Figure 2-Y. Initiating Conversions with an External
Analog Trigger .2-20
Figure 2-10. Initiating Conversions with an External
Digital Trigger. . 2-21
Figure 2-l I. Hardware Gate. : : 2-23
Figure 2-12. Digital Input Bits. .2-24
Figure 2-13. Digital Output Bits. .2-25




vi
SOOfcd.toc Black vii




List of Tables
Table 2-l. Supported Operations .2-l
Table 2-2. Analog Input Ranges., .2-6
Table 2-3. Channels in Maximum Configuration. .2-7
Table 3-l. A/D Frame Elements. .3-3
Table 3-2. Setup Functions for Synchronous-Mode
Operations.. ....... ... . .3-7
Table 3-3. Setup Functions for Interrupt-Mode Operations .3-IO
Table 4-1. FCD Functions. . .4-2
Table 4-2. Default Configuration .4-7
Table A- I. Error/Status Codes. A-l




vii
800fcd.toc Black viii
preface.frm Black ix
+b




Preface

The DAS-BOO Series Function Call Driver User's Guide describes how to
write application programs for DAS-800 Series boards using the
DA.%800 SeriesFunction Call Driver. The DAS-X00 Series Function Call
Driver supports the following DOS-based languages:

. Microsoft@ QuickBASIC (Version 4.0)

l Microsoft QuickBasicm (Version 4.5 and higher)

. Microsoft Professional Basic (Version 7.0 and higher)

. Microsoft Visual BasicTMfor DOS (Version 1.0)

. Microsoft C/C++ (Version 4.0 and higher)

. Borland@ C/C++ (Version I.0 and higher)

l Borland Turbo Pascal@ DOS (Version 6.0 and higher)
for

The DAS-800 Series Function Call Driver also supports the following
WindowsTM-based languages:

l Microsoft Visual Basic for Windows (Version 2.0 and higher)

. Microsoft QuickC@ for Windows (Version 1.0)

l Microsoft Visual C++TM(Version I .O)

. Borland Turbo Pascal for Windows (Version 1.0 and higher)
preface.frm Black x
f@




The manual is intended for application programmers using a DAS-800,
DAS-801, or DAS-802 board in an IBM' PC/XY, ATa or compatible
computer, It is assumedthat users have read the DAS-800 Series User's
Guide to familiarize themselveswith the boards' functions, and that they
have completed the appropriate hardware installation and configuration. It
is also assumedthat users are experienced in programming in their
selected language and that they are familiar with data acquisition
principles.

The DAS-800 Series Function Call Driver User's Guide is organized as
follows:

Chapter I contains the information needed to install the DAS-800
Series Function Call Driver and to set up DAS-800 Series boards.

Chapter 2 contains the background information needed to use the
functions included in the DAS-800 Series Function Call Driver.

Chapter 3 contains programming guidelines and language-specific
information related to using the DA.5800 Series Function Call
Driver.

Chapter 4 contains detailed descriptions of the DAS-XtlO Series
Function Call Driver functions, arranged in alphabetical order.

Appendix A contains a list of the error codes returned by DAS-800
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.
prefacefrm Black xi




Keep the following conventions in mind as you use this manual:

. References to DAS-800 Series boards apply to the DAS-800,
DAS-801, and DAS-802 boards. 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 (Version 4.0). Microsoft QuickBasic
(Version 4.5), 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 ([ 1).




4




xi




4
preface.frm Black xii




4




4
chapOl_.frm Black 1
fb




Getting Started

The DAS-800 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-X00 Series standard software package -This is the software
package that is shipped with DAS-800 Series boards; it includes the
following:
- Libraries of FCD functions for Microsoft QuickBASIC
(Version 4.0) Microsoft QuickBasic (Version 4.5), Microsoft
Professional Basic, and Microsoft Visual Basic for DOS.
4 - Support files, containing such program elements as function
4
prototypes and definitions of variable types, which are required
by the FCD functions.
- Utility programs, running under DOS, that allow you IO
configure, calibrate, and test the functions of DAS-800 Series
boards.
- Language-specific example programs,

. ASO- software package - This is the optional Advanced
Software Option for DAS-800 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.




l-l




4
chapOl_.frm Black 2
+D

- 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.

- Utility programs, running under DOS and Windows, that allow
you to configure, calibrate, and test the functions of DAS-800
Series boards.

- Language-specific example programs.

This chapter contains the information needed to install the DAS-800
Series Function Call Driver in your computer and set up your DAS-800
Series boards. It also contains information on where to get help if you
have problems installing or using the Function Call Driver.


Installing the Software

Before you can use the Function Call Driver, you must install the
appropriate software package, either the DAS-800 Series standard
software package or the ASO- software package.

The following sections describe how to install the DAS-800 Series
standard software package and how to install the AS0400 software
package from both DOS and Windows.

Installing the DAS-800 Series Standard Software Package
To install the DAS-800 Series standard software package, perform the
following steps:

1. Make a back-up copy of the supplied disks.

2. Insert disk #l into the disk drive.




l-2 Getting Started
chapOl_.frm Black 3




3. Assuming that you are using disk drive A, enter the following at the
DOS prompt:

A:install


The installation program prompts you for your installation
preferences,including the name of the directory you want to copy the
software to. It also prompts you to insert additional disks, as
necessary.

4. Continue to insert disks and respond to prompts, as appropriate.

The installation program expands any files that are stored in a
compressedformat and copies them into the directory you specified
(DAS800 directory on hard disk C if you do not specify otherwise).

5. Review the following tiles:

- FILES.TXT lists and describesall the files copied to the hard disk
by the installation program.
- README.TXT contains information that was not available when
this manual was printed.

installing the ASO- Software Package
This section describes how to install the ASO- software package from
both DOS and Windows.

DOS Installation
To install the ASO- software package from DOS, perform the
following steps:

1. Make a back-up copy of the supplied disks.

2. Insert disk #1 into the disk drive.

3. Assuming that you are using disk drive A. enter the following at the
DOS prompt:

A:install


1-3
chapOl_.frm Black 4




The installation program prompts you for your installation
preferences,including the name of the directory you want to copy the
software to. It also prompts you to insert additional disks, as
necessary.

4. Continue to insert disks and respond to prompts, as appropriate.

The installation program expands any files that are stored in a
compressed format and copies them into the directory you specified
(AS0800 directory on hard drive C if you do not specify otherwise).

5. Review the following files:

- FILES.TXT lists and describes all the files copied to the hard disk
by the installation program.
- README.TXT contains information that was not available when
this manual was printed.

Windows Installation
To install the ASO- software package from Windows, perform the
following steps:

I. Make a back-up copy of the ASO-Windows disk

2. Insert the ASO-Windows disk into the disk drive.

3. Start Windows,

4. From the Program Manager menu, choose File and then choose Run.

5. Assuming that you are using disk drive A, type the following at the
command line in the Run dialog box, and then select OK:

A: SETUP


The installation program prompts you for your installation
preferences, including the name of the directory you want to copy the
software to.

6. Type the path name and select Continue.


1-4 Getting Started
chapOl_.frm Black 5
fb

The installation program expands any tiles that are stored in a
compressed format and copies them into the directory you specified
(ASOBOWWINDOWSdirectory on hard drive C if you do not specify
otherwise).

The installation program also creates a DAS-800 family group; this
group includes example Windows programs and help files.

7. Review the following files:
- FILES.TXT lists and describes all the tiles copied to the hard disk
by the installation program.

- README.TXT contains information that was not available when
this manual was printed.


Setting Up the Boards

Before you use the Function Call Driver. make sure that you have
performed the following steps:

1. Installed the software.

If not, install the appropriate software package (either the DAS-800
Series standard software package or the ASO- software package)
on your IBM PC/XT, AT or compatible computer. Refer to page 1-2
for information on installing the DAS-800 Series standard software
package; refer to page 1-3 for information on installing the ASO-8OU
software package.

2. Created a configuration file.

If not, use the DXOOCFG.EXEutility to create a configuration file for
the DAS-800 Series boards you are using. For each board, make sure
that you specify the board model, the base address,the use of
counter/timer 2 (C/IY2) on the 8254 counter/timer circuitry, the input
range type (unipolar or bipolar), the input configuration (single-ended
or differential) for each channel on each DAS-801 and DAS-802
board, the interrupt level, and the expansion boards used. Refer to the
DAS-800 Series (/ser's Guide for more information.


l-5
chapOl_.frm Black 6




3. Configured the hardware.

If not, use switches on the boards to set the base addressof each
DA.%800 Series board and the input contiguration (single-ended or
differential) for each channel on each DAS-801 and DAS-802 board.
Use the jumper on the boards to set the interrupt level of each
DAS-800 Series board. Refer to the instructions in the
DXOOCFG.EXEutility and the DAS-800 Series User's Guide for more
information.

4. Installed the board(s).

If not, with the computer powered down, install the DAS-800 Series
boards in your computer. The DAS-800 requires a single, short slot;
the DAS-801 and DAS-802 require a single, l/2-slot. Refer to the
documentation provided with your computer for more information on
installing boards.

Note: The DAS-800 Series Function Call Driver supports a
maximum of four DAS-800 Series boards.

5. Tested the board(s), if desired.

If you want to test the functions of the boards before writing your
application program, use the CTLXOO.EXEutility (for DOS) or the
CTLXOOW.EXEutility (for Windows). Refer to the DA.5800 Series
User's Guide for more information.


Getting Help

If you need help installing or using the DA.%800 Series Function Call
Driver, contact the factory.




l-6




-
chapOl_.frm Black 7




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

Software package Version
Invoice/order #

Compiler Language
Manufacturer
Version

Operating system DOS version
Windows version 3.0 3.1
mode Standard Enhanced

Computer Manufacturer
CPU type 8088 286 386 486-
Clock speed(MHz) 8 12 20 25 33 _
Math coprocessor Yes No
Amount of RAM
Video system CGA Hercules EGA VGA
BIOS type
4 800 801 802
4
DAS-800 board Model
Serial I#
Base addresssetting
Interrupt level setting 2 3 4 5 6 7 None
Input configuration Single-ended Differential
Input range type Unipolar Bipolar
8254 C/l? usage Cascaded Normal

Expansion boards `I)pe

;;:

;;:


5Pe




l-7




4
chapOl_.frm Black 8
chap02-.frm Black 1




2
Available Operations

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


Table 2-1. Supported Operations

Operation Page Reference
Analog input page 2-I


Counter/timer l/O page 2-26




Analog Input Operations

This section describes the following:

. Analog input operation modes available.

. How to allocate and manage memory.

. How to modify the input range type.

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




2-l
chap02-.frm Black 2




Operation Modes
The operation mode determines which attributes you can specify for an
analog input operation and whether the operation is performed in the
foreground or in the background. 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 the conversion and
the board acquires the data in the foreground: you cannot perform any
other operation until the single-mode operation is complete.

You use the K-ADHead 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.

. Synchronous mode - In synchronous mode, the board acquires a
single sample or multiple samples from one or more analog input
channels. A hardware conversion clock initiates conversions while
the board acquires data in the foreground: you cannot perform any
other operation until the synchronous-mode operation is complete.
After the driver transfers the specified number of samples to the host.
it returns control to the application program, which reads the data.
Synchronous mode provides the fastest acquisition of multiple
samples.

You use the K-SyncStart function to start an analog input operation
in synchronous mode. You specify the channel(s). gain(s). conversion
clock source, buffer address,and trigger source.

. Interrupt mode - In interrupt mode, the board acquires a single
sample or multiple samples from one or more analog input channels.
A hardware conversion clock initiates conversions while the board
acquires data in the background; system resources can be used by
other programs. The driver transfers data to the host in the
background using an interrupt service routine.

You use the K-In&art function to start an analog input operation in
interrupt mode. You specify the channel(s), gain(s), conversion clock
source, buffering mode, buffer address,and trigger source.



2-2 Available Operations
chap02-.frm Black 3
+b

You can specify either single-cycle or continuous buffering mode for
interrupt-mode operations. Refer to page 2-16 for more information
on buffering modes. You can use the K-IntStop function 10 stop a
continuous-mode interrupt operation.

You can use the K-IntStatus function to determine the current status
of an interrupt operation. In addition, you can use the K-InitFrame
function to determine the status of all interrupt operations on a
particular board.

For single mode, synchronous mode, and interrupt mode, the converted
data is stored as raw counts. For information on converting raw counts to
voltage, refer to Appendix B.


Note: In applications where you must accurately control the sampling
rate, it is recommended that you perform the analog input operation in
either synchronous mode or interrupt mode so that you can specify a
conversion clock source.


Memory Allocation and Management
Synchronous-mode and interrupt-mode analog input operations require a
memory buffer in which to store the acquired data. You can provide the
required memory buffer in one of the following ways:

. Within your application program's memory area - The local
memory buffer is always available to your program; however. your
application program may require a large amount of memory. You can
dimension a local memory buffer for any supported language. Since
the DAS-800 Series Function Call Driver stores data in l6-bit
integers, you must dimension all local memory buffers as integers.

. Outside of your application program's memory area - You
allocate memory as needed.For all C languages, all Pascal languages,
and Visual Basic for Windows, you can use the K-IntAlloc function
to allocate memory dynamically, outside of your program's memory
area. You specify the operation requiring the buffer, the number of
samples to store in the buffer, the starting addressof the buffer, and
the name you want to use to identify the buffer (this name is called the
memory handle). When the buffer is no longer required. you can free

2-3
chap02Lfrm Black 4




the buffer for another use by specifying this memory handle in the
K-IntFree function.


Note: You cannot allocate memory dynamically in BASIC; in
BASIC, you must dimension the memory buffer locally.

You can use multiple buffers to increase the number of samples you can
acquire. Each synchronous-mode or interrupt-mode analog input
operation has a buffer list associatedwith it. You can use the
K-BufListAdd function to add a buffer to the list of multiple buffers.
You can use the K-BufListReset function to clear the list of multiple
buffers.


Note: If you are using a Windows-based language in Enhanced mode,
you may be limited in the amount of memory you can allocate. If you are
allocating memory dynamically or if you are using multiple buffers. it is
recommended that you use the Keithley Memory Manager before you
begin programming to ensure that you can allocate a large enough buffer
or buffers. Refer to the DAS-800 Series User's Guide for more
information about the Keithley Memory Manager.


After you allocate or dimension your buffer(s). you must specify the
starting addressof the buffer(s) and the number of samples to store in the
buffer(s), as follows:

l For BASIC - You use the K SetBufI function to specify the starting
addressof a single, locally dimensioned memory buffer. When using
multiple buffers, you use the K-BufListAdd function both IO add
buffers to the multiple-buffer list and to specify the starting addressof
each buffer.

. For Visual Basic for Windows - You use the K SetBufl function to
specify the starting addressof a single, locally dimensioned integer
memory buffer; you use the K-SetBuf function to specify the starting
addressof a single buffer allocated dynamically using K-IntAlloc.
When using multiple buffers, you use the K-BufListAdd function
both to add buffers to the multiple-buffer list and to specify the
starting addressof each buffer.


2-4 Available Operations
chap02-.frm Black 5




Note: If you allocated your buffer dynamically using K~lntAlloc,
you must use the K-MoveBufIbArray function to transfer the
acquired data from the dynamically allocated buffer to a local buffer
that your Visual Basic for Windows program can we. Refer to page
3-25 for more information.

l For C and Pascal - You use the K-SetBuf function to specify the
starting addressof a single buffer, whether the buffer was
dimensioned locally or allocated dynamically using K-IntAlloc.
When using multiple buffers, you use the K-BuIListAdd function
both to add buffers to the multiple-buffer list and to specify the
starting addressof each buffer.

Input Range Type
Normally, the driver determines the input range type for a DAS-801 or
DAS-802 board (bipolar or unipolar) by reading the configuration tile.
You can change the input range type without modifying the configuration
file by using the DAS800-SetADGainMode function.


Note: The input range type of the DAS-800 board is always bipolar.


Use the DAS800-GetADGainMode function to get the current input
range type. If you never used DASSOO SetADGainMode,
DAS800 GetADGainMode reads the%put range type from the
contigu&on file; if you have used DASSOO-SetADGainMode.
DAS800-GetADGainMode reads the last input range type you
programmed through software.

Gains
DAS-800 boards measure analog input signals in the range of f5 V.
DA%801 and DAS-802 boards measureanalog input signals in one of
several software-selectable unipolat and bipolar ranges. For each channel
on aDAS- or DAS-802 board, you can select one of five bipolar and
four unipolar analog input ranges.


Z-5
chap02-.frm Black 6




Table 2-2 lists the analog input ranges supported by DAS-800 Series
boards and the gain and gain code associatedwith each range. (The gain
code is used by the FCD functions to represent the gain.)


Table 2-2. Analog Input Ranges



Board isi Gal" Gain Code
I DAS-800 1fS V 1Not available 1 lo I




4


Channels
The analog input channels are the analog input connections from which
you acquire data. DAS-800 Series boards contain eight on-board analog
input channels, numbered 0 through 7. If you require additional channels,
you can use any combination of up to eight I&channel EXP-16 or
EXP-16/A expansion boards and/or 8-channel EXP-GP expansion boards
to increase the number of available channels to 128. You can also use up
to four MB-02 backplanes to increasethe number of available channels to
68.




2-6 Available Operations



4
chap02-.fnn Black 7




Expansion boards are assignedto consecutive on-board analog input
channels, beginning with on-board channel 0. To ensure that the DA.%X00
Series Function Call Driver reads the channel numbers correctly. you
must attach all EXP- I6 and EXP-16/A expansion boards first, followed
by all EXP-GP expansion boards. You can also use the remaining
on-board channels. Refer to the DAS-800 Series User's Guide or the
appropriate expansion board documentation for more information.

The maximum supported configuration is eight EXP-16 or EXP- 16/A
expansion boards, eight EXP-GP expansion boards, or four MB-02
backplanes. Table 2-3 lis!s the software channels associatedwith each
expansion board.


Table 2-3. Channels In Maximum Configuration

Software Channels




4 4




Figure 2- 1 illustrates the use of one EXP- 16 expansion board, two
EXP-GP expansion boards, and the five remaining on-board channels.
The channels on the EXP-16 attached to analog input channel 0 are
referred to in software as channels 0 to 15; the channels on the EXP-GP
attached to analog input channel 1 are referred to in software as channels
16 to 23; the channels on the EXP-GP attached to analog input channel 2
are referred to in software as channels 24 to 3 1; the remaining five



2-7
chap02-.frm Black 8




on-board analog input channels (3,4,5.6. and 7) are referred to in
software as channels 32,33,34, 35, and 36.




rl
I
EXP-16
channels
0.16
I


o-
l-
DA8400 :
sorts. Board
:

;


Figure 2-1. Analog input Channels



You can perform an analog input operation on a single channel or on
multiple channels. The following subsectionsdescribe how to specify the
channel(s) you are using.

Single Channel
You can acquire a single sample or multiple samples from a single analog
input channel.

For single-mode analog input operations, you can acquire a single sample
from a single analog input channel. You use the K-ADRead function to
specify the channel and the gain code.

For synchronous-mode and interrupt-mode analog input operations. you
can acquire a single sample or multiple samples from a single analog
input channel. You use the K SetChn function to specify the channel and
the K-SetG function to specify the gain code.




2-8 Available Operations
chap02-.frm Black 9




Multiple Channels Using a Group of Consecotlve Channels
For synchronous-mode and intemrpt-mode analog input operations, you
can acquire samples from a group of consecutive channels. You use the
K-SetStartStopChn function to specify the first and last channels in the
group. The channels are sampled in order from first to last; the channels
are then sampled again until the required number of samples are read.

For example, assumethat you have an EXP-16/A expansion board
attached to on-board channel 0. You specify the start channel as 14, the
stop channel as 17. and you want to acquire five samples. Your program
reads data first from channels 14 and 15 (on the EXP-16/A), then from
channels 16 and 17 (on-board channels 1 and 2). and fmally from channel
14 again.

If you are not using any expansion boards, you can specify a start channel
that is higher than the stop channel. For example, assumethat the start
channel is 7, the stop channel is 2. and you want to acquire five samples.
Your program reads data first from channel 7. then from channels 0. 1,
and 2. and finally from channel 7 again.

You can use the K-SetC function to specify the gain code for ah channels
in the group. (All channels in a group of consecutive channels must use
the same gain code.) You can also use the K-SetStartStopG function to
specify the gain code, the start channel, and the stop channel in a single
function call.

Refer to Table 2-2 on page 2-6 for a list of the analog input ranges
supported by DAM00 Series boards and the gain code associatedwith
each range.

Multiple Channels Using a Channel-Gain List
For synchronous-mode and interrupt-mode analog input operations. you
can acquire samples from channels in a channel-gain list. In the
channel-gain list, you specify the channels you want to sample, the order
in which you want to sample them, and the gain code for each channel.




2-9
chap02-.frm Black 10




The channels in a channel-gain list are not necessarily in consecutive
order, and you can specify the same channel more than once (up to a total
of 256 channels in the list). For the DAS-801 and DAS-802 boards, you
can use a different gain code for each channel in a channel-gain list; for
the DAS-800 board, every channel must use a gain code of 0 (gain of I).

The channels are sampled in order from the first channel in the list to the
last channel in the list; the channels in the list are then sampled again until
the required number of samples are read.

Refer to Table 2-2 on page 2-6 for a list of the analog input ranges
supported by DAS-X00 Series boards and the gain code associatedwith
each range.


Note: The maximum attainable conversion frequency when using a
channel-gain list is less than the maximum attainable conversion
frequency when using a group of consecutive channels.


You specify the channels and gains in one of the following ways:

. For C and Pascal - You use two adjacent g-bit bytes to specify a
channel and its gain code (the channel number is specilied in the first
byte; the gain code is specified in the second byte). The first two
bytes in the channel-gain list specify the number of channels
(subsequentpairs of bytes) in the list. Figure 2-2 illustrates the format
of a channel-gain list for C or Pascal,where n is the number of
channels (pairs) in the list.




syte 0 1 2 3 4 6 ~..~.~. 2n 2" + 1


Value " than jeahl than /g&l ..- cbn ~ @"

#Of pairs pair 1 pair 2 pair n


Figure 2-2. Channel-Gain List (C or Pascal)



Z-10 Available Operations
chap02-.frm Black 11




Figure 2-3 illustrates a channel-gain list of four channels on a
DAS-801 board: channel 5 is sampled at a gain of 0.5 (gain code = 1).
channel 2 is sampled at a gain of 10 (gain code = 2) channel 4 is
sampled at a gain of 100 (gain code = 3), and channel 2 is sampled at
a gain of 500 (gain code = 4).




"a,"e 0 4 6 1 2 2 4 3 2 4




Figure 2-3. Sample Channel-Galn List (C or Pascal)



After you create the channel-gain list in C or Pascal, use the
K-SetChnCAry function to specify the starting addressof the list.

For Pascal only, you must define a record type for the channel-gain
list before you specify the starting address.Refer to page 3- I9 for
more information.

. For BASIC and Visual Basic for Windows - You use two adjacent
l6-bit words to specify a channel and its gain code (the channel
number is specified in the first word; the gain code is specified in the
second word). The first word in the channel-gain list specifies the
number of channels (subsequentpairs of words) in the list. Figure 2-4
illustrates the format of a channel-gain list for BASIC and Visual
Basic for Windows, where n is the number of channels (pairs) in the
list.




Z-11
chap02-.frm Black 12




Word 0 1 2 2n.1 2n

V&NJ n cflan b-in Ohm win

wOfpairs pair 1 pair n


Figure 24. Channel-Gain List (BASIC)



Figure 2-5 illustrates a channel-gain list of three channels on a
DAS-80 1 board: channel 5 is sampled at a gain of 0.5 (gain code = 1).
channel 2 is sampled at a gain of 10 (gain code = 2), and channel 4 is
sampled at a gain of 100 (gain code = 3).




I Word
IO 11121314151~1
ValUe 3 5 1 2 2 4 3

3 p&s pdr 1 pal, 2 pair 3



Figure 2-5. Sample Channel-Gain List (BASIC)



After you create your channel-gain list in BASIC or Vwal Basic for
Windows, you must use the K FormatChanCAry function to
convert the 16-bit values to X-bit values that the DAS-800 Series
Function Call Driver can use. After you use K-FormatChanCAry to
convert your list, use the K-SetChnCAry function to specify the
starting addressof the list.

Your program cannot read the channel-gain list converted by the
K-FormatChanCAry function; you must use the
K RestoreChanCAry function 10restore the converted list to its
original format.


2-12 Available Operations
chap02-.frm Black 13




Conversion Clocks
The conversion clock determines the time interval between conversions.
For synchronous-mode and interrupt-mode analog input operations, you
can use the K-SetClk function to specify an internal or an external
conversion clock source. These conversion clock sourcesare described as
follows:

. Internal clock source - The internal clock source is tbc on-board
8254 counter/timer circuitry. The 8254 counter/timer circuitry is
normally in an idle state. When you start the analog input operation
(using K-In&art or K-SyncStart), a conversion is initiated
immediately. The 8254 is loaded with a count value and begins
counting down. When the 8254 counts down to 0, another conversion
is initiated and the process repeats.

Because the 8254 counter/timer uses a I MHz time base,each count
represents I KS.Use the K-SetClkRate to specify the number of
counts (clock ticks) between conversions. For example, if you specify
a count of 25, the time interval between conversions is 25 ps; if you
specify a count of 65535, the time interval between conversions is
65.535 ms.

The 8254 contains three counter/timers: CEO, CR I, and C/IT. If you
are using an internal clock source. the 8254 usesboth CM and CK I.
The driver uses C/T2 and