Download Print this page

Keithley ADC-16 User Manual page 44

Analog input board

Advertisement

CHAPTER 6 THE CALL DRIVER
DERR = KSyncStart% (ADSET)
I F
DERR
<>
0 THEN PRINT "ERROR
'I;
HEX$ (DERR)
:
STOP
DERR
=
KFreeFrame% (ADSET)
I F
DERR
<>
0 THEN BEEP: PRINT "ERROR
'I;
HEX$ (DERR)
:
STOP
FOR
I% = 0 TO (STOPCHAN-STARTCHAN)
NEXT I
PRINT HEX$ (BUFFA
( 1 % )
)
END
The KGETADFRAME call is used to open the frame with the variable name ADSET for the ADC-16
board referred to by variable DEVHANDLE. The FRAME is filled with the start-stop channels and
gain using the call KSETSTARTSTOPG. The data location for the acquisition is established by
KSETBUF. The number of samples taken in this example is determined by the start and stop channels
and the
SAMPLES
parameter in the KSETBUF call is ignored. With all the FRAME parameters
completed in ADSET, the acquisition is initiated by a call to KSYNCSTART.
A program can define multiple frames. For example, an application may define a FRAME with
different start-stop channels or use KSetChnGAry to define a
F R A M E
with the gain and channel
sequence specified in a channel-gain array.
6.4 QBASIC
Program
Flow
A typical programming sequence is as follows:
1.
2.
3.
4.
5.
6.
Initialize the pointers to the driver.
*
Load the driver.
*
Declare and dimension all variables that will be used in the program. Failure to declare all
variables before opening the driver will cause the program pointers to be shifted and will
cause the program
to
fail!!!
*
Load the ADC-16s hardware configuration and open the driver.
*
Initialize the driver and board and establish communications between the driver and the
programming language.
*
EITHER
a. Execute a simple ADC-16 operation.
OR
b. Select the desired group of ADC-16 operations referred to as the group's Frame
.
Execute the
operations, taking some data.
*
Indicates that this function is performed in the "Quick-Start'' programs. (see next section)
Choose Step 6a for simple applications such as performing a conversion or reading a digital input
port. Choose Step 6b for more complex operations.
The following sections will describe the various parts of the flow diagram. However, many
programmers will learn faster by referring to the example programs supplied with the ADC-16
Distribution Software.
6 - 1 3

Advertisement

loading