Subprograms - Agilent Technologies 3458A User Manual

Hide thumbs Also See for 3458A:
Table of Contents

Advertisement

20 OUTPUT 722; "LET A=25.3765477"
30 OUTPUT 722; "IF SIN(A)^2 + COS(A)^2 = 1 THEN"
40 OUTPUT 722; " DISP 'EQUAL'"
50 OUTPUT 722; "ELSE"
60 OUTPUT 722; " DISP'NOT EQUAL'"
70 OUTPUT 722; " ENDIF"
80 OUTPUT 722; "SUBEND"
90 !
100 OUTPUT 722; "CALL TESTER"
110 END
You may find that the equality test fails due to rounding errors or other errors
caused by the inherent limitations of finite machines. A repeating decimal or
irrational number cannot be represented exactly in any finite machine like
the 3458A.
A good example of equality error occurs when multiplying or dividing
numbers. A product of two non-integer values nearly always results in more
digits to the right of the decimal point than existed in either of the two
numbers being multiplied.

Subprograms

The 3458A can store and execute BASIC language subprograms. These
subprograms can either be downloaded into 3458A memory from a remote
system controller (such as one of the HP Series 200/300 computers) or you
can enter the subprogram from the front-panel keyboard. This section
acquaints you with the structure and usage of subprograms. It also discusses
specific commands, which are used within subprograms.
A subprogram is a series of 3458A commands beginning with the SUB
command and ending with the SUBEND command. The SUB command
assigns a name to the subprogram which you use to execute the subprogram
at a later time. Subprograms are stored in 3458A non-volatile memory.
Subprograms downloaded into the 3458A can be executed later with a single
command from the system controller or front-panel keyboard. This allows
the system controller to perform other tasks while the 3458A is busy with
other activities. This provides multi-tasking capability to your system
controller because the 3458A is acting like a separate computer running tasks
by itself. Also, commands within an 3458A subprogram execute faster than
those same commands received over the GPIB because of the way the 3458A
stores the subprogram commands internally.
What Commands Are Allowed Within a Subprogram?
Most commands for the 3458A may be stored and executed inside a
subprogram. The only commands which cannot be stored are CONTINUE,
COMPRESS, DELSUB, and SCRATCH. Three conditional and looping
commands are provided for use within subprograms.
How Many Different Subprograms Can Be Stored?
The exact number of subprograms which can be stored in 3458A memory
Chapter 7 BASIC Language for the 3458A
273

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents