Program Example for the RS-232 Interface
10 'File
=
232PROG9
20 OPEN
"COMl:9600,N,8,1"
AS
#I
30 DEFINT
X,Y,I
'integer variable
40 'define 202-character string
50 DIM
LEARN$(202),Xl(202)
60 'create an 802-character string to store disk data
70 DIM
TR1$(200>,TR2$(200>,TR3$(200),TR4$(200)
80 DIM
TR5$(2>,TR6$(2OO>,Yl(802)
90 'open disk file
"TRACEA"
100 OPEN
"TRACEA"
FOR INPUT AS
#2
110 'enter learn array from disk
120 FOR
I=1
TO 202
130 INPUT
#2,X1(1) 'get integer variable from disk
140 NEXT I
150 'enter trace data from disk
160 FOR
I=1
TO 802
170 INPUT
#2,Yl(I)
180 NEXT I
190 'close the disk file
200 CLOSE
#2
210 'format the integer data into strings
220 'for the spectrum analyzer.
See
232PROG8
for explanation
230
LEARN$="" 'null out the learn string
240 FOR
I=1
TO 202
'format learn string first
250
LEARN$=LEARN$+CHR$(Xl(I))
260 NEXT I
270 'format the trace data
280
12=1
'set the counter
290
GOSUB
500 'do the conversion
300
TRl$=TRG$ 'set the string
310
12=201
320
GOSUB
500
'do the conversion
330
TR2$=TR6$
340
12=401
Programming Topics
3-13