Download Print this page

Keithley ADC-16 User Manual page 81

Analog input board

Advertisement

ADC-16 USER GUIDE
-
KSetCh nGAry
Purpose
Frame Parameter. Insert a channel gain list into a frame.
format
D A S E r r
=
K S e t C h n G A r y
(
C h a n G a i n A r r a y
)
:
entry parameters
ChmGainArray
=
Channel Gain Array in the following form:
OFFSET
TYPE
DESCRIPTION
0
Integer
Number Of Enmes In This Table
N/2)
1
Integer
Channel
#1
2
Integer
Gain
Code For Channel
#
1
3
Integer
Channel #2
4
Integer
Gain
Code For Channel #2
.
Integer
Channel
#
(N/2)
N
Integer
Gain
Code For Channel
#
(32)
exit parameters
None.
return value
DASEv = integer variable (0
=
No Error).
see also
KGetChnGAry.
comments
For
certain A/D acquisition modes, you may
specify
different gains for different
input channels using a channel/gain array. This array is passed to the driver using
KSetChnGAry
.
The driver accepts this array only when it is in the format shown
above, which is not achievable from BASIC; BASIC does not support byte-sized
variables. From BASIC, always use KFormatChnGAry before KSetChnGAry
,
as
shown in the examples below. When no longer needed by the driver, this array may
restored to its BASIC format using KRestoreChnGAry
.
Using KSetChnGAry ,
you may specify an arbitrary sequence of channel/gain pairs. Any random order of
channels and gains is allowable, including sampling the same channel sequentially
at different gains. The channel-gain array may contain up to 256 channel/gain
entries.
* * *
Examples
Interpreted BASIC
- 0
CALL KSetChnGAry% (ChanGainArray% (0)
,
DASErr%)
QuickBASIC
D I M ChanGain(20)
AS
INTEGER
ChanGain(0)
=
4
N u m b e r
of
-/Gain
p a i r s
ChanGain(1)
=
0 : ChanGain(2)
=
0
Chan
0
G a i n Code
1
ChanGain(3)
=
1: ChanGain(4)
=
1
'
Chan 1
G a i n
Code 2
ChanGain(5)
=
2 :
ChanGain(6)
=
1
'
Chan
2
Gain
Code 2
ChanGain(7)
=
3: ChanGain(8)
=
0
'
Chan
3 Gain Code 1
DASErr
=
KSetChnGAry%
(FrameHandle,
ChanGain ( 0 )
)
IF
D A S E r r
<>
0 THEN
BEEP: STOP
QBASIC
CAU
ABSOLUTE
(ChanGain
()
,
D A S E r r , K S e t C h n G A x y )
* * *
7
-
28

Advertisement

loading