Download Print this page

Keithley ADC-16 User Manual page 57

Analog input board

Advertisement

ADC-16 USER GUIDE
-
KADRead
Purpose
Operating Function. Read a single A/D input value.
format
DASErr
= KADRead(DevHandle, Chan, Gain,
A D V a l u e
) ;
entry PafamefefS
DevHandl
e =
a unique identifier for a logical DAS device.
Chan
=
an integer variable that contains the number of the channel from which data
is to be read. For A/D frames, use Chan in the range of 0 to topchannel, where
topchannel
=
((#
of STA-EX8s
*
8)
+
(8 -
#
of STA-EX8s))
-
1.
Gain
=
analog Gain code selection, according to the following table:
CODE
GAIN
0
1
1
10
2
100
exit
parameters
ADValue
=
a variable containing the data. In Interpreted BASIC, this value must be
previously DIMensioned as an array of two integers. For QBASIC and QuickBASIC,
it is DIMensioned as a single long integer.
DASErr
=
integer variable (0
=
No Error).
return value
see
also
KDIRead, KDOWrite.
comments
KADRead converts and reads a single A/D value according to the Chan and Gain
code parameters. The value returned is the absolute value of the fifteen least
significant bits of ADValue. If bit sixteen of ADValue is zero then multiply ADValue
by minus one.
+ + +
Examples
Interpreted BASIC
xxxl0
DIM
ADValue%
( 2 )
=20
C?UL
KADRead%
( D e v H a n d l e ,
&an%, Gain%,ADValue%
(0)
,
DASErr%)
QuickBASIC
DIM ADVALUE AS
LONG
DASErr%
=
=Read% ( D e v H a n d l e , &an%,
Gain%,
ADVALUE)
I F DASErr%
0 0
THEN
BEEP:
STOP:
QBASIC
DIM ADVALUE AS M N G
CALL
ABSOLUTE (DevHandle
,
Chan,
Gain, ADValue
,
DASErr,
KADRead)
+ + +
7 - 4

Advertisement

loading