In
lines
80
to
110
(setting
frequency),
parameters
are
required
with
the
GPIB
command.
T
o
set
parameters
,
see
\T
o
Execute
an
GPIB
Command
with
a
P
arameter"
later
in
this
chapter
.
P
erform
Calibration
130
!
Frequency
Response
Calibration
140
OUTPUT
@Hp4396;"CALK
N50"
!
Select
50
ohm
type-N
Cal.
kit
150
OUTPUT
@Hp4396;"CALI
RESP"
!
Select
Response
cal.
160
OUTPUT
@Hp4396;"CLES"
!
Clear
all
status
170
INPUT
"Connect
THRU,
then
press
[Return].",Dum$
180
OUTPUT
@Hp4396;"*SRE
4;ESNB
1"
!
Set
enable
STB
and
ESB
190
ON
INTR
7
GOTO
Cal_end
!
\
When
iBASIC
is
used,
change
"7"
to
"8".
200
ENABLE
INTR
7;2
!
/
210
OUTPUT
@Hp4396;"STANC"
!
Measure
THRU
220
Calibrating:
GOTO
Calibrating
230
Cal_end:
!
240
OUTPUT
@Hp4396;"RESPDONE"
!
Calculating
cal
coefficients
250
OUTPUT
@Hp4396;"*OPC?"
!
\
Waiting
calculation
end
260
ENTER
@Hp4396;Dum
!
/
270
DISP
"Response
cal
completed."
In
lines
140
to
240,
the
GPIB
program
follows
the
key
strokes
required
to
calibrate
from
the
front
panel.
This
program
performs
a
response
calibration.
Line
170
requests
the
operator
to
connect
a
THRU
calibration
standard.
Lines
180
through
220
use
the
status
bytes
to
detect
the
completion
of
the
THRU
calibration.
See
\T
o
W
ait
for
Sweep
End"
in
Chapter
3.
Lines
240
through
270
use
the
*OPC?
command
to
detect
the
completion
of
the
calculation
of
the
calibration
coecients
.
See
\T
o
W
ait
F
or
the
Preceding
Operation
to
Complete
"
in
Chapter
3.
Connect
DUT
300
INPUT
"Connect
DUT,
then
press
[Return].",Dum$
Line
300
requests
the
operator
to
connect
a
DUT
to
the
analyzer
.
All
instrument
settings
and
calibration
are
done
.
Y
ou
can
now
measure
the
DUT
.
Trigger
a
Measurement
310
OUTPUT
@Hp4396;"CLES"
!
Clear
all
status
registers
320
OUTPUT
@Hp4396;"*SRE
4;ESNB
1"
330
ON
INTR
7
GOTO
Sweep_end
!
\
When
iBASIC
is
used,
340
ENABLE
INTR
7;2
!
/
change
"7"
to
"8"
350
OUTPUT
@Hp4396;"SING"
!
Sweep
mode
is
SINGLE
360
Measuring:
GOTO
Measuring
370
Sweep_end:
!
Lines
310
to
370
enable
SRQ
interruption
for
sweep
end
detection.
F
or
details
,
see
Chapter
3.
In
line
350,
the
analyzer
executed
a
single
trigger
.
F
or
more
advanced
trigger
control,
see
Chapter
2.
Learning
GPIB
Remote
Control
Basics
1-7