Execution Commands; Subprogram Call; Subprogram Pause; Knowing When A Subprogram Is Paused - Agilent Technologies 3458A User Manual

Hide thumbs Also See for 3458A:
Table of Contents

Advertisement

Execution
Subprogram execution commands control the execution of a subprogram.
The syntax statements for the subprogram execution commands are shown
Commands
below.
CALL sub_name
PAUSE
CONT

Subprogram CALL

The CALL command executes the named subprogram and waits for
completion before executing other commands This means that no subsequent
commands are accepted (either from the GPIB interface or the front-panel
keyboard) until the subprogram finishes. The Ready Bit (bit 4 in the 3458A
Status Register) remains "0" while the subprogram is executing. When the
subprogram finishes execution, the Ready Bit is set to "1" indicating that the
3458A is ready to receive additional commands.
The CALL command may also be used in a subprogram to call another
subprogram. This provides the expanded capability of "nested" subprograms.
When using nested subprograms, the calling subprogram is suspended so that
only one subprogram is running at a time. Subprograms can be nested up to
10 deep.

Subprogram PAUSE

The PAUSE command pauses the most recent subprogram executed with the
CALL command. Once a subprogram has been paused, you must execute the
CONT (continue) command to resume execution. The CONT command
allows the subprogram to continue running to completion, starting with the
next command after the PAUSE command.
The 3458A will generate an error if you attempt to execute the CONT
command when a subprogram is not paused.
Knowing When a
The PAUSED? query command returns a "1" if the subprogram is currently
paused or a "0" if the subprogram is running (or finished running). The
Subprogram is Paused
following program shows how to use the PAUSED? command.
10 OUTPUT 722; "RUN DMM_CONF;PAUSE"
20 OUTPUT 722; "PAUSED?"
30 ENTER 722; A
40 IF A=1 THEN PRINT "SUBPROGRAM IS PAUSED"
50 IF A=0 THEN PRINT "SUBPROGRAM IS NOT PAUSED"
60 END

Aborting a Subprogram

The GPIB CLEAR command (see Appendix B) aborts execution of a
subprogram executed with the CALL command. This returns control to the
GPIB command input buffer or the front-panel keyboard.

Exiting a Subprogram

A subprogram will continue to execute until it reaches the SUBEND
command. Control then reverts back to either the subprogram that called it
(nested subprograms) or to the GPIB input buffer or front-panel keyboard
(whichever executed the subprogram). The RETURN command can also be
used to end the subprogram. For example, if you want to have a conditional
termination of the subprogram, place RETURN within an IF...THEN loop
Chapter 7 BASIC Language for the 3458A
277

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents