Download Print this page

Keithley ADC-16 User Manual page 41

Analog input board

Advertisement

ADC-16 USER GUIDE
SINGLE BOARD SYSTEMS
In single-board systems, the Handle is straightforward. The Handle is obtained via the ADC-16
GetDevHandle function. The following examples describe how the Handle is used.
First, get the handle, as follows:
BrdNum
=
0
'0 since only
1 board in system
Derr = ADCl6GetDevHandle% (BrdNum, DevHandle)
(where Derr contains the error status)
Subsequent calls use the variable DmHundle to select the installed AX-16.
The variable name DmHundle may be changed to make the program easier to read. For example, a
variable change from DmHundle to ADCl6 is reflected in the following program lines.
BrdNum
= 0
'0 since only
1 board in system
Derr
=
ADCl6GetDevHandle% (BrdNum, ADCl6)
MULTIPLE BOARD SYSTEMS
In systems with more than one board, you must use more than one Handle. The following example
shows how the Handles are obtained and used in a system with two ADC-16s.
BrdNum
= 0
'First ADC-16 board
Derr = ADCl6GetDevHandle% (BrdNum, ADCl6A)
BrdNum
=
1
'Second ADC-16 board
Derr = ADCl6GetDevHandle% (BrdNum, ADCl6B)
Subsequent function calls will use the ADCl6A or ADC16B Handle for either Board to determine the
selected board.
Immediate Execution Commands
&
Frames
Two
types
of Call commands will control the A X - 1 6 once the board and the driver are installed and
initialized. These are Immediate Operation commands and Setup or Frame commands.
IMMEDIA TE OPERA TION COMMANDS
Several single-function commands may be executed without any prior set-up. The simplest of these is
the KADRead command that selects an input channel, an input gain, and then performs a single
A/D conversion. The syntax for this command is as follows:
Chan = 0: Gain
=
0
Derr
=
-Read%
(DevHandle, Chan, Gain, ADValue)
PRINT "The A/D returned", ADValue
Note that the ADVulue and the DmHandle are Long Integers and must be declared in the variable
declaration section. The ADC-16 data is returned in the least significant fifteen bits of ADValue,
if
bit
sixteen is zero multiply the data by minus one.
6 - 1 0

Advertisement

loading