2-4 HP IBASIC Supplement
Recording Programs
Keystroke Recording
IBASIC Programs and the Input Buffer
Recorded programs send commands to the instrument, and use the same
set of commands used by external controllers for remote operation of the
instrument.
These commands are stored in an input buffer by the instrument. An
IBASIC program generally outputs the commands much faster than the
instrument can execute them. This often causes the program to complete
while the instrument is still executing commands in the input buffer. The
instrument continues processing these commands until the buffer is
empty.
This may have some side-effects if you are not aware of this interaction.
For example, it may not be immediately obvious that the program has
actually finished, since the instrument is still functioning “remotely.”
This could cause confusion if you try to pause and continue a program
that has actually ended.
You can clear the buffer from within your program by inserting the
statement CLEAR 8 at the beginning of your program (see Chapter 5 for
information on editing programs).
Another side-effect of the speed with which the analyzer processes
commands is that it is possible for a command to execute before a
previous command has completed execution. The most common example
of this is a data query that executes before a measurement sweep is
complete. This interaction can lead to erroneous data being collected. For
more information on synchronizing the execution of commands, refer to
“Synchronizing the Analyzer and a Controller” in the Programmer's
Guide.