Agilent Technologies 8590 TV Converter Box User Manual


 
Program Example for the RS-232 Interface
In the following program, the apostrophe
(‘)
allows the words that follow to be ignored by the
computer. Thus, they serve as comments in the program.
10 ‘File
=
232PROG3
20 OPEN
"COMl:9600,N,8,1"
AS #1
30 PRINT
#l,"IP;"
40 PRINT
#l,"SNGLS;TS;"
50 'Ask for the center frequency and span
60 PRINT "INPUT THE CENTER FREQUENCY
(MZ)
";
70 INPUT CENTER
80 PRINT "INPUT THE SPAN
(MZ)
'I;
90 INPUT SPAN
100 'Send center freq and span to spectrum analyzer
110 'take a sweep to update screen
120 PRINT
#l,"CF
";CENTER;"MZ;"
130 PRINT
#l,"SP
";SPAN;"MZ;"
140 PRINT
#l,"TS;"
150 'find the signal peak with peak search
160 PRINT
#l,"MKPK
HI;"
170 END
Three modifications are made to the previous program in order to include center frequency and
span variables. First, we use two variables, CENTER and SPAN, to store the frequency and
span parameters.
Second, using the BASIC INPUT command, we ask the computer operator to enter the desired
center frequency and span. (See lines 70 and 90 in previous program example). Next, we
modify the output parameter statements so that the values stored in the CENTER and SPAN
variables are sent to the spectrum analyzer. (See lines 120 and 130.) 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.
Writing a Program
2-7