HP IBASIC Supplement 8-23
Interfacing with External Devices
Interfacing with an External Controller
Using Status Information
Status information must also be synchronized between the IBASIC
program and a program running on an external controller. The status
information is shared between these programs. Commands which affect
the status information should not overlap between the IBASIC program
and the external controller.
For example:
From an external controller:
OUTPUT 716;”<command>;*OPC?”
ENTER 716;Opc
From IBASIC, simultaneously execute:
OUTPUT 800;”*CLS”
may cause the external controller to not complete execution. The *CLS
command clears status information which the external controller may be
waiting for. The commands which affect status information include
*OPC, *OPC?, *WAI, *CLS, *RST, *SRE, *ESE, and STAT:PRES.
Design Rules
Design your IBASIC and External Controller with the following rules:
• Do not overlap commands between the external controller and
IBASIC.
• Do not change status information which is expected by the alternate
controller. Design programs so status information does not overlap.
See the example program, TRICTRL, which implements a
synchronization protocol between an external controller and two
instruments running IBASIC programs.