Example Programs
G-8
• Microsoft QuickBASIC 4.5
• Any one of the following IEEE-488 interfaces:
Keithley Model KPC-488.2
Keithley Model KPC-488.2AT
Capital Equipment Corporation PC<>488
The program assumes that the Model 2002 is set to address
16.
Loading user library
The user library for QuickBASIC 4.5 is provided with the
IEEE-488 interface (ieeeqb.qlb). Assuming QuickBASIC
and the user library are in the same DOS directory, enter the
following command line from the DOS prompt:
QB /L ieeeqb.qlb
The above command line will load QuickBASIC and the
user library.
Program (testdio2.bas)
'$INCLUDE: 'ieeeqb.bi'
CLS
CALL initialize(21, 0)
CALL SETTIMEOUT(1000)
CALL setoutputEOS(10, 0)
CALL setinputEOS(10)
CALL send(16, "*RST; *CLS; :syst:pres", status%)' Clear and reset 2002
z = 0
rdata$ = SPACE$(8)
WHILE INKEY$ = ""
' Press any key to end program
z = z + 1
CALL send(16, ":sens2:ttl1:data?", status%)
' Read input port
GOSUB test.status
t! = TIMER: WHILE TIMER - t! <= .5: WEND
CALL enter(rdata$, 3, 16, status%)
GOSUB test.status
' Check integrity of read operation
PRINT "Test #"; z; " Status "; status%; " Databyte "; rdata$
WEND
' Display status and state of input
' port END
test.status:
' Print error message and stop
' program if the read operation is
' corrupt (1)
IF status% <> 0 THEN
PRINT " Failure on IEEE-Bus !!! Status = "; status%
SLEEP 3
STOP
END IF
RETURN
Test Digital Input Port
Microsoft QuickBASIC 4.5
Keithley KPC-488.2 Interface
©1992, Keithley Instruments, Inc.
Description
This program continuously tests the digital input port of the
Model 2002. Each test provides the status of the read opera-
tion. If Status = 0, then the read operation was successful.
Also displayed is the result of the read operation. If the dig-
ital input port is high (on), then Databyte = 1. Conversely, if
the input port is low (off), then Databyte = 0.
Pressing any key on the computer keyboard terminates the
program.
Required equipment
• Model 2002 Multimeter
Summary of Contents for 2002
Page 123: ...Front Panel Operation 2 106...
Page 145: ...IEEE 488 Reference 3 22...
Page 167: ...IEEE 488 Reference 3 44...
Page 284: ...A Specifications A 1...
Page 362: ......
Page 364: ...This page left blank intentionally...
Page 365: ......