Download Print this page

Keithley ADC-16 User Manual page 35

Analog input board

Advertisement

ADC-16 USER GUIDE
First, get the Handle, as follows:
539
BrdNum% = 0
'0 since only
1
board in
system
540
CALL
ADC16GetDevHandle%(BrdNum%,Dev€Iandle,ErrFlag%)
Subsequent calls use the variable DevHandle to select the installed ADC-16.
You may change the variable name DeuHandle to make the program easier to read. For example, the
following program lines reflect a variable change from DeuHundIe to ADCZ 6
.
539
B r a = %
=
0
'0 since only 1 board in system
540
CALL
ADC16GetDevHandle%(BrdNum%,ADCl6,ErrFlag%)
MULTIPLE BOARD SYSTEMS
In systems with more than one board, you must use more than one Handle. The following example
shows how to obtain and use Handles in a system with two ADC-16s.
530
BrdNum%
=
0
'First ADC-16 board
540
CALL
ADC16GetDevHandle%(BrdNuxi%,ADCl6A,ErrFlag%)
550
BrdNum%
=
1
'Second ADC-16 board
560
CALL
ADCl6GetDevHandle% (BrdNum%, ADCl6B, ErrFlag%)
NOTE:
In this example, declaration of variables ADC16A and ADC16B should be in the variable-
declaration section.
Subsequent function calls will use either the ADC16A or ADCl6B Handle to determine the selected
board.
Immediate Execution Commands & Frames
Two
types
of Call commands may be used to control the ADC-16 once the driver is installed and the
Board initialized. These are Immediate
Operation
commands and Setup or Frame commands.
IMMEDIATE OPERATION COMMANDS
A variety of single-function commands may be executed without any prior setup. The simplest of
these is KADRead
,
which specifies an input channel, an input gain, and then performs a single A/D
conversion. The syntax for this command is as follows:
620 Gain%=O:Chan%=O
630
CALL
=Read%
(ADC16A, m a n % , Gain%, ADValue% (0)
,
ErrFlag%)
640
PRINT
"Board 1 returned",ADValue% (0)
Note that the ADVulue%(O) must be defined as an integer array. The ADCl6A Handle is a single-
precision, real variable and must be declared in the variable declaration section. The actual numeric
value of the Handle is simply a pointer within the driver and should be passed where required.
MULTIPLE BOARD SYSTEMS
Systems with more than one board must use more than one Handle. The following example opens the
Handles for two ADC-16s and then takes an A/D reading from Channel 0 of the first Board and from
Channel 5 of the second.
6 - 4

Advertisement

loading