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 predened 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-dened 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-dened 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-dened function (having the same name as the variable) is executed. If the user-dened 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-dened 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 predened variable in their syntax diagrams.
10OUTPUT 723;"ACTDEF COUNT, $Enter number.$,5,INT,$$;"
Create user-dened function.
20OUTPUT 723;"COUNT;"
Execute user-dened function.
produces these results:
The user-dened function called COUNT is stored in internal memory.
\Enter number" is displayed in the active function readout.