Quickbasic 4.5 Programming - Keithley 2002 User Manual

Hide thumbs Also See for 2002:
Table of Contents

Advertisement

To check the present primary address or to change to a new
one, perform the following procedure:
1. Display the MAIN MENU by pressing the MENU key.
2. Use the cursor keys (
GPIB and press ENTER. The GPIB/PRINTER SETUP
menu will then be displayed.
3. Use the cursor keys to place the cursor on ADDRESS-
ABLE and press ENTER.
4. The current primary address of the instrument will be
displayed. For example, if the instrument is set to prima-
ry address 16, the following message will be displayed:
ADDRESS = 16 (0-30)
5. To retain the displayed address, press EXIT three times
to return the instrument to the measurement display
state.
6. To change the primary address, use the
and the
and
keys to display the new address value
(0 to 30). The
and
and the
and
keys increment and decrement the
selected digit.
7. With the desired address value displayed, press ENTER.
The address will be stored in non-volatile memory. That
is, it will not be lost when the instrument is turned off.
8. Press EXIT two times to return to the measurement dis-
play state.
Each device on the bus must have a unique
primary address. Failure to observe this
precaution will probably result in erratic
bus operation.
3.4

QuickBASIC 4.5 programming

Programming examples are written in Microsoft QuickBA-
SIC 4.5 using the Keithley KPC-488.2 (or Capital Equip-
ment Corporation) IEEE interface and the HP-style
Universal Language Driver (CECHP).
Before any programming example can be run, the Universal
Language Driver must first be installed. From DOS, execute
the following command to install the driver:
cechp
If you include the CECHP command in your AUTOEX-
EC.BAT file, the driver will automatically be installed every
time you turn on your computer.
and
) to place the cursor on
and
keys control cursor position
NOTE
Program fragments
Program fragments are used extensively throughout this
manual to demonstrate proper programming syntax. As the
name implies, only a fragment of the whole program is used
in order to avoid redundancy.
At the beginning of each program, driver files have to be
opened and the input terminator should be set for CRLF.
OPEN "ieee" FOR OUPTUT AS #1
OPEN "ieee" FOR INPUT AS #2
PRINT #1, "interm crlf"
A typical program fragment includes an OUTPUT command
and an ENTER command. The OUTPUT command sends a
program message (command string) to the Model 2002. If
the program message includes a query command, then the
ENTER command is required to get the response message
from the Model 2002. The ENTER command addresses the
keys
Model 2002 to talk. The following example program frag-
ment demonstrates how OUTPUT and ENTER are used.
Note that the commands assume address 16 which is the fac-
tory set address of the Model 2002.
PRINT #1, "output 16; :func 'volt:ac'; func?"
PRINT #1, "enter 16"
If you wish to display the response message on the CRT, the
computer will have to read the message and then "print" it to
the CRT display as follows:
LINE INPUT #2, A$
PRINT A$
The following programming example shows how all the
above statements are used together. The program fragment is
shown in bold typeface.
OPEN "ieee" FOR OUPTUT AS #1
OPEN "ieee" FOR INPUT AS #2
PRINT #1, "interm crlf"
' Select ACV and query
PRINT #1, "output 16; :func 'volt:ac'; func?"
PRINT #1, "enter 16"
LINE INPUT #2, A$
PRINT A$
IEEE-488 Reference
' Open driver
' Open driver
' CRLF terminator
' Get response message
' Read response mes-
sage
' Display message
3-3

Advertisement

Table of Contents
loading

Table of Contents