8-24 HP IBASIC Supplement
Interfacing with External Devices
Interfacing with an External Controller
Transferring Data between Programs
Using OUTPUT and ENTER Statements
All data sent from an external controller to the instrument's external
port is received by the instrument and not by any program running in it.
Therefore, a non-active controller IBASIC program can never enter or
output data via the external interface. In order to pass data between an
external controller and an internal program using OUTPUT and ENTER
statements, the internal program must be given active control and the
external controller must become the non-active controller. HP IBASIC
for Windows and HP BASIC controllers have the ability to enter and
output data via GPIB while acting as a non-active controller.
NOTE Moving data through the GPIB and running a measurement in the host
instrument at the same time can slow both operations significantly. It is
recommended that you do not perform these operations simultaneously.
One method of passing data between the two controllers is to set the
instrument as Talker/Listener and run a program on the external
controller that starts the IBASIC program and passes control to it. The
IBASIC program can then output data to, and enter data from, the
external controller. Two programs listed in the Example Programs Guide
demonstrate how to transfer data between an internal program and an
external controller program. The first program, DATA_EXT, is run from
an external controller. It assumes that a disk containing the
corresponding IBASIC program DATA_INT is in the disk drive of the
analyzer. It remotely loads the IBASIC program, starts it, and then
transfers active control to it. The IBASIC program DATA_INT, with
active control of the interface, queries the external program for the name
of the drive to catalog, and then outputs the catalogued string to the
external program, and then passes active control back. After receiving
the catalog data, the external program goes into a loop (line 1080)
executing a command that continues to generate an error until the host
computer again becomes the active controller, when control is passed
back.