Agilent Technologies 8590 TV Converter Box User Manual


 
Enhancing the Program with Variables
In the last program, specific center frequency and span values were set. By modifying the
program, we can cause different values to be set each time the program is run.
Program Example for the HP-IB Interface
In the following program, the exclamation point
(!)
allows the words that follow to be ignored
by the computer. Thus, they serve as comments in the program.
10
!FILE:
“VARIO”
20 REAL
C,freq,S-pan
!define
the variables
30 Analyzer=718
40 CLEAR Analyzer
50 OUTPUT
Analyzer;“IP;SNGLS;TS;”
60
!ask
for the desired center frequency:
70 INPUT “CENTER FREQUENCY (MHz)
?I’,
C-f req
80
!ask for the desired span:
90 INPUT
“SPAN(MHz)?”
,S,pan
100
!send
the center frequency and span to the
110
!analyzer
and take a sweep to update the
120
!analyzer
screen:
130 OUTPUT Analyzer;
“CF
“;C-freq;
“MZ;
‘I
140 OUTPUT Analyzer
;
“SP
I’
;
S-pan;
“MZ
;
‘I
150 OUTPUT Analyzer ;
“TS
;
‘I
160
!find
the signal peak with peak search:
170 OUTPUT Analyzer ;
“MKPK
HI
;
I’
180 LOCAL 7
190 END
Three modifications are made to the previous program so it includes center frequency and span
variables. First, using the HP BASIC REAL command, we define two variables, C-freq and
S-pan. The frequency and span parameters are stored in these variables. (Refer to line 20.)
Second, using the HP BASIC INPUT command, we prompt the user to enter the desired center
frequency and span. The center frequency and span values are entered on the computer;
because the measurement units will be entered by the program, the user does not enter them.
(See lines 70 to 140.)
Third, we modify the output parameter statements so that the values stored in C-freq and
S-pan are sent to the spectrum analyzer. (See lines 130 to 140.)
A sweep is taken after the parameters are sent to the spectrum analyzer, to ensure that the
spectrum analyzer screen is updated before the marker is placed on the highest signal peak.
2-6
Writing a Program