Download Print this page

Keithley ADC-16 User Manual page 43

Analog input board

Advertisement

ADC-16 USER GUIDE
The following program example is similar to the QBEXAMP7.BAS example in the Distribution
Software. It may be helpful to refer to the example during the following discussion.
Example Program Analog Input Frame
STEP 1
:
Include the supplied Q4IFACE.BI (or Q7IFACE.BI).
The
1
INCLUDE file
contains all function declarations supported by
1
the driver.
1
$INCLUDE: 'Q4IFACE.BI'
1-,,,,,,,,,,,,,------------------------------------------------------------
STEP 2
:
Define ALL local variables required by the program here.
NOTE
that you must avoid declaring and using QuickBASIC variables on the
I
fly.
DIM BUFFA(20) AS INTEGER
DIM NumDfBoards AS INTEGER
DIM DERR AS INTEGER
DIM DEVHANDLE AS LONG
DIM ADSET AS LONG
DIM STATUS AS INTEGER
DIM COUNT
AS
LONG
DIM LONGADD AS LONG
DIM StopChan AS INTEGER
DIM StartChan AS INTEGER
DIM GGAIN AS INTEGER
DIM B oa r d Nm AS INTEGER
DIM Samples AS INTEGER
I%
=
0
BoardNum
=
0
DERR
=
ADCl6GETDEVHANDLE% (BoardNum, DEVHANDLE)
IF DERR
<>
0 PRINT "ERROR, DEVICE
HANDLE
IS null.
.
. ' I :
STOP
SAMpLES=O
I
ADCl6 does not use the SAMPLES parameter
DERR
=
KSetBuf% (ADSET, BUFFA(0)
,
Samples)
IF DERR
<>
0 THEN PRINT "ERROR
' I ;
HEX$
(DERR)
:
STOP
DERR
=
KSetChnGAry% (ADSET,
IF DERR
<>
0 THEN PRINT "ERROR
' I ;
HEX$
(DERR)
:
STOP
CHANGAINARRAY (0)
)
StartChan=O:StopChan=7:GGAIN=O
DERR = KSetStartStopG% (ADSET, StartChan, StopChan, GGAIN)
IF DERR
<>
0 THEN "ERROR
'I;
HEX$
(DERR)
:
STOP
DERR = KSyncStart% (ADSET)
IF DERR
<>
0 THEN PRINT "ERROR
' I ;
HEX$ (DERR) : STOP
6 - 1 2

Advertisement

loading