Keithley Data Acquisition assumes no liability for damages
consequent to the use of this Product. This Product is not designed
with components of a level of reliability that is suitable for use in
life support or critical applications.
The information contained in this manual is believed to he accurate and reliable.
However, Keithley Data Acquisition assumes no responsihilit,y 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 olhetwise under any patent rights of Keithley
Data Acquisition.
Keithley Data Acquisition does not wnrrnnr that the Product will meet the Customer’s
requirements or will operate in the combinations which may he selected for use by Ihe
Customer or that the operation of the Program will he uninterrupted or error free or
that all Program defects will he corrected.
Keithley Data Acquisition does not and cannot wxrant the performance or results thar
may he obtained hy using the Program. Accordingly, the Program and its
documentation are sold “as is” without warranty as to their performance
merchantability, or fimess for any particular purpose. The entire risk as to the results
and performruxe of the program is assumed hy you.
All brand and product names mentioned in this manual are trademarks or registered
lrademarks of their respective companies.
Reproduction or adaptation of any part of this documentation beyond that pemiitted
hy Section I I7 of the 1976 United States Copyright Act without permission of
Keithley Data Acquisition is unlawful.
Keithley Data Acquisition - 440 Myles Standish Blvd. - Taunton, MA 02780
Telephone:
(508) 8X0-3000
- Fax: (508) 8X0-0179
Contents
Chapter 1
I.1
1.2
1.3
1.4
1.5
Chapter 2
2. I
2.2
2.3
2.4
2.5
Chapter 3
3.1
3.2
Introduction . . . , . . . . . . . .
About the ASO-TC
Prerequisites
Getting help
Installing the AS0 for DOS
Installing the AS0 for Windows
....
......
......
......
......
......
The Function Call Driver . . . . . . ,
Awilahle operations
Overview of programming with
the Function Call Driver
Board/Driver initialization tasks
Operation-specific programming tasks
Language-specific progranming notes
Functions
Functional grouping
Function reference
.............................
..................................
...................................
. . .
. .
..........
.............
............
............
............
............
. 1
I
2
2
2
4
7
I
I?
I3
I4
21
43
43
47
Appendix A Function Call Driver error messages . . . . . , . . 85
A.1 Error Codes
A.2
Error Conditions
XS
99
Introduction
1.1 About the ASO-TC
The ASO-TC is the Advanced Soliwarc Option (ASO) for the DAS-TC analog
input hoard. The AS0 includes a set of soliwarc components that you can USC.
in conjunction with a programming language. to crate application progrxns
that execute the operations available on the DAS-TC.
The primaty component of the AS0 is the Function Call Driver. This driver
provides your application program with high-level access to the acquisition and
control operations available on the DAS-TC. The AS0 :IISO includes suppon
files, example programs, a configuration utility, antI a data togging utility.
For information on the contiguratiori and data logging utilities. refer to the
DAS-TC User’s Guide.
The Function Call Driver enahles your program to define and execute txzml
operations hy using calls to driver-provided fimctiolls. For example. your
program can call the driver-provided K-ADRead function to execute ;L singlcpoint. A/D input operation.
1
The AS0 includes several different veaions of the Function C;dI Driver. The
.LIB and .TPU versions are prnvided for DOS application development in ‘C’
and Pascal languages. The Dynamic Link Library (DLL) is provided for
Windows application development.
The AS0 and this manual provide the necessary tools, example programs
and information to develop Function Call Driver prr,grilms in the following
languages:
.
Borland C/C++ (version 2.0 and higher)
Chapter I - Introduction 1
.
Borland Turbo Pascal (version 6.0)
* Borland Turbo Pascal for Windows (version I .O)
*
Microsoft C (version 5. I and ahove)
* Microsoft C++ (version 7.0)
* Microsoft Quick C for Windows (version I .O)
.
Microsoft Visual Basic for Windows (version I .O and higher)
Note
If you are using :I version of Turbo Pascal higher 111x1 version 6.0, see section
2.5 for the procedure required to make a Turho Pascal unit compuihle with
your version.
1.2 Prerequisites
The AS0 is designed exclusively for use with the DAS-TC. This manual
assumes that you understand die information presented in the
Guidr.
Addiliomdly, you must complete the hoard installation and
configurat,ion procedures oullined in the
attempt, rmy of the procedures described in this manual.
The fundamental goal of this manurtl is (0 provide you with the informalinn
you need Lo write DAS-TC applicmion progmms lhal use die AS0 driver. II is
recommended that you proceed through this manual according to the sequcncc
suggested hy the rahle of conlents; this will minimize the amounl of time and
effort required to develop your AS0 applicalion programs for the DAS-TC.
1.3 Getting help
The following resources provide infommlion ahout using the ASO:
.
this manual
DAS-TC User’s Guide
DA.!?-TC Uxr’s
before you
Call our Applications Engineering Department if you need additional
assistance. An applications engineer will help you diagnose and solve you,
problem over Ihe telephone.
2
ASO-TC User’s Guide - Rev. A
.
Ihe
LIAS-TC User’s Guide
.
the AS0 example programs (these are copied to your system’s hard disk
during the inslallrrtion procedure)
.
the documentation for the programming language you are using
r
Keithley Data Acquisition
Applications Engineering
508-880-3000
Monday - Friday, 8
ASO package
DAS-TC Serial #
Computer
Version
Invoice/Order #
Base address serting
MklllUfXXUlW
CPU type
Clock speed (MHz)
Math co-processor’!
A.M. - 7 P.M.
xoxx 2X6 3X6 4X6 ort1cr
X I2 20 25 33 Olhcr
Yes No
Compiler
Amount of RAM
Video system
Language
Manufacrurer
Version
CGA Hcrculcs EGA VGA
1.4 Installing the AS0 for DOS
To code AS0 applidons progruns in a DOS-based language. land the
sofiwarc using the ASO-DOS distribution diskettes.
The tiles on the ASO-DOS distribution diskettes are in compressed formar.
You must use the installation program included on the diskettes 1o install the
AS0 sotburc. Since the aggregate size of the expanded AS0 files is
approximately 1.5 MB, check Ihat there is at lea,,r this much space available on
your PC’s hard disk before you attempt to install the ASO.
Perform the following procedure to install the AS0 software (nole Ihat it is
;~ssumed that the floppy drive is designaled u drive A):
I. Make a hack-up copy of the dislrihution diskette(s).
2. Insert ASO-DOS diskette #I into the lloppy drive
3. Type Ihe following comnmmls at the DOS prompt:
A:
[Enter]
install
The imtallation program prompts you for your insl,alla~ion preferences,
including the name of the subdirectory int,o which the ASO-DOS files arc
copied. The installation progr;un expands the tiles on the AS0 diskette(s) and
copies them inter the ASO-TC subdirectory you specilied; refer to the lile
FILESIXX
these files.
[Enter]
in your ASO-TC suhtlireclory for the names and descriplions of
1.5 Installing the AS0 for Windows
To code AS0 applications progrruns in a Windows-hued language, load rhc
software using the ASO-Windows distribution diskettes.
The files on Ihe ASO-Windows diskette are in compressed format. You must
use lhe serup progmm included on rhe diskette to install the software. Since
the aggregate size of the expanded files is approximately 2 MB, check lhiu
there is at least lhis much space available on your PC’s hard disk hefbre you
attempt to install Ihe tiles.
Perfmm the following procedure 10 install the Windows-hased software
(assume thal the floppy drive is designated as drive A):
I. M&e a hack-up copy of the ASO-Windows diskette.
2. Sun Windows.
3. Insert the ASO-Windows diskelte into Ihe lloppy drive.
4. From the Program Manager menu, choose File then Run....
5. AT rhe Command Line t,ype A : \ SETUP. EXE
4 ASO-TC User’s Guide - Rev. A
The setup
progrrun
prompts
you
for
your instnllation
preferences, including the
name of the subdirectory into which the ASO-Windows files we copied. If you
press Continue after you type in the p:~thniune. the setup program expands the
files and copies them into the ASO-TC subdirectory you speciticd; refer trl the
file FlLES.MJC
in your ASO-TC subdirectory for rhe names and descriptions 01
these tiles.
The instdlatitrn process also creates a DAS-TC icon. This icon includes ;L C
eXal@e program, the WI)ASTCCF.EXE cOllfigUratiw1 utility, the dritdtrgger
utility, and
descrihcd in the
RLESMJC.
The configuration utility antI the dntalogger are
DAS-TC Usrr Guide.
Chapter I - Introduction 5
Single-call
operatlons
A/D
The Function Call Driver
2.1 Available operations
The ASO-TC provides you with two types of analog-to-digital (A/D) input
operations:
* Single-call
* Frame-based
The following subsections describe these operations in mom detail
Both types of operations are implemented with functions, to which you pass
parameters. As with any function, you declare the corresponding arguments
hefore making the call.
In a
Input
sirqle-cdl
single call to a titnction. Analog-to-Digital conversion is performed
automatically.
2
A/D input operation, you mad an analog input value using a
You specify the attributes of the operation, such as the hoard that executes the
operation, the channel from which to read data, and the buffer in which to
store the data, as arguments to the function. The data is returned as a single
voltage or temperature value in cngineeting units.
Note The Function Call Driver reads the contiguration lile to determine the gain;
therefore. the gain parameter is ignored.
Use the K-ADRead function to read a single analog input value from a
specitied analog input channel.
Chapter 2 - The Function Call Driver 7
The DASTC-GETCJC function is a special-purpose single-call hmction for
reading the value of the CJC (Cold Junction Compensation) channel. You cxn
use the resulting value to correct a temperature reading in cases where you
want to perform your own linearization.
It” you wish, you can use K-ADRead or DASTC-GETCJC with software
looping to acquire more than one value from one or more channels. Typically,
when you are acquiring more than one value you may want to exercise more
control over the data transfer than is possible with single-call operations. In
such caes, use a frame-based operation, described next.
Frame-based A/D Input A
frame-based
input operadon is nornndly used to sample more than one value
operatlons from one or more channels. In the case of the DAS-TC, the data returned
consists of as many voltage or temperature values as there are analog input
samples. The values we returned in engineering units.
A frame-hased operation uses a single data structure called a frme to
represent the controllable attributes of the operation for a particular hoard. You
request a frame hy calling the function, K-ADFrame.
A frame-based operation is realized :IS a sequence of function calls. At a
minimurn, a frame-hased sequence includes functions that nnmage and set
frame elements, followed hy a function that performs the actual transfer 01
values.
The controllable attributes of the operation, such as die start channel, stop
channel, and number of wnples, arc known as frame &m~ws. The follrrwing
table lists the frame elements awilahle for the ASO-TC and the corresponding
function used to set each element. Refer to the appropriat,e function descripl,ion
in Section 3.2 for the valid settings of a frame’s elements.
8 ASO-TC User’s Guide - Rev. A
Element Function Page
Start/Stop Cliannel
I
Chrumel-Gain Array
I
Address
I
Number of Samples
Data Buffer Address
Buffering Mode
I
K-SetStartStopChn
I
1 K~FonnntClmGArv 1 57
K_Rcs~o~cCI~GA~ 15
1 K SetClmGArv 1 7!, 11
le
K.JntAlloc
K-SetBuf
K-SetButL
K-SetButR
I
K-SetContRun
K ClrContRun
I
I
I
x2
69
76
17
7x
XI
5s
I
II
I
I
One fr;lme corresponds to one set of element vdues. Once you set the frame‘s
elements. you can pass all of the settings to the function Itiat sliww the A/D
operation, using only the franw
hoard from which you called K-GetADFrame).
lf several operations acquiring data from a particular howd use the s;une
element settings, they can pass the same frame handle. Aftcwartls. you should
rele&se the frame by calling K-FreeFrame. The Function Call Driver allows
you to request up to eight frames, regardless of which hoard you arc using
when you call K-CktADFrame. For example. you could use live francs for
hoard I and three frames for hoard 2. Similarly, you could use eight fnlmes for
hoard I: however, no frxnes would he available for hoard 2 ill this exanlple.
Note Each of the programming languages is supported hy 2~ tile that contains a
definition of the FRAMEH variahle type. Therefore, you must tleclarc ;iII
frame handles to he of this type.
hrmlle.
which idcntilies the frame (;ud the
Chapter 2 - The Function Cd1 Driver
9
Operation Modes
For the DAS-TC, frame-hased A/D operations ;Lre availahlc in two modes:
* Sytlcllrotlous
.
Interrupt
In
Synchronous
Call Driver, which acquires and converts data in the foreground. After the
specilied number of samples is acquired, the driver retutns control to lhe
application program. This operation mode is easier to program than interrupt
mode operations. It should not be used if some procedure requires a block of
data before executing and/or needs to monitor or contt’d the transfer. USC the
K,SyncStart function to start a frame&used operation in synchronous mode.
Inlerrupt mode allows the hoard to acquire and convert data in the hackground
while the application program retains control. The DAS-TC interrupts the
application when an acquired block of samples is ready to he transferred to a
user-defined buffer. The Function Call Driver’s interrupt handler gets control
just long enough to complete a block transfer; this period is sufficiently hricf
as to he imperceptible. Interrupt mode is useful when monitoring and contrd
over the tramfer is desired, concurrent, processing (without loss of data
integrily) is desired. or when blocks of acquired data must be partially
processed hefore the requested t,ransfcr is completed. Use the K-IntStart
function to starl a frame-based operation in interrupi mode.
mode, the frame-hased sequence passes control to the Function
Note On the DAS-TC, data is transferred in blocks. where block size = the numhcr
of channels specilied. Suppose, for example, you have requested 43 samples
using ten channels. The Function Cdl Driver actudly acquires 50 values in
tive blocks of ten samples each. The first 40 values are transferred from the
first four blocks that have been acquired, and the remaining three samples are
transferred from the fifth acquired block of ten samples.
Input Buffers
The Function Call Dtiver stores acquired samples in a buffer that you deline
with one of two methods:
* Locally delined (user-delined)
.
Dynamically allocated
Once you have delined a buffer hy one of the two methods, USC ii K SetRuf
call to pass the buffer Wlress to lhe Function Call Driver.
-
10 ASO-TC User’s Guide - Rev. A
You must define a local huffer as an array hefore you call K-SetBuf. You can
also use a local buffer for more permanent storage hy using K-MoveDataHuf
to move acquired data into your local buffer.
Use K-IntAlloc to dynamically allocate memory outside of your program arca
for later release with K-IntFree. If you are running in Windows standard
mode and transferring data using interrupts, you must use a dynimtically
allocated huffer to receive the acquired data, since your program’s memory
pointers may shift.
You can USC a combination of local and dynamically allocated huffem fur
storing blocks of acquired samples. The function. K-MoveDataBuf, provides a
convenient method, particularly in Visual Basic, for moving acquired data from
a dynamically allocated huffer into a local buffer.
Buffering Mode
You can specify either
SINGLE-CYCLE
or
CONTINUOUS
huffcring mode for
interrupt operations. In Single-Cycle mode, the spcciticd munher of samples is
stored in the huffer and the operation stops automatically. Use the
K-ClrContRun function to specify Single-Cycle buffering mode.
In Continuous mode, the hoard keeps acquiring the same number of new
values, placing the data in the huffer until it receives the stop function.
K-IntStop. The transfer index and huffcr pointers are reset hefore another
transfer cycle is initiated. and acquired values in the huffcr are overwritten
Use the K-SetContRun function to specify Continuous buffering mode.
If you do not specify Continous buffering mode, the DAS-TC defaults to
Single-Cycle mode.
Note If you are acquiring data using interrupts and Continuous huffcring. as soon as
the last, block of samples is transferred,
.
the transfer count and huffcr pointer are reset te zero.
. K-IntStatus returns zero instead of the requested satnplc size in the
inrle\-
parameter, and
.
the driver hegins to overwrite your buffer’s data.
If your application requires consecutive blocks of data, you shuuld hcgin
processing your huffer Oefore your huffer is full, using K-IntStatus tn
determine how many blocks have heen transferred (this function’s in&.r
parameter increments by the block size).
Chapter 2 - The Functinn Call Driver 11
2.2 Overview of programming with the Function Call Driver
The procedure to write a Function Call Driver program is as follows:
I. Define the application’s requirements.
2. Write the program code.
3. Compile and link the program.
The subsections Ihat follow describe the details of each of thcsc st,eps.
Defining the
application’s
requirements
Wrltlng the
program code
Compiling and linking Reitir to Section 2.5 for compile and link instructions and other language-
the program specific considerations for each supported language.
Before you begin writing the program code, you should have a clear idea of’
the operations you expect your program to execute. Addidonally, you should
determine the order in which these operations must he executed and the
characteristics (number of samples, start and stop channels, and so on) that
define each operation. You may find it helpful to review the list of availahlc
operations in Section 2. I and to hmwse through the short descriptions of the
Functions in Section 3. I.
Several sources of information relate to this step:
* Section 2.3 explains the initial programming tasks that all Function Call
Driver programs must execute
* Section 2.4 describes typical frame-hased sequences of function calls
.
Section 3.2 provides detailed information on individual fuunctions
* The AS0 includes several example source code tiles for Function Call
Driver programs. The FILES.IX)C file in the ASO-DOS installation directory
lists and describes the example programs. The FILES.IX)C in the ASOWindows installation directory lists and discribes the example programs
that run in Windows only.
12 ASO-TC User’s Guide - Rev. A
2.3 Board/Driver initialization tasks
Every Function Call Driver program must execute the following progr:unming
tasks:
1. Identify a function/variable type definition file
The method to identify this file is language-specilic; reler to Section 2.5
for additional infomlation.
2. Declare/initialize program wriahles
3. Call DASTC DevOpen to initialize the driver
4. Call DASTC-GetDevHandle to initialize the hoard and get a device
handle for the hoard.
The tasks listed are the minimum tasks your progrxil must complete hcforc it
attempts to execute sly operation-spccilic tasks. Your application may require
additional hoard/driver initialization tasks. For example. if your program
requires access to two hoards. then it must call I)ASTC_(;etI)evHandle tilr
each hoard.
Note
A
device handle
is a variable whose value identities an installed hoard. The
purpose of a device handle is to provide a mechanism through which the
Function Call Driver can access a hoard. A device handlc is also ;L amvcnicnt
method for different function calls to reference ihe same hoard. Each twwd
must have n unique device handle.
Each of the programming languages is supported by ;I file that contains a
definition of the DDH (for
DAS fhice Hrmdle)
varinhle type: you should
declare all device handles to he of this type.
Chapter 2 - The Function Call Driver
13
Operation-specific programming tasks
After you perform the hoard/driver initialization tasks. perform the appropriate
openrtion-specil~ic tasks, as follows:
.
For Single-Call A/D Operations - The only operation-spccitic task required
is using the appropriate single-call A/D function (K-ADRead or
DASTC-GETCJC).
.
For Frame-Bared A/D Operations - The operatiol~l-specilic tasks required
for frame-hased A/D operations depend on whether you are using
synchronous or interrupt mode, whether you are using Stan and Stop
channels or Channel-Gain arrays, and whether you are using I~rcal huffcrs
dynamically allocated buffers, or both. For the page number that
corresponds to the operation you want to perform. set the table shown
below.
Note
Operation
I
I Sy”cllr”n”us /
/ Synchronous I
I
I
’ Do not use this sequence if you are running in Windows standard mode
If you do no1 use the functions that set a frame‘s elements, the Function Call
Driver defaults to the values that resulted fnmi frame inilialization.
mode
Syncl1r”n0us
Syncllr”n”us Channel-Gain army
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Intermpt
I
Method of specifying
acquisition channels
Start/Stop clxumels
Slarl/St”p channels 1 Dynamic
Channel-Gain array
Start/Stop channels Local ’
Start/Stop channels Dynamic I7
start/stop ch:ulnels Both
Cllannel-Gain array I Local ‘ / IX 1
I
Channel-Gain array Dynamic
I
Chamu3-Gain anay
I
I
I
Dynamic
I
Local
Local
Both
I I
I ‘5 I
I I
I I
I I
I I
IS
I6
I6
17
IX
I9
20
You must pass the address of the buffer that is receiving the data, by calling
K-SetRuf, K-SetRufI,, or K-SetHufR. The choice of K-SetHuf. K-SetHufl,,
or K,SetBufR depends on the pr”granm~ing language and buffer type. See
Section 3.2 for more information on these functions.
if this function is no1 included; however, the frame element,
default value of zero, and no samples arc rcturncd.
14 ASO-TC User’s Guide - Rev. A
No error mcssagc occurs
BufAddr,
h;~s ii
Synchronous, Start/Stop channels, local buffer only
Use this calling sequence tn perform a synchronous transfer, using Start/stop
channels and a local buffer only. Before calling the functions in the sequence.
define :L local buffer as ;m army of four-hyte elements.
I.
Call K-GetADFrame to get the handle to :UI A/D frame.
2.
Call K,SetRuf, K-SetRufL. or K-SetRufR to assign the huffcr xldrcss
previously ohtainetl to lhe Buffer Address element in the frame.
3
Call K-SetStartStopChn lo assign values IO the SIXT and Stnp Chrumcl
elements in the frame.
4.
Call K-SyncStart tn start the operation. Data is stored in the I~x;~I huffer.
5.
Call K-FreeFrame to return the franc tn the pool of available fmmcs
obtained. unless you are starting another sequence that uses the wne frame.
Use this calling sequence to perform a synchronous transfer using Start/Stnp
channels and a dynamically allocated buffer only.
I.
Call K-GetADFrame to get the handle to an A/D frame
2.
Call K-IntAlloc tn allocate the huffcr into which the driver stnres the A/D
values outside of the program’s memory area.
3
Call K,SetRuf, K-SetBufL. or K,SetRufR to assign the buffer :alrlress
previously ohtnined In the Buffer Address element in the frame.
4.
Call K,SetStartStopChn to assign values to the Stwt and Stop Channel
elements in the frame.
5
Call K-SyncStart to start the operation. Data is accessed via the pnintcr
.
returned hy K-IntAlloc.
6.
Call K-IntFree to deallocate the buffer,
Call K-FreeFrame IO return Ilie fmnte In rltc pool of available frames
I.
obtained, unless you are starting annther sequence that uses IIIC same fmmc.
Chapter 2 The Function Call Driver
15
Synchronous, Channel-Gain array, local buffer only
Use tllis calling sequence to perfoml a synchronous lransfer using a ChaxnelGain array and a local buffer only. Before calling the timctions in the
sequence, define a local huffcr as an array of four-hyte elements.
I.
Call K-GetADFrame to ger the handle to an A/D frame.
Define and assign values to a Channel-Gain array.
2.
Call K,SetRuf, K-SetRufL. or K-SetRufR to assign the buffer address
3.
previously declared to the Buffer Address elemenl in Ihe frame.
4.
Cal I K-SetChnGAry to assign the Channel-Gain array IO Ihe Channel-Gain
Array Address elemenr in the frame.
5
_
Call K,SyncStart to start the operation. Data is stored in lhc local buffer.
6.
Call K-FreeFrame to return the frame to ke pool of available frames
USC This calling sequence I0 perform a synchrontrus transfer using a Channcl-
Gain array and a local huffer only.
Call K-GetADFrame to get the handle to an A/D frame.
1.
Define and assign values 1o a Channel-Cain array.
2.
3.
Call K-IntAlloc to allocate the buffer into which the driver stores the A/D
values outside of the program’s memory area.
4.
Call K,SetBuf. K-SetRufl,, or K,SetRufR to assign the address of the hul’kr
previously declared 10 Ihe Buffer Address elemenl in the frame.
5
_.
Call K-SetChnGAry tr, assign rhc Channel-Gain array to the Channel-Gain
Array Address element in the frame.
6.
Call K-SyncStart to start the operation. Data is accessed via the pointer
returned hy K-IntAlloc.
7.
Call K-IntFree to deallocate Ihe buffer.
8.
Call K-FreeFrame to ret,um lhe frame 10 rhe pool of availahlc frames, unless
you are starting another sequence that uses the same frame.
16 ASO-TC User’s Guide - Rev. A
Interrupt, Start/Stop channels, local buffer only
Use this calling sequence to perform an intermpt transfer using Start/Stop
channels and a local buffer only. Before calling the functions in the sequence.
define a local huffcr as an array of four-byte elements.
I.
Call K-GetADFrame to get the handle to an A/D fr:une
2.
Call K-SetRuf, K-SetBufL. or K-SetRufR to assign the huffcr address
previously declared to the Buffer Address element in the frarnc.
3.
Call K,FetStartStopChn to assign values to the Start and Stop Channel
elements in the frame associated with the fnunc handle previously ohrained.
4.
Call K-IntStart to start the operation
5
Call K-IntStatus to monitor the status of the operation. When cwnpletion is
detected, the data is available in the local huffcr.
6.
Call K-FreeFrame to return the fnunc tn the pool of nvailahlc frames. unless
you are starting another sequence that uses the same frame.
Use this calling sequence to perform an interrupt transfer using Start/Stop
channels and a dynamically allocated huffcr only.
I.
Call K-GetADFrame to get the handle to an A/D frame.
2.
Call K-IntAlloc to allocate a buffer into which the driver stores the A/D
values outside of the program’s memory area.
3.
Call K,SetRuf, K-SetBufL, or K-SetBufR to assign the huffer address
previously declared to the Buffer Address element in the frame.
4.
Call K,SetStartStopChn to assign values to the Stan and Strop Channel
elenients in the frame associated with the frame handle previously obtained.
Call K-IntStart to start the operation.
5.
6.
Call K-InkStatus to monitor the status of the operation. When cwnpletion is
detected, the data is accessed via the pointer returned hy K-IntAlloc.
Call K-IntFree to deallocate the buffer.
I.
Chapter 2 - The Function Call Driver
17
8
Call K-FreeFrame to return the frame to the pool of available frames, unless
you are starting another sequence that uses the same frame.
Interrupt, Start/Stop channels, dynamically allocated and local
buffers
Use this calling sequence to perform an interrupt transfer using Start/Stop
cltam~els and hoth huffcrs. Before calling the functions in the sequence, dctine
a local huffer as an array of four-byte elements.
I.
Call K-GetADFrame te get the handle to an A/D fraane.
2.
Call K-IntAlloc to allocate a buffer into which the driver stores the A/D
values outside of me program’s memory area.
3.
Call K-SetBuf, K-SetBufL. or K-SetBufR tn assign the huffcr address
previously declared to the Buffer Address element in the frante.
4.
Call K-SetStartStopChn to assign values to the Srart and Stop Chamtel
elements in the frame associated with me frame handle previously ohtained.
5.
Call K-IntStart to start the operation
6.
Call K-IntStatns to monitor the status of the operation. When completion is
detected, the data is accessed via the pointer returned by K-IntAlloc.
I.
Call K-MoveDataBuf to transfer the acquired data from a huffer allocated hy
K-IntAlloc to the user-defned array.
x.
Call K-IntFree to deallocate the huffcr
9.
Call K-FreeFrame IO return the frame to the pool of available frames, unless
you arc starting another sequence that uses the same frame.
Interrupt, Channel-Gain array, local buffer only
Use this calling sequence Lo perform :m interrupt transfer using a Channel-Gain
array and a local buffer only. Before calling the functions in the sequence,
deline a local huffcr as an array of four-byte elements.
I.
Call K-GetADFrame to get the handle to an A/D frame, unless you arc
starting another sequence that uses the same frame.
2.
Detine and assign values tn a Channel-Gain array.
18 ASO-TC User’s Guide - Rev. A
3.
Call K-SetRuf, K-SetBuf’I,, or K-SetBuf’R to assign the address of the huffcr
previously declared to the Buffer Address element in the frame.
4.
Call K,SetChnC.Ary to assign rhc Channel-Gain array previously nhtained to
the Channel-Gain Array Address element in the frame.
5.
Call K-IntStart to start the operation.
6.
Call K-IntStatus to monitor the status of the operation. When completion is
detected, data is available in the local huffcr.
I.
Call K-FreeFrame to rchmi the frame 10 the pool of available frames. unless
you are starling a another sequence that uses the same frame.
Interrupt, Channel-Gain array, dynamically allocated buffer
only
Use this calling sequence lo perform an intermpt transfer using a Channel-Gain
array and a dynamically allocated buffer only.
I.
Call K-GetADFrame tn get the handle tn an A/D frame.
2.
Deline and assign values to a Channel-Gain array
3.
Call K-IntAllac to allocate Ihe buffer into which the driver stores the A/D
values outside of the program’s memory area.
4.
Call K,SetRuf, K-SetHufL, or K-SetBufR to assign the address OT the hurfer
previously declared to the Buffer Address element in the frame.
5.
Call K,SetChnGAry to &ssign the Channel-Gain array previously ohtaincd mu
the Channel-Gain Array Address element in the frame.
6.
Call K-IntStart to start the operation
Call K-IntStatus to monitor the status of the operation. When completion is
I.
detected, the data is accessed via the pointer returned hy K-IntAlloc.
8.
Call K-IntFree to deallocate the buffer.
9.
Call K-FreeFrame to return the frame to the pool of available frames. unless
you are starting a sequence that uses the same frame.
Chapter 2 - The Function Call Driver
19
Interrupt, Channel-Gain array, dynamically allocated and local
buffers
Use this calling sequence to perform an interrupt transfer using a channel-Gain
array and both a local and a dynamically allocated buffer. Before calling lhc
funcdons in the sequence, detine a local buffer as im array.
Call K-GetADFrrme to gel the handle to an A/D frame.
I.
2.
Define and assign values to a Chatmel-Gain array.
Call K-IntAlloc to allocate a buffer into which the driver stores the A/D
3.
values outside of the program’s memory area.
4.
Call K-Set&If. K-SetBufL, or K-SetBufR to assign the hul’fer address
previously declared to the Buffer Address element in lhe frame.
Call K,SetChnGAry to assign the channel-gain array previously obtained to
5
the Channel-Gain Army Address clement in the frame.
Call K-IntStart to start the operation
6.
Call K-IntStatus to monitor the status of the operation. When completion is
I.
detected, the data is accessed via the pointer returned hy K-IntAlloc.
Call K-MoveDataBuf to transfer data from a buffer you have allocaled by
8.
K-IntAlloc to the array.
9.
Call K-IntFree to deallocate the buffer
IO.
Call K-FreeFrame to return the frame to the pool of available frames.
20 ASO-TC User’s Guide - Rev. A
2.5 Language-specific programming notes
This sectinn provides specific programming guidelines for each of the
supported liuiguages. Additional programming infomlation is available in the
AS0 example progrzuns. Rcfcr to the FILESDOC lile for names ;1nd
descriptions of the AS0 cxamplc programs.
Note The example progrruns in this section are no1 actual programs hut arc
fragments that arc designed to illustrate iul interrupt-mode A/D input sequence
that uses a Channel-Gain array.
Borland C/C++ and Microsoft C/C++
Related Flies DASTCLIB
DASRFACE.LIB
USERPR0T.H
USERPROT,BCP
Compile and Link
InstructIons
Code example
Rorland C:
BCC
-ml fi1ename.c dastc.lib
dasrface.lib
Borland C++
If you want to compile your prtrgram as a Borlruid C++ progr:un.
1. Use the supplied tile USERPROT,BCP instead of USERPR0T.H
2. Specify the C++ compilation in one of the following two ways:
a. Specify .CPP iis the extcrision for your source tile. or
h. USC the BCC -1’ command line switch.
Microsoft C/C++:
CL /AL /c fi1ename.c
LINK filename
,,,DASTC+DASRFACE;
This example executes an interrupt-mode A/D sequence using a Channct-Cain
array.
// Release memory used by the frame.
if ( ( Err = K-FreeFrame( AD_brdO 1
.\W,
( (Status
(
Printf("Error %x Occurred during K_IntStop call. .'ln*
return 1;
I
Cm
= 0; m i Samples ;
printf("Sample No. %d
(
PrintfVError %x Occurred during
Err) ;
return 1:
1
& 1) && !-kbhit0 1;
m++)
%ld\n", mcl, LocnlBuffel~[mJ,;
, != 0,
K-FreeFrame
call.
Borland Turbo Pascal
Related Files DASTCTPU
Complle and Link
instructions
TPC/$E+ /$N+
In the Turhn environment
filename.pas
Chapter 2 - The Function Call Driver 25
the exmple program shown below, you must create a TPU (Turbo Pascal unit)
tile that is comprttihle with your version. In FILESDOC you will find ;I
reference to DASTCTPU.BAT. Rml this hatch file in order to crcatc the
compatible TPU. The Ale, DASTCTPU.BAT contains the DOS command:
tpc DASTC.PAS
This tile also includes the sources for the TPU, and a description of this
procedure.
Code example
This example executes :m interrupt-mode A/D sequence using a Channel-&tin
array.
Program tpexamp2;
(
Interrupt Mode A/D transfer with Channel/Gain Array
I. Load frlenume.C inlo lhe Quick C fbr Windows environment il’ you arc
editing Otis file.
2. Create a project lile, that includes filentm~e.C, filenamr.DEF,
filencLme.KC
and filenume.H.
3. Select PK(~)JECT l BUILD lo
create a stand-done
.EXE that can
hc
CxeCUted
from within Windows.
The .DEF tile must be included to import fiuxticrns from DASTCDLL.
The programming procedure required to call the functions from Quick C fur
Windows programs is identical to the procedure described for Microsoft C.
This example executes an inrerrupt-mode A/D sequence using a Channel-Gain
wsprintf(szErr,
MessageBox(NULL, szErr," Error ', MB-OK I
MB-ICONEXCLAMATION);
(Err = K-FreeFrame( != 0)
if
wsprintf(szErr,
MessageBox(NULL, szErr," Error ', MB-OK I
MB-ICONEXCLAMATION);
"DASTC Error = %4x", Err);
“DASTC
Error = %4x", Err);
Microsoft Visual Basic for Windows
// Free the frame
// Free the frame
Related
files
Notes
Code example
DASTCDLL
DASTCGLB.BAS
Q41FACE.BI
Before you begin coding ytrur Visual Basic prognun. you must copy ((io111
inside the Visual Bid environment) the cot~lents of DASTCGLB.BAS inlo
your applicat,iotl’s GLOBAL.BAS. Use the i’dlowing procedure to xld the
contents ol’ DASTCGLB.BAS to GLOBAL.BAS (you should make il hxk-up
copy ol‘ GLOBAL.BAS hcforc you modil’y it):
1. Select FILE c Arm FILE... from the Visual Basic main menu.
2. Select DASTCGLB.BAS.
3. Highlight the contents of the entire DASTCGLB.BAS lile.
4. Select
EDIT
w COPY IO copy the contents 01’ DASTCGLB.BAS to the
The function calls can he classilied according to the t’unctionnlity that each
provides. This seclion lists each function ;IS a tnemher of one of the l’ullowing
gITl”ps:
3
This section provides shorf descriptions of each timction: rekr to Sectiw~ 3.2
for ndditional information on ciicli function.
Initialization
DASTC~DevOpcn
DASTC-GetDcvHmlle
K-DASDcvlnit
Initialize and configure the driver.
Ohtaiti a device handle.
Reset and initialize the device and driver.
Memory management
K-IntAlloc
K-IntFree
K-MoveDataBuf
Frame management
K-GetADFrame
Frame-element management
Allocate a buffer suitable for m interruplmode A/D operation.
De-allocate NI inlerrupt buffer Ihal was
previously allocated with K-IntAlloc.
Free the memory used by a frame ml
return the frame lo the pool of nvailahle
frm1es.
Obtain the handle to m A/D frame.
K-ClearFrame
K_ClrContRutt
K-GetBuf
K-GetCImGAry
K-GetContRun Get the value of a frame’s Buffering Mode
KmGetStartStopClul
Clears all the elements of im A/D frame.
Set the value of a frame’s Buffering Mode
clement to SINGLE-CYCLE.
Convert a Visual Basic Chmrel-Gain array
into m equivalent Fu‘unctim Call Driver
Clumel-Gab army (Visual Basic Only).
Get the values of an A/D frmmc’s Buffet
Address ml Number of Somplcs clemmts.
Get the value of m A/D frame’s ChamelGain Array Address element.
element.
Get the values of :m A/D frame’s Start
Cl1:m11el and stop Channel elements.
44 ASO-DAS-TC User’s Guide - Rev. A
K-InitFr:une
Inilialize a hoard’s A/D circuitry and set ;UI
A/D frame’s elements to their default
values.
K-RestoreChnGAry
Convert a Function Call Driver Channel-
Gain array into an equivalent Visual Basic
Channel-Gain xray (Visual Basic only).
K-SetBuf
Set the values of an A/D frame’s Buffer
Address and Number of Samples elements
(Pascal and C languages only).
K-SetBulL
Set the values of a frame’s Buffer Address
and Nutnher trf Samples elements for user-
defined long integer arrays (Visual Basic for
Windows only).
K-SetBulR
Set the values nf ~1 franx’s Buffer Address
and Number of Samples clenlents for uscr-
detined floating-point arrays (Visual Basic
for Windows only).
K-SelChnGAry
Set the value of n frame’s Channel-Gain
Array Address element.
K-SelContRun Set the value of ;L frame’s Buffering Mode
element to
CONTINU(NS.
K-SetStartStopChn Set lhe values of an A/D franc’s Start
Channel and Stop Channel elements.
Frame-based operation control
K-IntStart
K-IntSratus
K-IntStop
K-SyncStnrt
Start an interrupl-mode A/D oper;dinn
Determine the stams of an interrupt-nwde
A/D operation.
Ahort an interrupt-mode A/D operation.
Stan a syltchn,tlous-tnode A/D operation.
Chapter 3 - Callable Functions
45
Single-call l/O
K_ADRcad
DASTC-GETCJC
Miscellaneous operations
K-GetErrMsg
K_GetVcr
Rend a single A/D mluc.
Returns tile value of the CJC on the DAS-
TC in degrees Celsius; this value is used to
correct temperalure input values.
Get the address of ;ul error message string
(avvailahle only as C-language function).
Determine the driver revision and driver
specilication.
46 ASO-DAS-TC User’s Guide - Rev. A
3.2 Function reference
This section contains reference entries each function. The entries qpear in
alphatmical order by function KUW These referctice entries provide the details
associated with the use of each function.
The information related to the following topics pertains to scvcral functions:
.
the gain codes lhe driver uses lo represent gains ml the A/D input ranges
lhat correspond to each gain
.
the return value li~)r every call to a Functim
Thcsc topics arc described in the next scvcral paragrapl~s and referred to
throughout the reference entries that follow.
Gains
Return values
The AS0 drivers use gain codes to represent gains. The valid gailt codes arc 0.
I. 2, 3: the table below lists the gains that correspml to these gain codes. 2s
well as the A/D input ranges affected hy each gain.
Table 1 DAS-TC gains and A/D voltage gains
gain code
0
I
2
3
DAS-TC
gain
I
125 -20
DAS-TC
-2.5
voltage input range
10 +I0 v
10 x0 1llV
lh6.61 -IS to hO
400 -6.25
to
2s mv
mv
Note Gains arc only available when a channel is configured as a voltage input. You
ccui program the gain only through an A/D input qeratirm that uses ;t
Channel-Gain array. If you are acquiring data hy either a K-ADRead. or ;UI
A/D input operation that uses Start/Stop chatmcls. the gidti frm the .CFG lile
is used.
Strictly speaking, the function return value is of type error. “Returns” is also
used to mean that the driver executes the function and stores the result iti userdctined variables or allocated huffem. Whether used ;~s placeholder, to pass ;I
value, or to contain results from a function return. :I variable must he declared
with a type consistent with the corresponding paramctcr.
Chapter 3 - Callable Functions
47
Number type
The number lype that is returned is either Integer or Floating Point, and is
determined by one of the following:
.
the built-in default (which is the same as the configuration tile ill
distribution time);
.
the default conliguration file (DASTCCFG); or,
.
the specilied configuration tile.
Buffers
When the number type is integer, a twos complement, 32-hit, number is
ret~umed. If it particular channel is configured as a temperature input, the v:duc
retumcd is in ,111 degrees. If a particular channel is conligured as a voltage
input, the value remmed in in microvolts. To convert .Ol degrees to degrees,
divide the value by 100; to convert microvolts to volts, divide the value by
I ,OOO,OOO.
When Ihe number type is Hosting point, an IEEE 32.hit real number is
returned. The value returned is in volts or degrees.
Declare a user-defined data buffer with a type appropriate to the number type
that was conligured.
A single sample is four bytes long. Therefore, you should declare a local
buffer as al array of four-byte elements, the size of which is at least equal to
tlie number of samples you arc requesting.
Declare pointers to buffers allocated by K-IntAlloc with ;I type
that is appropriate to the number type that was conligured.
48 ASO-DAS-TC User’s Guide - Rev. A
DASTC DevODen
Purpose
Initialize and configure the driver
Prototype c
DASErr far pascal DASTC-DevOpen( char f:\r * cffK/r.
char far *
Pascal
Visual Basic for Windows
DASTC-DevOpcn Lih “DASTCdII” (ByVal
rum&vices
Parameters
Notes
DASTC-DevOpen initializes 11x driver according to the information ill cf,F’Fi/z. On
retum,
configuration infomdon.
numl~evicrs );
As Integer) As Integer
Number of devices Mined in
rum&vices
contains the numhcr of devices for which
cfRFile.
cfxFi/c.
Vnlitl vulucs: 1. 2
cfjFi/t,
colit;dris
If cffifrle is -1, the built-in deft~ults ;Lrc used. They are identical to the defdls iii the
DASTCCFG tile when this lilt is initially distributed. This tile specilies tlt:it rhe
device is set as follows:
Chapter 3 - Callable Fuilctions 49
The following parameters have the sam defaults for both TC
hoards:
Normal Mode Rejection
II
Specify 0 for
Freuuencv
Nunlher Tvne I
&File
to cause the driver to search for DASTC.CFG.
60 Hz
Inteaer
II
50 ASO-DAS-TC User’s Guide - Rev. A
DASTC-GETCJC
Purpose
Prototype
Parameters
Notes
Returns the value of the CJC on the DAS-TC in degrees Celsius; this value is
used to correct ten~peraturc input values.
c
DASErr far pascal DASTC-GETCJC ( inl rlrvNrm~/w~, Iloat far * C.ICwn/> );
Pascal
Function DASTC-GETCJC ( &wV~m~bw : Intcgcr; Vx C.IC/rmp : Single ) :
Word:
Visual BASIC for Wlndows
DASTC-GETCJC Lib “DASTCdll” (ByVal &wN~m~/wr As Integer. CK’rcr?~/?
As Single) As Integer
dn~Vum/x!~ Board number. Valid values: 0.
CJCwq>
CJC sensor temperature value in degrees Celsius.
1
This function call reads temperature at the STA-TC or STC-TC terminals.
Upon return. CJCtmr/) contains the CJC (Cold Junction Compensation)
tcmpemturc associated with the device identilied hy rlrvNun~/w~. The value
stored in CJCfenzp is floating point regardless of the format specitied in the
configuration Me.
In order to obtain a temperature reading from a thermocouple type not
recognized by the Driver. you need to perfomi your own linearization For :L
corrected temperalure reading, you c;m call DASTC-GE’KIC and use the
resulting value to correct the linearization.
Depending upon the volariliry of the ambient temperature where the CJC
resides, the more samples you take, the more often you should call
DASTC~QETCJC.
This call does not use a frame.
An ermr is returned if XI Interrupt operation is in progress.
Chapter 3 - Callable Functions
51
DASTC GetDevHandle
Purpose
Prototype C
Obtain a device hundlc.
DASErr far pascal DASTC_GetDcvHandle ( int devNumber, void far * far *
devHmdlr );
Pascal
Function DASTC-GetDcvHandle( devNumOer : Integer; Var
Word:
Visual Basic for Windows
DASTCGctDevHandle Lih “DASTCdII” (ByVal rlevN~&xr As InIeger.
&vHun& As Long) As Integer
Parameters
Notes
On return,
devNumher.
devHundie
devHundle :
Lrnigint ) :
Device number. V:did values: 0, I
Device handle
contains the handle associated with the device idcntilied hy
The value returned in
devHandl~~
is intended to he used exclusively iis XI argument
to functions that require a device handle. Your progr~n should no1 modify the value
returned in
&vHnwdle.
The driver supports up to two DAS-TC hoards; a unique h:mdlc tnust hc associntcd
with each supported hoard.
In addilion to ohlaining a device haldIe, DASTC_(;etl)evHandle performs the
following tasks:
.
ahorb all in-progress A/D operations
.
checks if device identilied hy
.
checks if settings in conliguration lile match actual hoard settings
.
initializes the hoard to its default state
devHc~td/c~
is present
52 ASO-DAS-TC User’s Guide - Rev. A
Purpose Read ;L single A/D value.
Pascal
Function K-ADRead( rlevHrrnd/~ : Longint;
,qrrinCorle : Byte; Vw
Afkdue
Visual BASIC for Windows
K-ADRend Lih “DASTCdII” (ByVal dcvH~/~rlk As Long. By&I chwl As Integer.
ByVal gcrinCurlr As Integer.
Parameters
chnn :
: Lo&t ) : Word;
ADvcrl~~e
As Long) As Intcgcr
K-ADRead
Byte;
Notes
See Table 1, page 47 for the A/D voltage ranges and their corresponding gains
The return values ;tre in microvolts or III degrees ror integer types. and arc 1x11
scaled lor bloating point.
This tinction returns XI error if an Interrupt opcmtion is in progress
Chapter 3 - Callable Functions
53
K ClearFrame
Purpose
Prototype C
Clears all the elements of an A/D frame.
DASErr far pascal K-ClearFrame( FRAMEH firmeHandlr );
Pascal
Function K-ClearFrme(
Visual Basic for Windows
K-CleurFrme Lib “DASTCdII” (ByVal frameHandk As Long) As Integer
Parameters
Notes K-ClearFrame
.frameHandle.
framrHnn&~
: Longint ) : Word;
Frame handle
initializes to zero all of the elements in the frame identified hy
54 ASO-DAS-TC User’s Guide - Rev. A
K-ClrContRun
Purpose Set the vitlue of ;L finme’s Buffering Mode element to
Prototype c
DASErr far pnscul K-ClrContRun( FRAMEH
frrrmeHu/~d/r 1;
Pascal
Funct~ion K-ClrCotrtRun(
frmreHmdr
: Longint ) : Word:
Visual Basic for Windows
Parameters
Notes
K-ClrContRun Lih “DASTCdII” (ByVaI
Frrune handle
K-ClrContRun sets the Buffering Mode to
frumeHandlc.
frcmrc~Hcrncllr
SINGLE-CYCLE
SINGLE-CYCLE
As Long) As Integer
in the fr;uuc identified hy
Chapter 3 - Callahlc Functions 55
K-DASDevlnit
Purpose
Prototype
Parameters
Notes
Reset and initialize the device and driver.
C
DASErr far pascal K-DASDevInit( DDH
Pascal
Function K-DASDevlnil(
Visual BASIC for Wlndows
cle~~Hand/r
K-DASDevInit, Lih “DASTCdII” (ByVal
dlevHan& );
: Longint ) : Word;
devHund/e
As Integer
Device handle
K-UASUevInit performs the following tasks:
.
Ahons all in-progress A/D operations
. Checks if device identitied by
devHand1~
As Long)
is present
.
Checks if settings in configuration file match actual hoard setlings
.
Initializes the hoard to its internal defaults or to the configuration tile values
ASO-DAS-TC User’s Guide - Rev. A
56
K-FormatChnGAry
Purpose Convert il Visud Btkc Ch;tnnel-Gain army into XI equivalent Function Cd1 Driver
Chtu~nel-Gain array (Visunl Basic Only).
Prototype Visual Bask for Windows
K-FonnatClmGAry Lib “DASTCXII”
Parameters
Notes A Chruinel-Gain Array delincs two cllaracteristics of ~1 A/D operation:
.
the sequence in which die. input chwnels are sanqkxl ru~tl.
.
Ihe gain npplied to cnch of the clxuunels configured for voltilge in Ihat sequence.
A Chruunel-Gain Array c:w define up 10 I6 r;mdornly sequenced ch:uwz-g;lin pairs
Adjacent pairs C:UI specify the siune channel (with cqual or unequal gains). The
following table illustrates the required fonn;~t of a Chruwz-Gain w~3y for Visual
Basic.
(hrnCninArrcry
As Integer) As Integer
The gnin must he specified ;LS il gnin code. Refer to Table I on page 47 for rhe input
rage affected hy each gain.
Gain Code
Gain
0 I
I
I25
2
166.67
3
400
K-FormatChnGAry convens the Visual Basic Channel-Gain array identilietl hy
chunGc~inArruy
Function Call Driver. On return,
into an equivalent Channel-Gain array hut formatted fbr use hy the
chunCuinArruy
idcntifics the resulting unay, which
replaces the Visual Basic array. TIE function, K-SetChnArray. requires you to pnss
a reference to the resulting array, which is unreadable in Visual Basic. To resort the
array so that it is rcadahle from Visud Basic, use the complementary function,
K-HestoreChnCary.
A Channel-Gain array cnahlcs you to specify different gains for different input
channels.
58 ASO-DAS-TC User’s Guide - Rev. A
K-FreeFrame
Purpose
frinnes.
Prototype c
Function K-FreeFrtune( jkn~+/rmd/r : Longinl ) : Word;
Visual Basic for Windows
K-FreeFrame Lih “DASTCdII” (ByVal frrm~eHrmd/u As Long) As lntegcr
Parameters
Notes
frrmeHrmd/e
K-FreeFrame frees the nietnory used hy the frzune identified hy /k~dfod/c: the
fnnne is then returned to the pool of availnhle frruncs. The franc eletnents are
autotnntic;illy cleared to zero.
Do not use this t‘unction if you pl;ui to use the szunc franc for future ~111s to lhe
driver.
Free the memory used hy :t frrune ;ind return the fratne it to the pool of avxilrrhle
DASErr far pascal K_FreeFrtne( FRAMEH frcm~c~~dle ):
Pascal
Frame h;mdle
Chapter 3 - Callnhle Functions
59
K-GetADFrame
Purpose
Prototype
Parameters
Notes
Obtain the handle to an A/D frame
C
DASErr
FRAMEH
Pascal
Function K-GetADFrame(
Var
Visual Basic for Windows
far pascal K_GetADFrxne( DDH
far * frameHandle );
devHandle
frameHnndlr :
Longint ) : Word;
: Longint;
K_GctADFrame Lih “DASTCdII” (ByVaI
frameHandle
As Long) As Integer
Device handle
On
return,
device identitied hy
frameHnndk
devHandlc.
contains the lundlc to an A/D frame associated wilh the
doHandle,
drvHundk As Long,
60 ASO-DAS-TC User’s
Guide - Rev. A
K-GetBuf
Purpose
Prototype
Parameters
Get the dues of an A/D frame’s Buffer Address and Nunher of Samples elemctas.
Pascal
Function K-GetBuf(
frnmeH~nd/e
: Longint; Var
/mfAddr :
Integer;
Vw sump/~9 : Longint ) : Word:
Visual Basic for Windows
K-GetBuf Lih “DASTC.dIl” (ByVal
frtrmrHrmrl/c~ As
Long.
bufAddr
As Long,
samples As Long) As Integer
Frame handle
Buffer Address
Notes
On return, the following parameters contain the value of au1 element in the frame
identitied by
- DufAddr
.
scrmples contains the value of the Nunher of S;u~~ples element
fwneHondle:
contains the value of the Buffer Address clement
Chapter 3 - Cnllahle Functions
61
K-GetChnGAry
Purpose
Prototype C
Get the value of an A/D frame’s Channel-Gain Army Address clement
DASErr far pascal K-GetChnGAry( FRAMEH
void far * far
Pascal
Function K_GelClmGAry(
Var
chunGainArrr~y :
Visual Basic for Wlndows
K_GetClmGAly Lih “DASTCdII” (By&d
c:hnnGrrinArrtly
Parameters frameHandle
chanC;ainArray
Notes
On return,
element in the frame identilied by
* chnnGuinArroy );
Integer ) : Word;
As Long) As Integer
Handle to A/D frame
Chtumel-Gain Array Address
chanGainArray
frameHandle,
frumeHan&
: Longint;
frameHandle
As Long,
contains the value of the Chrmtlel-Gain Array Address
frameHundlr.
Refer to K-SetChnGAry for a description of Channel-Gain arrays.
62 ASO-DAS-TC User’s Guide - Rev. A
K GetContRun
Purpose
Prototype C
Get the value of a frame’s Buffering Mode element.
DASErr far ptncal K-GetContRun( FRAMEH
short far *
Pascal
Function K-GetContRun(
Var mode : Word ) : WonI:
Visual Basic for Wlndows
K-GetContRun Lib “DASTCdll” (ByVaI
Modr
Parameters
mode
mode );
frrrmeHund/c
As Integer) As Integer
Handle to A/D frame
Code that indicates Buffering Motle.
O=Single-cycle. l=Continuous
frtmwHwrdlr.
: Longint;
frcmreHnnd/r As Long.
Notes
On return, mode contains n code that indicates the Buffering Mode in the fmnic
identified hy
frameHmnd/r.
Chapter 3 - Callahlc Functions
63
K-GetErrMsg
Parameters
Notes
devHund/c?
Device h:tntlle
64 ASO-DAS-TC User’s Guide - Rev. A
K-GetStartStopChn
Purpose
Prototype
Parameters
Get the values of en A/D fnune’s Start Cltnnnel end Stop Channel eletnentS
C
DASErr l’;tr p;tscal K-GetStartStopClu~( FRAMEH firmi~Hcr,td/c,,
shori far * sfal’l. short far * s,o,, ):
Pascal
Function K-GetStartStopClun( frrmreH~nd/e : Longint; VU SI(II’I : Word;
Var
stop
: Word ) : Word;
Visual Basic for Wlndows
KGetStanStopClu~ Lih “DASTCdII” (ByVal finrrte/f~rnd/e As Lung.
mart As Integer. sro[, As Integer) As Integer
Start Clxtnnel. Vxlid v;tlues: 0. 1....,15
Stop Cliwu~el. Valid v:ilues: 6. I,.,., 15
Notes
On return, the following parameters contain the value of itn element in the lmme
identified hy fr~mrHcr~td/e:
.
smr contains tlte value of the Stan Cliannel element
.
stop contains the vnlue ol the Stop Cltannel elenuznt
Clxtptcr 3 - Callahlc Funetinns
65
K-GetVer
Purpose
Prototype
Parameters
Determine the driver revision and driver speciticat~ion.
C
DASErr far pascal K-GetVer( DDH dd/undle, shorl far * s@!c,
SilOrt far * version );
Pascal
Function K-GetVer(
Var
version :
Visual Basic for Wlndows
Word ) : Word;
K-GetVer Lib “DASTCdII” (ByVaI
version
As Integer) As Integer
devHm&
: Longint; Var s/xx: : Word;
devHun&
As Long, qxc As Integer,
Device handle
Driver specilication
Driver version
Notes
On return, spec contains the revision number of the Keithley DAS Driver
Specilication to which the driver confomis;
version
contains the driver’s version
numhcr.
spec and
version
are two-byte integers; the high byte contains the major revision
level and the low hyte ctmtains the minor revision level (in the version number 2.1,
for example, the major and minor revision levels are 2 nntl 1, respectively).
On return, use the following equations tu extract the major and minor revision levels
from either spec or
major revision level =
version:
rerlrmd value
256
66 ASO-DAS-TC User’s Guide - Rev. A
The remainder is dropped.
minor revision level = rrtutm~I vcrlrr~! MOD 256
where
returned
vnlur represents either qxfc or
version.
Chapter 3 - C;tllahle Functions
67
K-InitFrame
Purpose
Initialize II hoard’s A/D circuitry XNJ set an A/D frame’s elements to their default
values.
Prototype C
DASErr far pascal K_lnitFrame( FRAMEH
Pascal
Function K_InitFrame(
Visual Basic for Windows
K~InitFrrune Lih “DASTCdII” (ByVal frameHandle As Long) As Integer
Parameters
Notes
frmeHundlr
K-InitFrame initializes Ihe A/D circuitry on the DAS-TC that is associated with the
frame identified hy
the hoard numher :wsociatetl with the frame idedied hy
frameHundle );
frumeHandle
: Longint ) : Word;
Handle to A/D frame
framcHan&.
If an interrupt-mode A/D operation is not active, K-InitFrame checks the validity 01
frameHrmdle and
enables
A/D operations.
If an interrupt-mode A/D operation is active, K-InitFrame retums an error that
indicates that the hoard is busy.
68 ASO-DAS-TC User’s Guide - Rev. A
Purpose Allocate u buffer suittthle for an iutermpt-mode A/D oper;km.
Pascal
Function K~IntAlloc( fmrne~~~~d/e : Lonyint ; samples : Longlnt;
Var
intAddr
: Longint ; Var
memHrrnd/e : Word ) :
Wurd;
Visual Basic for Windows
K-IntAlloc Lih “DASTCdII” (ByVal frcrmc/f~nrf/r As Long.
ByVal
snmplcs
As Long,
intAddr
As Long,
mcmHond/e
As Integer) As lntegcr
K-IntAlloc
Parameters
Notes
Hnndle to A/D frame
Number of samples. blid values: 045,535
Address of intenupt huffcr
mamHnndle
On return,
intAddr
Handle to interrupt huffer
contains the xldress of :! huffcr that is suit;thle fbr UI intcrruptmode A/D opemtion of scrmples stunpIes; memHrmdk contkns il h;uldlc to the buffer
that this function allocates.
Chapter 3 - Calkkhle Functions
69
K-IntFree
Purpose
De-allocate un interrupt buffer tlxti was previously allocnretl with K-IntAlluc.
Prototype C
DASErr t’ar pascrtl KmlntFree( WORD
Pascal
Function K-IntFree(
Visual Etaslc for Wlndows
K-IntFree Lib “DASTCdI” (ByVal
Parameters
Notes
K-IntFree de-allocates the interrupt buffer itlentitied hy
memHun& );
memHwrrl/e :
Word ) : Integer:
mwnHundle
Handle to intempt Mfer
As Integer) As ltrtegcl
memHuntflr.
70 ASO-DAS-TC User’s Guide - Rev. A
K-IntStart
Purpose
Prototype C
Starl an inlerrupt-mode A/D operation.
DASErr far pascal K-IntStw(FRAMEH
Pascal
Function KJntStart(
Visual Basic for Windows
K-IntStwt Lib “DASTCdII” (ByVaI
Parameters frnmrHrrndlr
Notes
K-IntStart slmls the interrupt-mode
hyfr~meh~tnrlle. An error is returned if ati Interrupt operation is in progress.
Acquired samples are stored at a location identilied by the Buffer Address element 01
the frame identilied by
JkrmeHrrndk );
frrtnreH~md/r :
Lmgint ) : Word;
framrHcmd/e As
Handle to A/D frame
A/D
frrrmeHnnrf/r.
Long) As Integer
opcntion delined in the frume identilied
The values acquired are in microvolts or .OI degrees for integer types. :mtl arc not
scaled for tloating point.
Chapter 3 - Calklhle Functions 71
K-IntStatus
Purpose
Prototype
Parameters
Dctemline the status of an interrupt-mode A/D operation
C
DASErr far poscal K-IntStatus( FRAMEH
long f&r
Pascal
Function K-IntStatus(
Var
Visual Bask for Windows
* index );
index
: Longint ) : Word;
frtlmcHnn&
K-Int~Status Lih “DASTCdII” (ByVal
index
As Long) As Integer
frameHandlf,
: Longint; Var srczrus : Word;
framfHnnd/r
As Long, S~(IIMS As Integer,
Handle to A/D frame
Status
Code that indicates status uf interrupt operation. Valid values:
0 = Interrupt-mode A/D operation idle
~1 = Interrupt-mode A/D operation active
short far *
sfutus,
Notes
Buffer array index. Used by this function to slore the buffer array
index.
On retum, SNAFUS contains a code that indicates the stiltus of the Interrupt operation
defined hy the frame identitied by
frumeHw&; index
cotxains the number of the
next buffer element, at the time the function was called. which is to he written with
the next sample.
For Continuous buffer mode,
index
is reset to zero when the last block transfer is
completed and another acquisition cycle has hccn initiated.
72 ASO-DAS-TC User’s Guide - Rev. A
I<IntStop
Purpose
Prototype
Parameters
Ahort an interrupt-tnode A/D openltion.
Pascal
Function K-IntSttrp(
Vu
indcv
: Longint ) : Word;
Visual Basic for Windows
frrrmeHund/e :
Longint; Var SINUS : Word;
K-IntStop Lib “DASTCdII” (ByVaI ~km2eHrrndle As Long. .SU~IIUS As Integer.
index
As Long) As Integer
frrrmr~Hun&
.St(JtUS
Handle to A/D franc
Code that indicates st;LIus of intemq operation. Valid v;tIucs:
0 = Intempt operatiotl idle
1
= Interrupt operation active (interrupt was stopped)
index
Notes K-IntStop
frameHandle.
when the f’unction was called;
at the time the function was called, which is to he written with the next san~plc.
K-IntStop does nothing if ai interrupt-mode A/D operation is uot in prugress
Buffer array index. Used hy this funcGon lo sore the huffcr ;trray
index.
nhoms the interrupt operation defined hy the iratnc idcntilicd hy
On return, SRUUS contains ;L code that indicates what the status was
index
contains the
nunlher of the
next buffer elcuxxt.
Chnptcr 3 - Callable Functions 73
K-MoveDataBuf
Purpose
Prototype
Transfer acquired A/D samples between a memuty buffer and an array.
c
DASErr far pascal K_MoveDataBuf( int far * desr, int far * SOUIZ’L’,
unsigned int
Pascal
Function K_MoveDataBuf( dest : Longint; SOIU~~J : Longint;
snmplrs : Word ) : Integer;
Visual
K_MoveDataBuf Lih “DASTCdII” (dest As Any, sourc:e As Any,
ByVal sum&s As Integer) As Integer
Parameters dest
samples
samples);
Basic for Wlndows
Address of destination buffer
Address of source buffer
Nmnher of samples tn rransfei
Notes
K-MoveDataBuf moves sarn@es samples from the huffcr at sou,r:e to the huffeel
at
dest.
Although this fbnction is valid for all of the supported languages, it is intended
primarily for use with those languages (such as Visual Basic) that do not provide a
convenient method of accessing memory directly. This function is also needed in
languages that are running in a Windows standard envimrunent, where acquired
samples musl he initially written into a dynamically allocated buffer before rhe data
GIJ~ he stored in a local buffer.
74 ASO-DAS-TC User’s Guide - Rev. A
K-RestoreChnGAry
Purpose
Prototype Visual Basic for Wlndows
Convert
Channel-Gain
a Function Call Driver Channel-Gain array into an equivalent Visual Basic
array (Visual Bkc Only).
K-RestoreChnGAry Lih “DASTCdII”
Parameters chu&uinArmy
Use
Notes
this function to restore the Channel-Gain Array in a i’wtnat readable to Visultl
Storage location for Channel-Gain array
Basic.
Do nor call this function until
(chonGuinAwa,y As Integer) As Inkger
il K-SyncStart
or K-IntStart has heen cdled.
Chapter 3 - Callable Furstions
75
K SetBuf
Purpose
Prototype
Parameters
Notes
Set the values of an A/D frame’s Buffer Address and Number of Samples elements
(Pascal and c languages only).
c
DASErr far pascal K-SetBuf( FRAMEH frclmrHnnd/e, void fur *
long sumples );
Pascal
Function K-SetBuf( frnrdfandle : Longint;
bufAddr
: Longint;
DufAddr,
.wmpl~5 : Longint ) : Word:
Nutnhcr of Samples (145,535)
K-SetHuf
frmeHandle:
assigns values to the following elctncnts in the fraue identilicd hy
.
Ihe Buffer Address element is nssigncd the value in
.
the Number of Samples element is assigned the value in .raraplrs
If using Visual Basic for Windows,
hufAddr
must he the address 01‘ :I dyn:unic~lly
/mfAddr
allocated buffer obtained from K-IntAlloc. For user-defined arrays, see K-SetBufL
ii’ integer type is contigured, and
K-SetHufR
it’ Ilonting-point type is conligurcd.
76 ASO-DAS-TC User’s Guide - Rev. A
K-SetBufL
Purpose Set the values of a franc’s Buffer Address and Number of Santples elenlents for
user-defined long integer arrays (Visual Basic for Windows only).
Prototype Visual Bask for Windows
K-SetBulL Lib “DAS 16OO.dll” ( ByVal
ByVal sc~mplrs As Long) As Integer
frmrHcrndlr
As Lung.
hr?fAddr As LOII~.
Parameters frumeHandlr
Notes K,SetHufL
srrmples in the fnune identified hy
France handle
Address of user-created buffer tlclined as a long xray
Number of s;unples to he stored in huffcr
sets the Buffer Address to
jrcmr~~Hrrndlc~.
hufAddr
and the Nutnher of Sxnples to
Chapter 3 - Collnhlc Functions 77
K-SetBufR
Purpose
Set the values of a fratne’s Buffer Address and Nutnher of Samples elements for
user-delined floating-point arrays (Visual Basic for Windows only).
Prototype
Visual Basic for Windows
K-SetBufR Lih “DAS 160o.dll” ( ByVal frcrmdfrmdlr As Long,
ByVal scdm&!.s As Long) As Integer
Parameters frameHnndlc
hufAddr
samples
Notes
K-SetHufR sets the Buffer Address to
.srrm~k~ in the franc identitied hy
hfAddr
As Single,
France handle
Address of user-created buffer delinctl as a long array
Nutnher of samples to be stored in buffer
hufAddr
f~umeHandlr.
and the Nuniher of Santplcs to
70 ASO-DAS-TC User’s Guide - Rev. A
K-SetChnGAry
Purpose
Prototype
Sel the value of a t’ramc’s Channel-Gain Array Address element
C
DASErr far pnscal K-SetChnGAry( FRAMEH f,‘cmwHcurcf/c~.
void f:u’ *
Pascal
chunGoinArrrry );
Function K-SctChnGAry( fnrme~undle : Longint;
Var
&nC&Arrcr,y : Integer ) :
Visual Bask for Wlndows
K-SetChnGAry Lih “DASTCdII” (ByVaI fkmeHu&/r As Long.
chwtCrrinA/wy
Parameters
Notes K-SetChnGAry
c‘hnnCcrinArrrry
Wwd;
As Integer) As Intcgcr
Hnndle to A/D t’rrame
Chrumel-Gain Army Address
sets the value of the Channel-Gain Array Address element to
in the franc idcntilied hy I’ramcHandle.
A Channel-Gain Array defines two characteristics of im A/D trpemtion:
.
the sequence in which the input cI~;umcIs are sampled and.
.
the gain applied to each of the channels contigured for voltage in that scqucnc(:
A Clmnncl-Gain Array cm1 define up to I6 randomly sequenced channel-gain pairs.
Adjacent pairs can specify the same clum~el (with equd or unequal gains). The
li~llowing table illustrates the required fwniat of a Chamiel-Gain army fur the C x111
P;Lscal languages.
Byte
V;lk
I)
I 2
N
# of pairs
7
than ~ gain ch:u~ g:dn
pair I p3ir2 pair N
4
5
2N 2N+ I
cI1:ul gaiu
Clqwr 3 - Callable Functions
79
The gain must he specified as n gain code. Refer to Table I on page 47 for the input
rage affected hy each gain.
Gain Code
Gain
0
I I25
I 2
166.61
3
400
A Clxumel-Gain array enables you to specify differenl gains for differcnl inpul
chru111cls.
80 ASO-DAS-TC User’s Guide - Rev. A
K SetContRun
Purpose
Prototype C
Set the value 01’ a frame’s Buffering Mode element to CONTINUOUS.
DASErr
Pascal
Function K-SetContRun( fm?wHmdk : Lougint ) : Word:
Visual Basic for Windows
K-SetContRun Lih “DASTCdII” (ByVal fwne~an~lle As Long 1 As Integer
Parameters frameHun&
Notes
K,SetContHun sets the Buffering Mode to CONTINUOUS in the frame identilied by
frumeHundle.
The default setting for
far pascal K-SetContRun( FRAMEH fmmc+/cmd/~~, shon 1:
Handle to A/D frame
bufcring
nrodr is SINC;LE-CYCLE
Chepter 3 - Cnllahlc Functims
81
K-SetStartStopChn
Purpose
Prototype
Set the values of an A/D fra~nc’s Start Chauxl and Stop Channel elements.
c
DASErr far pascal K-SetSmrtStopChn( FRAMEH
short slop );
Pascal
Function K-SetStartStopChn(
stop : Word ) : Word;
Visual Basic for Wlnctows
K-SetStartStopChn Lib “DASTCdII” (By&d
ByVal
Parameters frnmeHnnde
start
stop
sfarf
frumeHandk,
frclmeHandk :
Longint;
frameHandle
suul :
As Integer, ByVaI stop As Integer) As Integer
Handle to A/D franc
Start Channel. Valid values: 0, 1,...,15
Stop Channel. Valid values: 0, I,...,15
short sfart,
Wad;
As Long,
Notes
K-SetStartStopChn
hy
frameHandle:
.
the Start Channel element is assigned the value in
.
the Stop Channel elenlent is assigned the value in stop
assigns values tu the ldowing elcmcnts in lhe franc identilicd
wrt
During a Start/Stop scan, the gains applied are either the internal defaulls or those
rend from the conliguration tile at load tinx
Use K SetChnGAry to specify a non-sequential clwmcl-scanning sequence and/or
to specify channel gains.
If the Stop channel number is greater than rhe Start channel number, then llle scan
order is
For exatnple, if Stop=13 and Sfart=IO, the scan order is IO,1 1,12, and 13.
82 ASO-DAS-TC User’s Guide - Rev. A
Chapter 3 - Calkthlc Functions 83
K-SyncStart
Purpose
Prototype
Parameters
Notes
Start a synchronous-mode A/D operation
C
DASErr far ~xxcal K_SyncStafl( F’RAMEH frrrmdfondle 1;
Pascal
Function KSyncStart( framcHande : Longint ) : Word;
Visual Basic for Wlnctows
K_SyncStarl Lih “DASTCtlll” (ByVal frclmcHandle As Long) As Intcgcr
Handle to A/D franie
K-SyncStart st;~rt~ rhe
identitied hy
frcmehrrndle.
synchronous-mode A/D operation delined in the frume
An crrnr is returned if iu1 Interrupt operation is in
progress.
The values acquired are in microvolts or .()I degrees for integer lypes. and arc not
sc:~lcd for floating point.
84 ASO-DAS-TC User’s Guide - Rev. A
Function Call Driver
Error Messages
A.1 Error Codes
Error OOOOh No error.
Error 6000h Error In Configuration File
CU4.W
Solution
Error 6001 h Illegal Base Address In Configuratlon File.
The configuration file supplied to DASTC-DevOpcn() is wrrupt or dots not
exist. Il’ lile is known tn he good. then it prohahly cont;tins one ur ntnre
undefined keywords.
Check ii’ the tile exists at the spccilied path. Check l’nr illegal keywords in tile:
the host way to lix illegal keywords is to let the supplied DASTCCFG.EXE
utility do it.
A
Error 6002h
Error 6004h
Error 6006h
CNuse
Illegal IRQ level In Configuration File.
Error openlng configuratlon file.
Illegal Channel Number
The specilied I/O operation channel is nut of rage. The IegaI range is O-15
Sol~rrion Specify legal channel numher.
Error 6006h
Illegal galn.
Appendix A - Function Call Driver crrnr messages
85
Error 6006h
CUlLW
Bad number In configuration file.
An illegal specification of a number is detected in the Conliguration lile. Nolc
that if specifying a hexadecimal number for the
Bnse
Address, that number
musf he proceeded with ‘&H’.
Solution Cheek the numher following ‘Address’ in the Configuration tile.
Error 6009h Incorrect version number.
Error 600Ah Configuratlon file not found.
CU!ASl2
This error is returned hy lhc DASTC-DevOpcn() function whenever lhe
specified configuration tile is not found.
Solution
Error 600Ch
CUUSP
Check the conliguration lile nuuc (spelling!), palh, etc...
Error returning INT buffer.
This error occurs during K-IntFree() whenever DOS retunes an error in INT
2 III function 49H.
Solution
Make sure that the parameter passed to K_INTFree() was previously ohtoined
via K-lNTAlloc().
Error 600Dh
CUUX
Bad frame handle.
This error is usually returned hy Frame Management or an Operation Function
whenever an illegal Frame handle is passed to one of thcsc functions.
Solurion Check the Frame Handle.
Error 600Eh
Error 600Fh
Error 6010h Cannot allocate INT buffer.
Error 6011 h INT buffer already allocated.
No more frame handles.
Requested INT buffer too large.
Error 6012h INT buffer De-Allocatlon Error.
Error 6013h INT buffer never allocated.
Error 7000h
Cuuse
No board name
DASTC-DevOpen() function did not fmd the keyword ‘Name’or a name
following in the specified conliguration tile.
Solution
Make sure Ihat, a hoard nanc is specilied in your configuration lile. The legal
DAS-TC name is: DASTC.
66 ASO-DAS-TC User’s Guide - Rev. A
Error
7001
h Bad board name
Cnusc
DASTC-DevOpen() function found the hoard ‘nzune’ in the specilied
configuration file to he illegal. The legal DASTC name is: DASTC.
Solution Check the name following keyword ‘Name in your contiguration tile
Error 7002h Bad board number
Cnusr
DASTC-DevOpen() firnction found the ‘Board’ number in the specilied
conliguration file to he illegal. The legal hoard nunlhers are II and I.
Solution
Error 7003h Bad base address
Cuuse
Check the number following ‘Board’ in your conliguration lile.
DASTC-DevOpen() function found the hoard’s hasc I/O ‘Address’ in the
specifed conliguration file to he illegal. The legal address are 2tH)h (S 12)
through 3FOh (100X) in increments of IOh (16) inclusive.
,So/ution
Check the number following ‘Address’ in your configuration lilt. NOTE that
to specify il Hex number, the number must he preceded by ‘&H’.
Error 7004h Bad Interrupt Level.
c uuw
DASTC-DevOpen() function found the Interrupt Level in the specified
configuration file to he illegal. The legal Intermpt levels arc 2. 3. 4. 5. and 7.
Solution
Error 7006h Bad Normal Mode Rejection Frequency.
Error 7006h Bad Number Type.
Error 7007h Bad Channel Conflguratlon.
CUUSlJ
Check the number following ‘Intlevel’ in your conliguration tile.
One or more of these conditions exists:
- Channel # is out of range
- Channel argument is illegal
Error 7006h Check Sum Error.
Cause Checksum in communication packet failed, resulting in ;L co~11111uliic~li~~ii
failure.
Error 7009h
Board Not Inltlallzed.
Cause One or more of the following conditions exists:
- A function was called hefore K-DASDevlnit was called.
- The PC Side Board diagnostics done during board initialization failed.
- Attempt to return the DAS-TC ID failed.
- Wrong Base Address.
Error 700Ah
lnltlallzatlon Failure.
Appendix A - Function Call Driver crmr messages 87
Error 700Bh
Protocol Communlcatlon Error.
Error 700Ch
Error 8000h
Error 8001 h
Cm4Sf
Solution
Error 8002h
CUUX
Solution
Error 8003h
Cause
Solution
Bad Voltage to Temperature Calculation Error.
No error.
Function not supported
A request is made to ;L
should not occur
Insure that the function is
function that is nor
in
it srcutdard release sottware.
one lisred in chapler 3.
supported by ;L DAS-TC.
If the problem c:mnol he
This errof
resolved, contx1 the Keithley Technical Support Deparlment.
Function out of bounds
Illegal function number is specified. This error should not occur in :L st;mdard
release soliware.
Contact the Keithley Technical Support Dcpartmenl.
Illegal board number
The driver supports up I,O two hoards: 0 and 1.
Check the hoard numher parameter in your call to DASTC- GetDcvHandleO.
Error 8005h
CLXW
Solution
Error 8006h
Cum!
Error 801 Ah
CUUSC
Solution
No board
This error is issued during K_DASDevlnit() whenever the hoard presence lest
Ms. This is normally caused hy a conflict in the specified hoard 1/O address
and the xtuill I/O address the hoard is configured for. Also, lhis error is issued
when the hoard is not present in the system.
Check the hoard’s base I/O address dip switch and make sure it mulches lhc
base address in your conliguration file.
A/D not lnltlallzed
A Cuncrion was called before K-DASDevInit was called.
Interrupts Already Active.
An attempt is made to start an Inrerrupt-hased operation while anodler is
already act,ive.
Stop current Interrupt mode lirsl and ret,ry.
88 ASO-DAS-TC User’s Guide - Rev. A
A.2
Error Conditions
Voltage/Thermocouple
Error Condltlons
When
;L vollnge/tllennocoupIc input is under or over the voltage range set t’ur :i
particular channel. the DAS-TC responds will) the tbllowing readouts.
For under the voltnge/them~ocouple rang:
* Floating Point is IO,OOO.OO
. Integer is 47 I,227,136
For over the voltage/thcm~ocouple range:
* Floating Point is +lO.OOO.oO
* Integer is +1.176,256.512
Appendix A - Function Call Driver error messages
99
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.