Agilent Technologies 8590 TV Converter Box User Manual


 
.
FUNCDEF Define Function
Example
Connect
CAL OUT
to the spectrum analyzer input.
IO OUTPUT
718;“IP;”
20 OUTPUT
718;“VARDEF
H-SPAN,O;”
30 OUTPUT
718;“FUNCDEF
S,HIFT,O”;
40 OUTPUT
718;“DIV
H_SPAN,SP,2;“;
50 OUTPUT
718;“ADD
CF,CF,H-SPAN;“;
60
OUTPUT 718*“@*”
70
OUTPUT
718;“KkDEF
l,S-HIFT,%SHIFT-UP%;”
80 OUTPUT
718;“CF
300MHZ;”
90 OUTPUT
718;“SP
IMHZ;“;
100
LOCAL 718
110
END
Initializes spectrum analyzer
D&nes
user-o!@ned
variable with an
initial value of 0.
Creates
user-&@u?d
jimction,
called
SHIFT. Shift divides the span by two
and adds the results to the center fre-
quency. The
Y@”
delimits the
d@inition.
Puts half of span value into
H-SPAN.
Adds H-SPAN to Cl?
Marks the end
of
the FUNCDEF declaration.
Assigns the function
XHIFT
to the
user&$ned
sojtkey,
called
SHITl’-UI?
Displays the calibrator signal.
Returns control to local mode.
The semicolons at
the
end of lines 30, 40, and 50 in
the
example suppress BASIC’s carriage
return and line feed. Adding the semicolons at the end of the lines of a FUNCDEF declaration
saves memory (because the carriage returns and line feeds are not stored in the FUNCDEF).
Description
The FUNCDEF command can be used to create a user-defined function. Note that a
user-defined function does not return a value like functions do in many programming
languages.
‘lb
use the FUNCDEF command, you must specify the function label and the list
of commands it executes. Once a user-defined function is created, it is stored in spectrum
analyzer memory. The user-defined function can be executed by invoking the function name
within the definition of a user-defined
softkey,
another user-defined function, or a computer
program.
‘Ib
delete the function from spectrum analyzer memory, use the DISPOSE command.
(See Chapter 4 for more information about creating and using a FUNCDEF).
The ABORT,
IF/THEN/ELSE/ENDIF,
REPEAT/UNTIL, or RETURN commands are useful
commands for altering the user-defined function’s operation.
The following are general rules and limitations of FUNCDEF:
n Do not use existing function names or secondary keywords (reserved words) as labels for
user-defined functions. See
%ble
5-2 for a list of reserved words.
w
Limit the number of characters (between the delimiters) in the list of spectrum analyzer
commands to a maximum of 2047 characters.
w
The maximum number of nested FUNCDEF declarations is 40. (Nested FUNCDEF
declarations is when one FUNCDEF calls another FUNCDEF.) See the programming example
for the ABORT command for an example of nesting FUNCDEF declarations.
n
Avoid using the
POWERON
LAST, SAVE STATE, and RECALL STATE programming commands
within the function. These commands save
and
recall
a
state that, within auser-defined
function, may only partially recall the saved state.
Programming Commands
5-l
85