Agilent Technologies 90235 TV Converter Box User Manual


 
‘lb
Use a
User-Defined
Function within a DLP
A user-defined function is created by using the FUNCDEF command.
1. Begin the user-defined function definition by using the FUNCDEF command, the label
(function name) for the function you are creating, a comma, and then a delimiter. See line
10 of the example.
Use unique names (unique from the analyzer programming commands) for the label.
lb avoid confusion with the internal variables used by the spectrum analyzer, it is
recommended that you use an underscore as the second character of the label.
2. Enter in the programming commands that you want the function to perform. See lines
20 and 30 of the example. Be sure to use semicolons to separate and terminate each
programming command.
Terminating the end of each program line with a semicolon will suppress BASIC’s carriage
return and line feed. This saves memory since the carriage returns and line feeds won’t be
stored in the FUNCDEF.
3. End the FUNCDEF definition by specifying the same delimiter that was used in step 1. See
line 40 of the example. The delimiters are used to enclose the programming commands for
the function.
To avoid problems with the FUNCDEF definition, you should remember the following:
w
A FUNCDEF does not return a value to a calling context like functions do in some languages.
n Loading functions into analyzer memory requires space in the analyzer’s memory. If you
are creating a large DLP, you should see “Determining the Amount of Memory Needed for a
DLP” in this chapter for information on how to determine the amount of available analyzer
memory and the size of the
DLl?
w
Limit the number of characters between the delimiters in the FUNCDEF declaration to a
maximum of 2047 characters. If the function is too large, you may need to segment it into
several functions. See “To Create a Modular DLP” in this chapter for more information.
n Ensure that the commands within the function are spelled correctly, that the syntax for the
command is correct, and that each command is properly terminated with a semicolon.
w
Keep the program lines short. If necessary, divide the spectrum analyzer programming
commands into several lines. See the example.
H
See the description for the FUNCDEF command in Chapter 5 for a list of programming
commands that cannot be used within a FUNCDEF definition.
Example
Executing the following programming lines creates a downloadable program called Z-OOM.
Z-OOM presets the analyzer, sets the center frequency to 300 MHz, sets the span to 10 MHz,
and places a marker on the highest signal. After executing the following lines, Z-OOM will be
in spectrum analyzer memory.
10 OUTPUT
718;"FUNCDEF
Z-OOM,Q";
20 OUTPUT
718;"IP;CF
300MHZ;";
Begins the FUNCDEF d@nition. The
“@”
sign delimits the programming commands
that are within the FUNCDEFcalled Z-OOM.
The semicolon at the end of the line sup-
presses a carriage return and line feed.
Enters IP and CF 300 MH.. commands into
z-OOM.
30 OUTPUT
718;"SP
10MHZ;TS;MKPK HI;";
Enters the SP 10 MHz,
TS,
MKPK
HI com-
mands into Z-OOM.
40 OUTPUT
718*"9*"
3
,
Ends the FUNCDEF definition.
50 LOCAL 718
Places the anal~.zer in local mode.
60
END
Creating and Using Downloadable Programs
4-3