
GPIB
Programming
Basics
P
erforming
the
Actual
Transfer
No
w
that
y
ou
kno
w
whic
h
data
array
and
transfer
format
to
use,
and
ha
v
e
dimensioned
appropriate
computer
v
ariables
and
an
array
,
y
ou
are
ready
to
p erform
the
actual
data
transfer.
Refer
also
to
programming
examples
6
and
7
later
in
this
c
hapter.
An
Example
of
a
Data
Transfer
The
follo wing
BASIC
example
p erforms
a
data
transfer,
and
demonstrates
man
y
commonly-needed
tasks:
Measuremen
t
setup
Data
acquisition
Con
v
ersion
of
real
and
imaginary
data
in
to
magnitude
and
phase
format
Printout
of
the
v
alues
for
eac
h
p oint
This
example
is
complete.
It
dimensions
all
needed
v
ariables,
sho
ws
all
GPIB
bus
\maintenance"
commands,
and
so
on.
If
y
ou
are
not
using
BASIC,
y
ou
need
to
write
the
necessary
lines
of
co de
for
I/O
setup.
BASIC
has
adv
anced
I/O
features
and
requires
the
ASSIGN
command
only
for
this.
The
sample
measuremen
t
uses
201
p oints
of
data.
All
lo
op
coun
ters
and
arrays
are
written
to
handle
201
p oints.
Step
sw
eep
mo
de
is
used,
with
a
single
sw
eep.
The
example
uses
F
ORM3
transfer,
but
is
applicable
to
F
ORM2
or
F
ORM5
b
y
c
hanging
line
39
to
the
correct
FORM n
.
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
@Nwa
TO
716
!This
sets
up
the
I/O
path
for
the
network
analyzer,
and
15
!defines
the
GPIB
address
used
to
talk
to
it.
17
!
19
ASSIGN
@Nwa_data2
TO
716;FORMAT
OFF!
21
!
23
CLEAR
716
!
25
OUTPUT
@Nwa;"USERPRES;"
!Tells
the
network
analyzer
to
do
a
user
preset.
27
DEG
!BASIC
command
to
express
angles
in
degrees
29
!rather
than
radians.
31
!
33
!The
next
line
selects
201
points,
S11,
log
magnitude
display
35
!Log
Format,
Single
Sweep,
FORM3:
37
!
39
OUTPUT
@Nwa;"POIN201;S11;LOGM;SING;FORM3;"
41
!
43
OUTPUT
@Nwa;"OUTPDATA;"
!Tells
the
network
analyzer
to
output
the
entire
45
!Calibrated
array
(201
points)
47
!
49
ENTER
@Nwa_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
frequency
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
GPIB
Programming
13-11
Summary of Contents for 8510C
Page 7: ...vii ...
Page 29: ......
Page 61: ......
Page 105: ...FORMAT Functions Figure 4 12 Format Function Block and Format Menu 4 26 Measurement Controls ...
Page 106: ...FORMAT Functions Figure 4 13 Format Selections 1 of 2 Measurement Controls 4 27 ...
Page 107: ...FORMAT Functions Figure 4 14 Format Selections 2 of 2 4 28 Measurement Controls ...
Page 122: ...PARAMETER Functions Figure 4 25 Redefine Parameter Menu Structure Measurement Controls 4 43 ...
Page 175: ......
Page 203: ......
Page 273: ......
Page 297: ......
Page 305: ......
Page 391: ......