Tektronix DAS-800 Series ASO Function Call Driver Users Guide

cover.frm Black 1
DAS-800 Series
Function Call Driver
User’s Guide
1 titlepgfrm Black 1
DAS-800 Series
Function Call Driver
Revision A - December 1993
Part Number: 66770
noticep.frm Black 1
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.
+b
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
Operation Modes. Memory Allocation and Management Input Range Qpe
.......................................
Gains
Channels
....................................
Single Channel, Multiple Channels Using a Group of Consecutive
Channels
................................
Multiple Channels Using a Channel-Gain List
Conversion Clocks Buffering Mode.
Triggers
.....................................
Analog Triggers Digital Triggers
Hardware Gates. Digital I/O Operations Counternimer I/O Operations.
System Operations.
Initializing the Driver.
Initializing a Board
Retrieving the Revision Level.
Handling Errors.
..........................
.............................
.............
.............................
............................
....
............................
..............................
............................
............................
..............................
............................
.....................
..............................
.........................
............................
...................
..............................
,.,2-l
2-2
.2-3
2-5 2-5
.2-6
.,.2-x
.2-9
.2-9 .2-13 .2-16 .2-16 .2-17 .2-20 .2-22 ,2-24
: :
2-26
2-27 .2-28 .2-29
: : 2-30 2-30
8OOfcd.toc Black iv
Programming with the Function Call Driver
3
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
iv
Function Reference
4
DASXOO-DevOpen ........
DAS800-GetADGainMode.
DAS800-GetDevHandle . ...
DAS800-Get8254 : ........
DAS800&SetADGainMode .
DAS800-Set8254 .........
K-ADRead. ..............
K-BufListAdd ............
K-BufListReset ...........
K-ClearFrame ............
K-CloseDriver K-ClrConiRun
............
............
K-DASDevInit ...........
K-DIRead ...............
........
........
........
........
........
........
........
........
........
........
........
........
........
........
.4-6
.4-9 .4-II .4-13 .4-15 .4-17 .4-19 .4-22 .4-24
,4-26 ,4-28 .4-30
4-32
.4-33
800fcd.toc Black v
K-DOWrite ..............
K-FormatChanGAry
K-FreeDevHandle
K-FreeFrame
.........
.............
K-GetADFrame. ..........
KGetADTrig ............
K-GetBuf. ...............
K-GetChn ...............
K-GetChnGAry
K-GetClk
................
K-GetClkRate ............
K-GetContRun ...........
K-GetDevHandIe. .........
K-GetDITrig .............
K-GetErrMsg. ............
K-GetG .................
K-GetGate K-GetStartStopChn KGetStartStopG
...............
........
..........
K-GetTrig ...............
K-GetTrigHyst. ...........
K-GetVer
................
K-InitFrame. .............
K-IntAlloc K-IntFree
...............
................
K-IntStart. ...............
K-IntStatus ..............
KJntStop. ...............
K-MoveBuffoArray .......
K-OpenDriver
K-RestoreChanGAry
............
.......
K-SetADTrig. ............
K_SetBuf ................
K-SetBufI ...............
K-SetChn. ...............
K-SetChnGAry ...........
K-SetClk ................
K-SetClkRate ............
K-SetContRun. ...........
K-SetDITrig. .............
K-SetG. .................
K-SetGate ...............
.4-35 .4-37
.4-3x .4-39 .4-40 .4-42 .4-44 ,446
. ..4-48
.4-50 .4-52 .4-54 .4-56
. ..4-58
.4-60 .4-61 .4-63 .4-65 ,4-67 .4-70 .4-72 ,4-14 .4-76 .4-7x ,4-80 .4-81 .4-x3 .4-X6
4-88
.4-x9 .4-92 .4-93 .4-95 .4-97
.4-99 ,4-101 .4-103 .4-I05 .4-107 .4-109
..4-111
.4-113
SOOfcd.toc Black vi
K-SetStartStopChn ............................
K-SetStartStopG ..............................
K-SetTrig .................................... .4-120
K-SetTrigHyst
................................ 4-122
K-SyncStart ..................................
A Error/Status Codes
B
Data Formats
Converting Raw Counts to Voltage Converting Voltage to Raw Counts
Specifying an Analog Trigger Level. Specifying a Hysteresis Value.
Index
List of Figures
Figure 2-l.
Analog Input Channels Figure 2-2. Channel-Gain List (C or Pascal) Figure 2-3. Sample Channel-Gain List (C or Pascal). Figure 2-4. Channel-Gain List (BASIC) Figure 2-5. Sample Channel-Gain List (BASIC). Figure 2-6. Initiating Conversions Figure 2-7. Analog Trigger Conditions Figure 2-8. Using a Hysteresis Value. . . Figure 2-Y. Initiating Conversions with an External
Analog Trigger
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
.4-115 .4-l I7
4-124
B-2 .B-3 .B-3 .B-5
.2-x
.2-IO
.2-I1 .2-I2 .2-12 .2-I5 .2-I7
2-19
.2-20
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. Table 3-l. Table 3-2.
Channels in Maximum Configuration. .2-7
A/D Frame Elements. .3-3
Setup Functions for Synchronous-Mode
Operations.. . . . . . . . . . . . .3-7
Table 3-3. Table 4-1. Table 4-2.
Setup Functions for Interrupt-Mode Operations .3-IO
FCD Functions. . .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
write application programs for DAS-800 Series boards using the DA.%800 Series Function 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)
describes how to
. Microsoft Professional Basic (Version 7.0 and higher) . Microsoft Visual BasicTM for DOS (Version 1.0) . Microsoft C/C++ (Version 4.0 and higher) . Borland@ C/C++ (Version I.0 and higher)
l
Borland Turbo Pascal@ for DOS (Version 6.0 and higher)
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 assumed that users have read the
Guide
to familiarize themselves with the boards’ functions, and that they
DAS-800 Series User’s
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-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:
4
. DAS-X00
package that is shipped with DAS-800 Series boards; it includes the following:
-
- Support files, containing such program elements as function
-
-
.
ASO­Software Option for DAS-800 Series boards. You purchase the ASO- software package separately from the board; it includes the following:
Series
Libraries of FCD functions for Microsoft QuickBASIC (Version 4.0) Microsoft QuickBasic (Version 4.5), Microsoft Professional Basic, and Microsoft Visual Basic for DOS.
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,
software package
Libraries of FCD functions for Microsoft C/C++, Borland C/C++, and Borland Turbo Pascal.
standard
software package -This
- This is the optional Advanced
is the software
4
4
l-l
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
compressed format 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 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.
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:
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.
A: SETUP
1-4
Getting Started
chapOl_.frm Black 5
Setting Up the Boards
fb
The installation program expands any tiles that are stored in a compressed format and copies them into the directory you specified
(ASOBOWWINDOWS directory 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.
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.EXE utility 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 address of 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.EXE utility 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.
5. Tested the board(s), if desired.
Getting Help
If you need help installing or using the DA.%800 Series Function Call
Driver, contact the factory.
Note: The DAS-800 Series Function Call Driver supports a maximum of four DAS-800 Series boards.
If you want to test the functions of the boards before writing your application program, use the CTLXOO.EXE utility (for DOS) or the CTLXOOW.EXE utility (for Windows). Refer to the
User’s
Guide
for more information.
DA.5800 Series
l-6
-
chapOl_.frm Black 7
An applications engineer will help you diagnose and resolve your problem over the telephone. Please make sure that you have the following
information available before you call:
Software package Version
Invoice/order #
4
Compiler
Operating system
Computer
DAS-800 board
Language Manufacturer Version
DOS
version
Windows version 3.0 3.1
mode Standard Enhanced
Manufacturer CPU type Clock speed (MHz) Math coprocessor Amount of RAM Video system BIOS type
Model Serial I#
Base address setting Interrupt level setting Input configuration Input range type
8254 C/l? usage
8088 286 386 486­8 12 20 25 33 _ Yes No
CGA Hercules EGA VGA
800 801 802
2 3 4 5 6 7 None Single-ended Differential Unipolar Bipolar Cascaded Normal
4
Expansion boards ‘I)pe
;;: ;;:
5Pe
4
l-7
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 supported operations are listed in Table 2- 1.
Table 2-1. Supported Operations
Operation Page Reference
boards.
The
Analog
Counter/timer l/O
input
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.
page 2-I
page 2-26
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.
2-2
. 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.
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. continuous-mode interrupt operation.
You
can
use the K-IntStatus
of an interrupt operation. In addition, 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.
You
can
use the K-IntStop
function to determine the current status
you can use the K-InitFrame
function 10 stop a
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
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,
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 address of 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
- The local
you can use the K-IntAlloc
function
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 associated with it. You can use the
K-BufListAdd You can use the K-BufListReset
function to add a buffer to the list of multiple buffers.
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 address of the buffer(s) and the number of samples to store in the buffer(s), as follows:
2-4
l
For BASIC
- You use the
K SetBufI
function to specify the starting
address of 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 address of each buffer.
. For Visual Basic for Windows - You use the K SetBufl
function to specify the starting address of a single, locally dimensioned integer memory buffer; you use the address of a single buffer allocated dynamically using When using multiple buffers, you use the
K-SetBuf function
K-BufListAdd
to specify the starting
K-IntAlloc.
function
both to add buffers to the multiple-buffer list and to specify the
starting address of each buffer.
Available Operations
chap02-.frm Black 5
Input Range Type
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 address of a single buffer, whether the buffer was
dimensioned locally or allocated dynamically using When using multiple buffers, you use the
K-BuIListAdd
K-IntAlloc.
function both to add buffers to the multiple-buffer list and to specify the starting address of each buffer.
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.
Gains
Note: The input range type of the DAS-800 board is always bipolar.
Use the
range type. If
DAS800 GetADGainMode
contigu&on file; if you have used
DAS800-GetADGainMode
DAS800-GetADGainMode
you never used DASSOO SetADGainMode,
function to get the current input
reads the%put range type from the
DASSOO-SetADGainMode.
reads the last input range type you
programmed through software.
DAS-800 boards measure analog input signals in the range of f5 V. DA%801 and DAS-802 boards measure analog 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 associated with each range. (The gain code is used by the FCD functions to represent the gain.)
Table 2-2. Analog Input Ranges
4
Channels
Board
I DAS-800 1 fS V
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 increase the number of available channels to
68.
isi Gal”
1 Not available
1
Gain Code
lo I
2-6
4
Available
Operations
chap02-.fnn Black 7
Expansion boards are assigned to 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 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 associated with each
expansion board.
Table 2-3. Channels In Maximum Configuration
DAS-800 Series User’s Guide
Software Channels
or the
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.
EXP-16
channels
0.16
rl
I
I
Single Channel
o-
DA8400 sorts. Board
Figure 2-1. Analog input Channels
l-
:
:
;
You can perform an analog input operation on a single channel or on multiple channels. The following subsections describe how to specify the channel(s) you are using.
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.
2-8
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
the
K-SetG
use the K SetChn
function to specify the channel and
function to specify the gain code.
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
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, assume that 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, assume that 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.
function to specify the first and last channels in the
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
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 associated with
each range.
also
use the K-SetStartStopG function to
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
Loading...
+ 195 hidden pages