Download Print this page

Keithley ADC-16 User Manual page 46

Analog input board

Advertisement

CHAPTER 6 THE CALL DRIVER
Next, load the driver.
DEF SEG
=
VARSEG (DriverArray (0)
)
BLOAD "ADC16Q. BIN", 0
Opening The Driver
The next step opens the driver and reads the current configuration file for the ADC-16 hardware (Base
Address, Interrupt Level, input configuration).
(This
file is created using the ADC16CFG.EXE file
described in Chapter 2.) ADC16DevOpen performs this function. ADC16DevOpen and the other
required initialization functions are shown in the example program at the end of this section. The
syntax for this function is as follows:
A$
=
"ADC16.CE'G"
+
CHR$
(0)
'read ADC-16 config file
CALL ABSOULUTE(A$, NuarOfBrds, DERR, ADCl6DEVOPEN)
'execute the call
Establish Communications Between The Driver
&
Program
To allow the use of multiple boards, the function calls require an identifier for each board. A board
identifier is called a
Device Handle or
simply Handle
.
Without the Handle, a KADRead command
in a multiboard system would not know which board to call. The board Handle is the last parameter
in each of the ADC-16 QBASIC calls.
The Handle for each board is returned by the ADC16GetDevHandle command after a successful
call
to ADC16DevOpen. This command is included in the Quick-Start programs. Additional information
on this function (and concept) is provided in the following paragraphs.
SINGLE BOARD SYSTEMS
In single-board systems the Handle is very straightforward. The Handle is obtained via the
ADC16GetDevHandle command. The following examples describe how the Handle is used.
First, Get the handle.
NumOfBrds%
=
0
'0 since only 1 board in system
CALL ABSOLUTE(NumOfBrds,DevHandle,Derr,ADCl6GetDevHandle)
(The variable Derr contains the error status)
Subsequent calls use the variable DeuHundIe to select the installed ADC-16.
The variable name DeuHundle may be changed to make the program easier to read. For example, a
variable change from DeuHundle to ADCl6 is reflected in the following program.
BrdNum = 0
' 0
since only 1 board in system
CALL ABSOLUTE(BrdNum,ADCl6,Derr,ADCl6GetDevHandle)
6 -
15

Advertisement

loading