
HP-IB
Programming
Basics
necessary
lines
of
code
for
I/O
setup
.
HP
B
ASIC
has
advanced
I/O
features
,
and
only
requires
the
ASSIGN
command
for
this
.
The
sample
measurement
uses
201
points
of
data.
All
loop
counters
and
arrays
are
written
to
handle
201
points
.
Step
sweep
mode
is
used,
with
a
single
sweep
.
The
example
uses
F
orm
3
transfer
,
but
is
applicable
to
F
orm
2
or
F
orm
5
by
changing
\FORM3;"
in
line
210
of
the
code
.
1
OPTION
BASE
0
!Set
loop
and
array
counting
at
the
number
0
3
DIM
Data(200,1)
!Dimension
a
201
x
2
array
to
hold
transferred
data.
5
DIM
Mag(200),Phase(200)
!Dimension
two
1-dimensional
arrays
to
hold
the
7
!final
magnitude
and
phase
values
for
each
point.
9
INTEGER
Preamble,Size
!Define
integer
variables
for
the
preamble
and
11
!size
blocks.
13
ASSIGN
@Rec
TO
716
!This
sets
up
the
I/O
path
for
the
receiver,
and
15
!defines
the
HP-IB
address
used
to
talk
to
it.
17
!
19
ASSIGN
@Rec_data2
TO
716;FORMAT
OFF!
21
!
23
CLEAR
716
!
25
OUTPUT
@Rec;"USERPRES;"
!Tells
the
receiver
to
do
a
User
Preset.
27
DEG
!HP
BASIC
command
to
express
angles
in
degrees
29
!rather
than
radians.
31
!
33
!The
next
line
selects
201
points,
Parameter
1,
Log
Magnitude
display
35
!Log
Format,
Single
Sweep,
Form
3:
37
!
39
OUTPUT
@Rec;"POIN201;PARA1;LOGM;SING;FORM3;"
41
!
43
OUTPUT
@Rec;"OUTPDATA;"
!Tells
the
receiver
to
output
the
entire
45
!Calibrated
Array
(201
points)
47
!
49
ENTER
@Rec_data2;Preamble,Size,Data(*)!Tells
the
computer
to
store:
51
!the
Preamble
in
the
"Preamble"
variable
53
!the
Size
block
in
the
"Size"
variable
55
!All
data
in
the
"Data"
array
57
!
59
FOR
N=0
TO
200
!Start
a
for/next
loop
(loops
201
times)
61
Real=Data(N,0)
!These
two
lines
grab
the
first
data
point
out
63
Imag=Data(N,1)
!of
the
array
(starts
with
the
start
freq.
point)
65
!
67
!Convert
one
point
of
data
from
real,imaginary
to
magnitude,phase
69
!
71
Mag(N)=SQR(Real^2+Imag^2)
!Determine
Magnitude
value
73
IF
Imag=0
AND
Real<0
THEN
!Determine
Phase
value
75
Phase(N)=-180
77
ELSE
79
Phase(N)=2*ATN(Imag/(Real+Mag(N)))
81
END
IF
83
!
85
!Mag(N)
and
Phase(N)
are
1-dimensional
arrays
that
will
hold
the
new
87
!magnitude
and
phase
data.
89
!
91
!
93
!The
following
two
lines
simply
the
real,
imaginary,
Magnitude
and
95
!Phase
values
for
the
first
point
and
every
20th
point.
97
!
99
IF
N=0
OR
N/20=INT(N/20)
THEN
101
"Point:";N+1;TAB(13);"Real:";Real;TAB(36);"
Imag:";Imag
103
"Point:";N+1;TAB(13);"
Mag:
";Mag(N);TAB(36);"Phase:
";Phase(N)
105
END
IF
107
!
109
NEXT
N
111
!
113
OUTPUT
@Rec;"Mark1;"
115
LOCAL
716
!Place
receiver
back
in
local
mode
117
END
HP-IB
Programming
18-11
Содержание 8530A
Страница 9: ......
Страница 31: ......
Страница 34: ...General Information Figure 1 2 Antenna Measurement Setup Using an HP 85310A GeneralInformation 1 3 ...
Страница 51: ......
Страница 65: ......
Страница 81: ......
Страница 83: ......
Страница 84: ...5 Menus Block Chapter Contents Calibration Domain Display Markers MenusBlock 5 1 ...
Страница 85: ...5 2 Menus Block ...
Страница 90: ...Calibration Requirements Figure 5 1 Cal and Cal Type Menus MenusBlock 5 7 ...
Страница 93: ...Antenna Calibration 5 10 MenusBlock ...
Страница 167: ......
Страница 195: ......
Страница 201: ......
Страница 209: ......
Страница 249: ......
Страница 281: ......
Страница 411: ......
Страница 419: ...Glossary Glossary 8 ...
Страница 439: ......