Agilent Technologies 8590 TV Converter Box User Manual


 
430
T5=601
440
TR6$=TR4$
450
GOSUB
620
460 'convert last two characters
470
L2$=MID$(TRS$,l,l)
480
Yl(80l)=ASC(L2$)
490
L2$=MID$(TR5$,2,1)
500
Y(802)=ASC(L2$)
510 'data is now formatted, write to disk
520 FOR
I=1
TO 202
530 PRINT
#2,X1(1)
540 NEXT I
550 FOR
I=1
TO 802
560 PRINT
#2,Yl(I)
570 NEXT I
580 'close the data file
590 CLOSE
600 GOT0 680
610 'subroutine for converting data:
620 FOR
I=1
TO 200
630
L2$=MID$(TRG$,I,l)
'get ASCII character
640
Yl(T5)=ASC(L2$) 'set value in array
650
T5=T5+1
660 NEXT I
670 RETURN
'done with conversion
680 END
The previous program reads a trace from the spectrum analyzer, then stores it in the variable
called TRCA. The state of the spectrum analyzer is stored in the variable
LEARNS.
These two
variables are then saved in a file called
TRACEA.
Finally, the file is stored on a disk.
Using the data stored in TRCA, the spectrum analyzer settings can be reset according to the
saved state. Then, using the stored trace data, trace data can be viewed on the spectrum
analyzer display.
Line 40 gives the dimensions of the learn string using the GW BASIC DIM command. Learn
strings for the spectrum analyzer require 202 bytes of storage space. Refer to the output learn
string (OL) command description in Chapter 5 for more information.
Line 90 uses TDF B to format the output in binary. Binary provides the fastest data transfer
and requires the least amount of memory to store data. Each data point is transferred in
binary as two 8-bit bytes. The data points are in the internal representation of measurement
data. (See “Different Formats for Trace Data Transfers” at the end of this chapter for more
information about trace data formats.)
When the trace and state data is sent from the spectrum analyzer to the computer, it must be
formatted. Lines 270 through 320 format the trace data.
Programming Topics
3-l
1