Download Print this page

Keithley ADC-16 User Manual page 34

Analog input board

Advertisement

CHAPTER 6 THE CALL DRIVER
The following statements then load the driver.
2 7 0
DEF SEG
=
&€I9000
2
8 0 BLOAD "ADC16. B I N " , 0
This code loads the driver at 9000h (at the 576K segment) and is usually a good choice. However,
computers with 512 KB or less memory will require loading the driver at a lower address (for
example, 4000h or 5000h).
Initializing The Variables
You must declare all your program variables before opening the driver. Using an undeclared variable
during the program will move the entry points and cause the program to fail. Examples of
declarations are as follows:
3 4 0
ADCl6
=
0
'declare
ADC16
as r e a l
3 7 0
DIM A D V a l u e % ( 2 )
'declare an integer array
3 9 0
NumDfBrds%=O: E r r F l a g % = O : BrdNum%=O
'declare integers
400
GAIN%=O:
CHAN%=O
410
N$='"'
'declare W $ s t r i n g
402
VEL=O:DIRECT=O:TEMP=O
'declare application
'dependent variables
Opening The Driver
The next step opens the driver, and reads the current configuration file (see Section 2.6) for the ADC-
16 hardware (Base Address, Interrupt Level, input configuration). The ADCl6DevOpen command
performs this function, which is demonstrated (along with other required initialization functions) in
the example program in Section 6.3. The
syntax
for the ADC16DevOpen function is shown below:
5 0 0
N$
=
"ADC16.CFG"
+
CHR$(O)
'Setup filename
510
CALL
ADCl6DevOpen% (N$, NumOfBrds%, E r r F l a g % )
' R e a d ADC-16
520
' c o n f i g u r a t i o n f i l e
Establish Communications Between The Driver
&
Program
To allow the use of multiple boards, the Calls require a board identifier for each board. The board
identifier is called a Device Handle, or simply Handle
.
Without Handles, a KADRead command
would not know which board (in a multi-board system) to call.
The Handle for each board is returned by the ADC16GetDevHandle command after a successful call
to ADC16DevOpen, which is included in the Quick-Start programs. Additional information on the
ADCl6GetDevHandle function (and concept) is as follows:
SINGLE BOARD SYSTEMS
In single-board systems, obtain the Handle via the ADCl6GetDevHandle function. The following
examples show use of the Handle.
6 - 3

Advertisement

loading