Download Print this page

Keithley ADC-16 User Manual page 45

Analog input board

Advertisement

ADC-16 USER
GUIDE
Quick-Start Program
To aide in the creation of programs, the Distribution Software includes a Quick-Start program, which
includes all driver loading, pointer definition, and ADC-16 initialization. For interpreted BASIC, the
Quick-Start program is QBASIC.BAS
.
The program is in standard BASIC source code with an Insert
Your
Code
Here section.
When you program the AX-16, begin
with
the Quick-Start program and add new sections to the
existing code. This alternative should be easier than rewriting the driver, pointer, and initialization
code.
Declaring The Variables
You must declare all program variables before opening the driver. Declare each of the driver
functions as integer variables. The end of this section contains a listing of an Interpreted BASIC
example program. It may be helpful to refer to this example program during the discussions in this
section.
Neglecting to declare all variables will result in a program failure. Declaration examples are as
follows:
'Declare the d r i v e r
functions
D I M DriverArray(22000) AS INTEGER
'Dimension an array t o
'hold t h e d r i v e r
DIM ADCl6DEVOPEN AS INTEGER
'Declare t h e d r i v e r
'function names
' a s i n t e g e r v a r i a b l e s
D I M
KRESTORECHNGARY
AS INTEGER
'Declare a l l
v a r i a b l e s used i n t h e program
DIM NumOfBrds AS INTEGER
-
declare
i n t e g e r v a r i a b l e s
D I M D e r r AS INTEGER
D I M
Gain
AS I N T E G E R
DIM Chan AS INTEGER
DIM BrdNum AS INTEGER
DIM
A$
-
declare
A
as a
s t r i n g
D I M ADValue AS LONG
-
declare
long v a r i a b l e s
D I M ADCl6 AS LONG
VEL=O:DIRECT=O:TEMP=O
-
declare standard r e a l v a r i a b l e s
Do not Forget!! Declare all variables prior to opening the driver. Using an undeclared variable in the
program body (even the
I
in a simple
FOR
I=
1 to 1 0
:NEXT I
loop) will cause device
pointers to be shifted, and will result in program failures!!
Initializing Pointers & Loading The Driver
In QBASIC, the driver and a number of pointers to the driver are loaded within the program itself.
The first task is to load the entry point variables (each command has a unique entry point), using a
subroutine in QBASIC.BAS. Since there are several entry points, it is recommended that the
QBASIC.BAS Quick-Start program (or one of the example programs) be used as the starting point for
new programs. This will ensure that the pointers are loaded correctly. The following statement calls
the subroutine which loads the driver entry points.
Callsetup
' c a l l
subroutine
t o
load driver pointers
6 - 1 4

Advertisement

loading