Language Reference

ACTDEF

For example, consider the active function for center wavelength. When the center-wavelength key is pressed, its value is displayed in the active-function readout. Turning the front-panel knob changes the active-function readout and the value of the prede￿ned variable for center wavelength, CENTERWL. Changing the value of CENTERWL, in turn, changes the value of other active functions related to wavelength, such as start and stop wavelength:

STARTWL

=

CENTERWL

0 SPAN/2

STOPWL

=

CENTERWL

+ SP AN/2

The user-de￿ned functions created by ACTDEF have the following characteristics:

￿Text is displayed in the active-function readout, as indicated in the syntax diagram. If omitted, the user-de￿ned function name is displayed in the active-function readout.

￿A temporary variable is created and assigned the initial value indicated in the syntax diagram. The value is displayed in the active function readout.

￿The value of the temporary variable can be changed. Each time the value is changed, the user-de￿ned function (having the same name as the variable) is executed. If the user-de￿ned function has been executed with a front-panel key, the value is changed with the front-panel step keys, knob, or numeric keypad. Remotely, the value is changed by math operations or by executing the user-de￿ned function name followed by a number (see syntax diagram after description).

￿The value of the temporary variable can be returned to the computer, or used for operations with any spectrum-analyzer commands that have prede￿ned variable in their syntax diagrams.

10OUTPUT 723;"ACTDEF COUNT, $Enter number.$,5,INT,$$;"

Create user-de￿ned function.

20OUTPUT 723;"COUNT;"

Execute user-de￿ned function.

produces these results:

￿The user-de￿ned function called COUNT is stored in internal memory.

￿\Enter number" is displayed in the active function readout.

7-13