Example Programs; Gplb Initialization; Display Setting; Inquiry - Keithley 3321 Operator's Manual

Lcz meter
Table of Contents

Advertisement

SECTION4
GPIB Interface
+
4.9
EXAMPLE PROGRAMS
This section provides
some example programs
used to
control the instrument over the GPIB. The personal com-
puter used for those examples is listed as follows:
HP 9000 Series 200 Computers
Series 200 computers, HP9816,9826,9836,
etc.
BASIC 2.0 software
All the programs assume that the GPIB address of the in-
strument is set to 2 and the delimiter is set to <CR> <LF>.
4.9.1
GPIB Initialization
The following program will initialize the GPIB:
Sample program to initialize the GPIB:
100 ABORT7
110 CLEAR 702
Program Analysis:
Line No.
Operation
100
Send the IFC (Interface Clear) command.
110
Send the SDC (Selective Device Clear) com-
mand.
Normally
REN
is enabled,
unless
otherwise
pro-
grammed, and the delimiter is <CR> <LF> unless other-
wise programmed
by the OUTPUT statement.
4.9.2
Display Setting
The following
example program will set the display of
the instrument.
When this program is executed, C and D
will be measured
repeatedly
at 1kHz. Make sure the
GPIB was previously initialized (see paragraph 4.9.1) be-
fore using this program.
Sample program to set the display:
100 OUTPUT 702; "FR lE3;DA 2;DB l;CK 1"
4.9.3
Inquiry
The following sample program will inquire and display
the currently selected frequency and signal level settings.
Make sure the GPIB was previously initialized (see para-
graph 4.9.1) before using this program.
100 OUTPUT 702;"HD 0"
200 OUTPUT702;"?FR"
210
ENTER 702;Fr
220
PRINT "FREQ = ";Fr;" Hz"
230
PRINT
300 0UTPUT702;
"?LV"
310 ENTER 702;Lv
320
L$="lV"
330 IF Lv=O THEN L$="50mV"
340 PRINT "LEVEL = "L$
Program Analysis:
Line No.
100
200to220
300
310to340
Comment
Inhibits a header output.
Inquires and displays the frequency.
Inquires the signal level.
Receives and displays the data.
4-20
+

Advertisement

Table of Contents
loading

Table of Contents