Agilent Technologies 8590 TV Converter Box User Manual


 
Program Example for the RS-232 Interface
10 'File
=
232PROG8
20 OPEN
"COMl:9600,N,8,1"
AS
#I
30 'Define 202-character string
40 DIM
LEARN$(202)
50 'Create 802-character string to store trace data
60 DIM
TR1$(200>,TR2$(200>,TR3$(200)
70 DIM
TR4$(2OO>,TR5$(2>,TR6$(200)
80 'ask spectrum analyzer for trace data in binary format
90 PRINT
#l,"TDF
B;
TRA?;"
100 'enter trace data from spectrum analyzer
110
TRl$=INPUT(200,#1)
'first 200 characters
120
TR2$=INPUT(200,#1)
'second 200 characters
130
TR3$=INPUT(200,#1)
'third 200 characters
140
TR4$=INPUT(200,#1)
'fourth 200 characters
150
TR5$=INPUT(2,#1)
'last two characters
160 'ask for learn string from spectrum analyzer
170 PRINT
#l,"OL;"
180 'get learn string from spectrum analyzer
190
LEARN$=INPUT$(202,#1>
200 'create file to store trace on disk
210 OPEN
"TRACEA"
FOR OUTPUT AS
#2
220 'change ASCII data to integers for disk storage
230 'because ASCII 26 will put EOF on disk
240 DEFINT X,Y,I 'integer variables
250 DIM
Xl(202),Yl(802)
'arrays for the data
260 'first format the learn string
270 FOR I= 1 TO 202
280 'get ASCII character from string
290
L2$=MID$(LEARN$,I,l)
300 'make integer of ASCII value O-255
310
Xl(I)=ASC(L2$)
320 NEXT I
330 'format the data strings
340
T5=1
'set counter
350
TRG$=TRl$
'set string to be converted
360
GOSUB
620 'do the conversion
370
T5=201
'set counter
380
TR6$=TR2$
'set string to be converted
390
GOSUB
620 'do conversion
400
T5=401
410
TR6$=TR3$
420
GOSUB
620
3-l
0
Programming Topics