Tektronix ASO for DAS-TC/DAS-TC/B Users Guide

ASO-TC
User’s Guide
Revision A
Plimxl June. 1993
Part No. 24469
0 Keithley Data Acquisition 1993
WARNING
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 singlc­point. 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 ASO­Windows 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.
Synchronous Start/Stop channels, dynamically allocated
buffer only
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 Chaxnel­Gain 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
Synchronous, Channel-Gain array, dynamically allocated
buffer only
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.
Interrupt, Start/Stop channels, dynamically allocated buffer
only
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.
,**********~************~**.****~*~**~***~~~**.~**~*.*.*~.*j
/* CEXAMP2.C /*
,* 'C' /* /*
/* To create ~11 EXE using Microsoft C: /* /* /*
/* 1' To create an EXE using Borland C++ (Ver 2.0 dnd up!:
/*
- Interrupt Mode A/D transfer with Channel/Gain Array
CL /c CEXAMP2.C (use /Tp<FileName.. for C++ compile)'; LINK CEXAMPZ,,,DASTC+DASRFACE;
DRSTC‘ f,
* ,' f/
t 'i
f, f.
*i +i .I
*,
Chapter 2 - The Function Call Driver
21
/*
BCC -ml -c CEXAMP2.C dastc.lib dasrface.11b
/* ,***************"*******************~*************~~~*******,
//use this include file statement for MS C #include "userpr0t.h"
//use this include file statement for MS C++
/*
extern "C" (
#include
"userprot.h"
1 */
//use this include file for Borland C++ and use -P switc!h //for C++ compile /*
extern "C" (
#include "userprot.bcp" )
*/
*I */
#include -:stdio.h, #define Samples 16 DWORD LocnlBuffer[Samples];
GainChanTable ChanGainArray =
(
16, o,o,
2,o.
4,o.
6.0.
8.0. lO,O,
12,0,
14.0, l,O,
3,0,
5.0.
7.0.
9.0,
11.0,
13.0, 15,O
I :
22
ASO-TC User’s Guide - Rev. A
main0
I DDH DASTC-brd0 ; // handle for board 0 FRAMEH AD-brd0 ; // frame for board 0 A/D operations
long Index; short BoardNumber, Err, Status, m; char NumberOfBoards; float C.JC=O:
,,----------------------------------------.~.-~-........~~..
// init~ialize board hardware and drivel-
printf("\n"); printf("Initializiny the board - - - PLEASE waitin');
if (( Err = DASTC-DevOpen( "DASTC.CFG". &Numbel-OfBoalds iI
!=O )
(
printf( ' Error %x on Device open ', Err 1 ;
return Err- ;
1
,,~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-~-----------------~~~.~.~. // The DEVICE Handle must be obtained in order to war-k wirh
// a specific
board
// It is used subsequently to obtain FRAME Handles
BoardNumber = 0;
if ( ( Err = DASTC_GetDevHandle( BoardNumber,
1 !=O)
(
printf(
"Error getting Devic!e Handle" I;
LDASTCCbrdO 1
return 1 ;
1
if ( ( Err=DASTC-GETCJC(Bon1-dNumber, LCJC) 1 != 0 !
(
printf(
"Error getting CJC Temperature" 1;
return 1 ;
I
printf("C.JC Temperature = %f\n", CJC);
,,------------------------------------.--..--..-.-.--~~~~--~ // The FRAME Handle must be obtained using the DEVICE Handle
// in order to make each type of function call, // in this case,
// The variable is suffixed with a
if ( (err = K-GetADFrame(
Analog
Input.
DASTC-brd0,
"0" to reference board 0.
GADpb~dO I I != 0 1
Chapter 2 - The Function Call Driver
23
,
printf (
"Error
gett.ing Frame Handle” 1;
return 1 ;
1
,,------------------------------------------~---~--~~-.-..-­// The FRAME Handle is now used in Analog Input czalls.
printf("\n\nInterrupt Mode with Chan Gain Array\n\n\n" 1;
if ( ( Err = K-SetBuf( AD-brd0, LocalBuffer, Samples ) 0 1
(
printf("Error %x Occ!urred during K-SetBuf call. .\I>',
Err);
retLlrn 1;
I
if ( ( Err = K-SetChnGAry( AD.,brdO, &ChanGainArray)
1
(
PrintfVError %x Occurred during K-SetChnGAry call.
.\n", Err);
return I;
)
// u-comment this block of code for continuous run //printf("Continuous //if
(
(Err
= K-SetContRun(
Run
Selected.\n");
AD_brdO ) ) != 0 1
// ( //
Printf("Error %x Occurred duriny K_SetContinRun call.
//.\n", Err);
return 1;
// // 1
) !=
) !=O
if
( i
(
Printf("Error
Err);
return 1;
1
printf("TYPE any key to stop\n\n"); do
(
if ( ( Err = K-IntStatus( AD-brd0 , &Status, &Index ) )
!= 0 )
.\P',
Err);
24 ASO-TC User’s Guide - Rev. A
Err
= K-IntStart(
%x
Occurred during
AD-brd0 ) ) !=O)
K-IntStart call. .\n",
(
Printf("Error %x Occurred during K_IntStatus call.
printf("Conversions completed= %tid\r", Index);
1
while
if ( ( Err = K-IntStop( AD-brd0 , &Status, &Index 1 1 != 0
Err);
printf("\n");
for
printf("\n");
,,~~~~~~~~~~~~~~~~~~~---------~~~~~.....~.~~~~~-~-----------
// 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
For this example ONLY;
the configuration file must speclify
)
uses crt, DASTC;
GainChanTable = Record
num-of-codes : Integer;
queue : Array[0..31]
end;
of Byte;
FLOATING
POINT.
const
ChanGainArray : GainChanTable = ( num_of_codes : (16): queue
: (O,O,
1.0.
2,0,
3.0.
4.0. 5,0, 6,0,
7.0.
8.0.
9.0.
10.0, 11,O.
12,0,
13.0, 14,0,
15.0)
26 ASO-TC User’s Guide - Rev. A
“Fir BufPtr : ^1nteger; BoardNumber, m : Integer; NumberOfBoards : Inteyel- ; status,
Ertn : Word; Samples, Index, DASTC-brd0, AD_brdO : Longint: ConfiyFile : Striny; DataBuffer : Array[0..20] of Real; CJC : Real:
begin
(-----~---~--------~~~~.~~~~~~--------...~..~~~~---------
initialize board hardware and driver 1
BufPtr := @DataBuffer[O]; ConfigFile := 'DASTC.CFG' + #0 ;
Ertn := DASTC-DevOpen( ConfigFile[l], NumberOfBoards i:
if Ertn .:> 0 then
begin
writeln( 'Error ', Ertn, 'on Devicr open' 1;
Halt(l);
end:
(~-~--~-~--~------------------~~~.~~~~~.~~~~~-~~~-~~~----.-~
The DEVICE Handle must be obtained in order to work with a specific board It is used subsequently to obtain FRAME Handles )
BoardNumber := 0; Ertn := DASTC-GetDevHandle( BoardNumbrl, DASTC-brd0 );
if Ertn -:~I 0 then
begin
writeln(
'Error getting Device Handle' );
Halt(l);
end;
Ertn := DASTC-GETCJC( BoardNumber, CJC );
if Ert~n -:r'. 0 then
begin
writeln(
'Error getting CJC Temperature' 1:
Halt(l);
Chapter 2 - The Function Call Driver
27
writeln(
(-~------------------------------------------~~-~-~-.----~~~-
'CJC Temperatur-e = ', CJC 1 ;
The FRAME Handle must be obtained using the DEVICE Handle
in order to make each type of function call, in this case,
Analog Input. The variable is suffixed with a "0' Tao
reference board 0. )
Ertn := K_GetADFrame( DASTC-brd0, AD-brd0 1 ;
if Ertn in> 0 then
begin
writeln(
'Error getting Frame Handle' 1;
Halt(l);
end;
(----------~-----------------------------------..-.
The FRAME Handle is now used in Analog Input calls. 1
writeln(
'Interrupts Mode with Chan Gain Array' 1;
samples := 20; Ertri := I<-SetBuf( AD-brd0, Longint(BufPtr), Samples ) ;
if Ertn <~> 0 then
begin
writeln(
'Error in I<-SetBuf call 1;
Halt(l);
end;
Ertn := K-SetChnGAry( AD-&do, ChanGainArray.num_of_c!ud-ies )
if Ertn .r> 0 then
begin
writrln( 'Error in I<-SetChnGAry czall );
Halt(l1;
end:
Ertn := K-IntStart( AD-brd0 , ;
if Ertn <> 0 then
begin
writeln( 'Error in K-IntStart call' );
Halt(l);
end;
28 ASO-TC User’s Guide - Rev. A
repeat
Ertn := K-IntStatus( AD-brd0 , Status. Index ! ;
if Ertn c:. 0 then
begin
writelni 'Error in K_IntStatus call 1;
Halt(l);
end:
writeln(
until (Status AND I) = 0;
writeln(");
for m := 0 to Samples-I Do
(----------~--~~~~~~-~--------~~~~~~~------------~.~-~...
Release memory used by the frame. )
Ertn := IZ-FreeFrame( AD-brd0 1 ;
if Ertn so> 0 then
begin
end:
end.
'Conversions Completed = ', Index 1;
writeln( DataBuffer[ m I ):
writelnl
Halt(l);
'Error in K-FreeFrame call' );
Related files
Notes
Borland Turbo Pascal for Windows
DASTCTPWJNC DASTC.DLL
For Windows use DASTCDLL. The information presented for Burlnnd Turk) Pwxd applies here with the fdlowing uddikms:
.
Use be compiler direcrivc ($1 .__ ) 10 include lhc supplied include lilt DASTCTPW.INC.
- Substitute ‘WinCrt’ for the ‘Crt’ unit; this is neccssxy in order that the
console I/O procedures (wrileln. rexlln, etc...) opcrme pmpcrly.
Chapter 2 - The Fmdon Call Driver
29
Code example
The following code fragment illustrates Ihese substitutions:
Program TPW-EX:
( UNITS USED BY THIS PROGRAM 1
Uses WinCrt;
( LOCAL VARIABLES )
Var
( BEGIN MAIN MODULE )
BEGIN
‘( $1 DASTCTPW.INC)
Program TPWEX2;
( *****************************************~~*********~~~~~~~~***
TPWEX2.PAS
DASTC
Turbo Pascal for Windows :
The following is an example program that demonstrates the
use of AD interrupt conversions using a channel/gain queue.
************************************************************* 1
( The WinCrt unit allows Windows to handle 'writeln' and 'readln' the same
way as in DOS )
uses WinCrt;
GainChanTable = Record
mm-of-codes : Integer; queue : Array[0..31] of Byte;
end:
const ChanGainArray : GainChanTable = ( mm-of-codes : (16); CpE"SS
: (0,O.
l,O,
2.0.
3.0.
30
ASO-TC User’s Guide - Rev. A
4.0.
5.0,
6.0. 7,O. 6,@.
9.0. 10,O.
ll,O, 12,o. 13,o.
14,o. 15,O)
: ;
Vclr BufPtr : ^Integer; BoardNumber, m : Integer; NumberOfBoards : Integel- ; Ertn. than,
status : Word; Samples, Index, InPort, DASTC-brdO, AD:al-d0 : Lonyirit~: Config?ile : string; DataBuffer
GJC : Sinyle;
: Array[0..201 of Longint:
iSI
DASTCTPW.INC)
( DLL
function
protor~ypes. j
begin
i--------------------------.---------..------..-.--.
initialize board hardware and driver 1
BufPtr := @DataEuffer[O]; ConfigFile :=
'DASTC.CFG' + #O ;
Ertn := DkS?C-DevOpen( ConfigFile[ll, NumberOfBoards 1;
if Ertti <~> 0 then
begin
writeln( 'Error ', C,rtn, 'on Device open 1;
Haltll);
end;
i----------------‘-------------------~---~~---~~------------
The DEVICE Handle must be obtained in order to work with a
specific: board It is used subsequently to obtain FRAME
Handles 1
Chapter 2 - The Function C&It Driver 31
BoardNumber := 0;
Ertn := DASTC-GetDevHandle( BoardNumber, DASTC-brd0 1;
if Ertn <~> 0 then
begin
writeln(
'Error getting Device Handle' 1;
Halt(l);
end:
(--------------------------------------------------~------
The FRAME Handle must be obtained using the DEVICE Handle in order to make each type of function call, in this case,
Analog
Input. The variable is suffixed with a "0" Tao
reference board 0. 1
Ertn := K_GetADFrame( DASTC-brd0, AD-brd0 ) ;
if Ertn <~> 0 then
begin
writeln( 'Error yettiny Frame Handle' 1 ;
Halt(l);
end;
(-~-~~-----------------------------------------~~~~--------.
The FRAME Handle is now used in Analog Input calls. 1
writeln(
'Interrupt Mode with Chan Gain Array' ):
Samples := 20; Ertn := K-SetBuf( ADLbrdO, longirlt(bufptr), Samples ) i
if Ertn <> 0 then
begin
writeln( 'Error in K-SetBuf call' );
Halt (1) ;
end ;
Ertn := K_SetChnGAry( ADpbrdO,
ChanGainArray.num_of_c!odes 1
if Ertn c~> 0 then
begin
writeln( 'Error in I<-SetChnGAry all' i;
Halt(l);
end;
Ertn := KpIntStart( AD_brdO ) ;
32 ASO-TC User’s Guide - Rev. A
begin
writeln( 'Error in K-IntSLwt call' 1; Halt(l);
end;
repeat
Ertn := K-IntStatus( AD-brd0 , Satus, Index ) ;
if Ertn Jo. 0 then
begin
writeln( 'Er-r-or in K-InStatus call' j;
Halt(l);
end;
until (Status AND 1) = 0;
writeln("); writeln( writeln(");
for m := 0 to Samples-l Do
);
'Interrupt~s Completed ');
writeln( 'Channel [',m.'l = ',DataBuftrr[ m I
(~----~~~~~~~~~---------------.~-~-~------------~~.~~~....
Release memory used by the frame. 1
Ertn := R_FreeFrame( AD-brd0 ) ;
if Ertn i> 0 then
begin
writeln( Halt(l);
end;
end.
'Error in KLFreeFrnme call' );
Chapter 2 - The Function Cdl Driver
33
Microsoft Quick C for Windows
Related files Compile and Link
instructions
Notes
DASTCDLL
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
WKIY.
,*****************************************~**~*********~***~ * * *
* * * * * * * * * * *
*******************"************************~~~*********~~****,
#include "winexamp.h" #include "userprot.h"
Keithley/Mrtrabyte DASTC Example Program for
Microsoft Windows 3.0 and 3.1
This Program Accesses the DASTC functions through
DASTC.DLL.
this is fragment taken from the "W1NEXAMP.C" program
34
ASO-TC User’s Guide - Rev. A
long LocalBuffer[2O1; // Declare i, buffer- for- ""t
AD Data
long far *FirstElement; Buffer WORD MemHandle;
Pointer
// Pointer to Interrupt
// Handle of the abovi-
char NumberOfBoards;
configure
short Done = 0:
// Number of boards Tao
short Interrupt long Index; Interrupt
short
functions
DDH DASTC; FRAMEH AD;
float CJC;
//**** Open the confiy file and read it...
if((Err=DASTC-DevOpen("DASTC.cfg", GNumbex-OfBo<>rdsi , ! = Oi
1
//**** NOW yet a Device Handle
if( (Err=DASTC_GetDevHandle(O,&DASTC) 1 != 01
(
I
Stratus;
Err;
// Device Handle // Frame Handle
wsprintf(szErr,
MessageBox(NULL, szErr," Error ', MB-OK I
MB-ICONEXCLAMATION);
return I;
wsprintf(szErr, MessageBox(NULL, szErr," Error *, MB-OK I
MB-ICONEXCLAMATION);
ret"rrl I;
"DASTC Error = %4x", Err-i;
"DASTC Err-or q 84.x". EL-T);
//**** NOW get the CJC Temperature if((Err=DASTC-GETCJC(O,&CJC)) != 0)
(
wsprintf(szErr, MessayeBox(N"LL, szErr," Errol- ", MB-OK I
MB-ICONEXCLAMATION):
return I;
1
wsprintf(szData,
"DASTC Error = %4x", Err):
"CJC Temperature = %f", CJC);
Chnpter 2 - The Functirm Call Driver
35
//**** Setup for INTERRUPT AD Conversions //**** Get a AD Frame if((Err = K-GetADFrame(DASTC, &AD )) != 0)
(
wsprintf(szErr,"DASTC Error = %4x", Err); MessngeBox(NULL, szErr," Error ', MB-OK I
MB-ICONEXCLAMATION);
return 1;
i
//**** Allocate
a Buffer
if((Err = K_IntAlloc(AD, 16, &FirstElement, GMemHandle) 1
!=O)
(
wsprintf(szErr,
"DASTC Error = %4x", Err);
MessageBox(NULL, szErr," Error ', MB-OK 1
MBJCONEXCLAMATION);
return I;
1
//**** Tell the Frame about the Buffer if((Err = K-SetBuf(AD, FirstElement, 16)) != 0)
(
wsprintf(szErr,"DASTC Error = 84x", Err); MessageBox(NULL, szErr," Error ', MB-OK I
MB-ICONEXCLAMATION);
return 1;
I
//**** Set the Start/Stop Channels and Gain if((Err = K_SetStartStopChn(AD, 0, 15)) != 0)
(
wsprintf(szErr,"DASTC Error = %4x", Err); MessageBox(NULL, szErr," Error ', MB-OK I
MB-ICONEXCLAMATION);
return 1;
1
IrqOP = 1;
Done = 0; Status = 0;
UpdateWindow(hWndMain1 ;
//**** Start Interrupt MODE AD
if((Err = K_IntStart(AD)) != 0)
(
wsprintf(szErr,"DASTC Error = %4x". Err); MessageBox(NULL, szErr," Error (I, MB-OK I
return 1;
1
36 ASO-TC User’s Guide - Rev. A
// Set Operation Flag
// Clear Done Flaq
// Clear Interrupt Status Flag
// Print Running
MB-ICONEXCLAMATION):
//***' Stdrt~ a lOms timer to monitor status
if{ !SetTimer(hWndMain, ID-TIMER, 10, NULL) 1
(
MessageBox(NULL, "TIMER ERROR..."," Error -, MB-OK /
MB-ICONEXCLAMATION);
return I;
1
###b###%##################b#b####bb#bbbbbbbbb~~~~ub~~~~~~u~~ // timer routine that polls for interrupt completion
if((Err = K-IntStatus(AD, &Status, GIndex)) != 01
(
KillTimer(hWndMain, ID-TIMER);
wsprintf(szErr,'DASTC Error = '%4x", Erl-1; MessayeBox(N"LL, szErr," Er-ror ", MB-OK ,
MB-ICONEXCLAMATION);
if((Err = K-IntStop(AD, &Status, &Index)) != 0)
(
wsprintf(szErr, MessageBox(NULL, szErr," Error ', MB-OK i
MB-ICONEXCLAMATION):
I
if((Err = K_IntFree(MemHandle)) != 0)
(
wsprintf(szErr,"DASTC Err-or = 84x". Err); MesssgeBox(NULL, szErr," !3r~-or ', MB-OK I
MB-ICONEXCLAMATION);
1
if((Err = K-FreeFrame( != 0)
(
wsprintf(szErr,"DASTC Error = %4x", Err!: MessageBoxiNULL, szErr." Errol~ ", MB-OK I
MB-ICONEXCLAMATION);
1
break;
)
"DASTC Error = %4x", EL-r-i;
! / F1-rr the fraimr
,, Fr-re the txame
!/ Free th< framr
InvalidateRgn(hWndMain, hRgn, FALSE); //
if( ( (Status & I)==01
KillTimerlhWndMain, ID-TIMER);
if((Err = K-IntStop(AD, &Status, GIndex) 1 != 0)
(
wsprintf(szErr, MessageBox(NULL, szErr," Erl-o~- ', MB-OK /
"DASTC Error = %4x", ErrI:
Chapter 2 - The Function Call Driver
// Update client Arid
with count
li Free the fL.a,r
37
MB-ICONEXCLAMATION);
I
,, Movn Data to our Local Buffer
K_MoveDatnBuf(Loc!alBuffer, FirstElement, 161;
(Err = I(_IntFree(MemHandle)) != 0)
if
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
Windows clipboard.
5. Double-click
6. Select
EDIT p PASTE.
on tiL(~)HAL.IiAS
in lhc Prujccr window.
7. Select FILE c SAVE PKOJECT.
38 ASO-TC User’s Guide - Rev. A
##############################################b#444~4bbb#~~~
DAS-TC Visual
Basic Example:
Interrupts transfer usiny Gain/Channel array witch local
buffer.
This is d code fragment taken from DASTCEXl.FRM.
########################################44#4##4b44b4bb~~wR~b~
###########################################44#44bb~b~~~w~~R~~
Channel / Gain Interrupts Event routine
(double click on the "Channel / Gain Queue' START button in
the "Interrupt
Mode A/D”
frame to see this code)
######################################4#4#4##4~#44444b4bw~~~
sub StartQInt-Click 0
scalemode = 2
timer2.enabled = False
Cls
SSFlag = False
Print
MyErr
= DASTC_devopen["DASTC.cfg". board%)
If MyErr Ed> 0 Then
MsgBox "DASTC-dewpen Error", 48, "Error-"
Exit Sub
End If
MyErr = DASTC_getdevh~ndle(O, DASTC)
If MyErr i"> 0
MsgBox
"DASTC-getdevhandle Error", 48, "EL-rol-"
Then
Exit Sub
End If
MyErr = I<-GetADFrane(DASTC, ad)
If MyErr -:i 0 Then
MsgBox "K-GetADFrame Error", 48, "Er~~ol-"
Exit Sub
End If
MyErr = k_clearframe
If MyErr <~> 0 Then
MsgBox
“I<-ClearFrame Error”, 48, “Error”
Exit Sub
End If
MyErr = K-IntAlloc!(ad, samples, GBuffer, HANDLE)
If MyErr <~> 0 Then
MyErr
0s =
= K_FreeFrame(ad)
"I<-IntAlloc Error = u + Hex$(MyErr)
MsgBox 0:;. 48, "Error"
Exit Sub
End If
Print u
Print
' AD Interrupt Buffer z '; Hex$(GBuffer)
Buffer Handle = '; Hex$(HANDLE)
MyErr = I<_SetBuf(ad, ByVal GBuffer, samples)
If
MyErr i> 0
Then MyErr = K-FreeFrame MyErr = K-IntFree(HANDLEi MsgBox
"K-SetBuf Error", 48, "Error"
Exit Sub
End If
MyErr = K_SetChnGAry(ad, ChanGainArray(0) 1
If MyErr .z> 0 Then
MyErr = KpFreeFrame(ad) MsgBox "K-SetChnGAry Error", 48, "Error'
Exit Sub
End If
MyErr = I<-IntStart(ad)
If MyErr <~> 0 Then
MyErr = K-FreeFrame MsyBox
“K-1ntSt~art~ Error”, 48, “Error”
Exit Sub
End If
Status = 1
timer2.enabled =
End Sub
40 ASO-TC User’s Chide - Rev. A
True
' Enable Stat~us
Flag
######################################k###b##4b#~#bb~4bbb~~~
Timer routine used to detect interrupt completion and then to transfer data.
(double click on timer icon to see this code)
########################################4#####b44b4#444~n~~bu
Sub TimerZ-Timer 0
MyErr = K-IntStatusCad, Status, Index)
If MyErr .:~:. 0 Then
MyErr = K-IntStop(ad, Status, Index) MyErr = K-FreeFrame
MsgBox "K-IntStatus Error", 48, "Err-or"
Exit Sub
End If
PSet (0, 55)
o$ =
Print OS
If (Status And 1) = 0 Then
"Count = v + FormatS(Index, "dkkdflfl~i
timerZ.enabled = False
MyErr = I~-IntStopCad, Status, Index) MyErr = I<-MoveDataBuf (Buffer(O), ByV,\l GBuffrr, :~.xnpi+:;
* 2)
MyErr = K-IntFreeCHANDLE)
If MyErr .:;. 0 Then
o$ = "KmIntFree Error = ' + Hex$(MyEl-1-1 MsgBox o$, 48, "error" Exit Sub
End If
Print : Print '
MyErr = I<-FreeFrame
Print
For x = 0
Print "
Next x End If End Sub
To
samples - I
Interr-upt Operation Complete. "
Buffer("; x; '1 = '; Buffer(x)
Functions
3.1 Functional grouping
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 interrupl­mode 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 Chamel­Gain 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 user­dctined 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.
Prototype C
DASErr l&r pascal K-IntAlloc( FRAMEH frrrmcHrrnd/r. DWORD scmr/~/es.
void far * far *
intAddr.
WORD fx * memHnnd/r );
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 intcrrupt­mode 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...