Using
Instrument
B
ASIC
with
an
External
Controller
This
program
transfers
a
program
from
the
Instrument
B
ASIC
memory
to
the
external
controller's
disk
through
the
GPIB
interface
.
This
program
must
be
executed
on
the
external
controller
.
Note
F
or
other
topics
listed
below
,
see
Chapter
7,
\Controlling
Instrument
B
ASIC
from
Remote
,"
of
the
GPIB
Programming
Guide
.
P
assing
control
between
controllers
Transferring
a
program
to
Instrument
B
ASIC
Running
Instrument
B
ASIC
program
from
an
external
controller
program
Referring
to
an
external
controller's
data
array
contents
d
a
c
b
10
DIM
A$[10000]
20
ASSIGN
@Hp4396
TO
717
30
OUTPUT
@Hp4396;"*RST"
40
OUTPUT
@Hp4396;":PROG:DEF?"
50
ENTER
@Hp4396
USING
"#,2A";Head$
60
B=VAL(Head$[2])
70
FOR
I=1
TO
B
80
ENTER
@Hp4396
USING
"%,A";Head$
90
NEXT
I
100
ENTER
@Hp4396
USING
"-K";A$
!
Transfer
the
program
110
!
120
INPUT
"File
name?",File_name$
130
CREATE
ASCII
File_name$,1
140
ASSIGN
@File
TO
File_name$
150
OUTPUT
@File;A$
160
ASSIGN
@File
TO
*
170
END
Figure
6-6.
Transferring
the
Program
to
an
External
Controller
(on
the
External
Controller)
Lines
50
to
90
read
the
le
header:
#NMM
.
.
.
M .
The
rst
byte
is
always
\#".
N
species
the
number
of
bytes
that
denes
the
program
size
.
MM
.
.
.
M
is
program
size
in
byte
(N
digits).
See
:PROGram[:SELected]:DEFine
in
Chapter
2
of
the
GPIB
Command
R
eference
for
more
information.
Note
The
program
to
be
uploaded
must
be
in
either
the
paused
or
stopped
state
.
6-4
Application
Programs