Download Print this page

Keithley ADC-16 User Manual page 48

Analog input board

Advertisement

CHAPTER 6 THE CALL DRIVER
Note that the first KADread uses the first Board Handle as set up with BrdNum
=
0 while the second
KADRead uses the second Handle.
Other Immediate Operation commands include
KDIRead
KDOWrite
Read the digital inputs.
Write to the digital outputs.
FRAMES
Analog Input and Digital Output allow for operation using Frames. For Digital Output the Frame is a
means of returning the value of the Digital Output port. For Analog Input the Frame is the group of all
setup parameters used in a synchronous or interrupt driven operation. For example, an A / D function
requires setting up the following parameters:
Input Channels to scan (Start and Stop channels).
Input Gain.
Number of samples.
Data buffer location.
Program flow is similar in each
type
of Frame, as follows:
First:
Next:
Then:
OPtiOMlly:
Open or get a Frame with KGetADFranie or KGetDOFrame.
Setup the parameters within the Frame.
Execute the desired Frame function.
Check the status of the operation initiated.
The following program segment is similar to the QBASEX7.BAS example in the Distribution Software.
It may be helpful to refer to the during the following discussion.
Example using Analog Input Frame
I
Synchronous
A/D
scan using
S t a r t
/
Stop
/
G a i n
parameters
I
S T E P 1 : ALWAYS INCLUDE
AND
DECLARE THE
SUB
C a l l S e t u p O .
~--------------,---,,,,,,,,_,,,,,,,_____------------------
1
I
It
i s
S U P P L I E D TO YOU WITHIN THE EXAMPLE PROGRAMS AND
MUST BE INCLUDED I N ALL OF YOUR
OWN
QBASIC PROGRAMS.
DECLARE
SUB
C a l l S e t u p
( )
S T E P
2 :
ALWAYS DIMENSION AN ARRAY TO
LOAD
THE DRIVER I N T O .
I
THE DRIVER WILL OCCUPY APPROXIMATELY
4 2 0 0 0
BYTES.
DIM D r i v e r A r y ( 2 2 0 0 0 )
AS
INTEGER
A r r a y
to hold
d r i v e r
C o d e
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I
S T E P
3
: ALWAYS INCLUDE THE FOLLOWING D E F I N I T I O N S I N YOUR PROGRAM
DIM
SHARED
ADCl6DEVOPEN A S INTEGER, ADCl6GETDEVHANDLE
AS
INTEGER
DIM
SHARED
KGETADFRAME A S INTEGER, KCLEARFRAME A S INTEGER
DIM
SHARED
KGETVER
AS
INTEGER, KDASDEVINIT A S INTEGER
6 - 1 7

Advertisement

loading