09.12.2012 Views

HP 8590 E & L Series Spectrum Analyzers and HP 8591C Cable TV ...

HP 8590 E & L Series Spectrum Analyzers and HP 8591C Cable TV ...

HP 8590 E & L Series Spectrum Analyzers and HP 8591C Cable TV ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

430 T5=601<br />

440 TR6$=TR4$<br />

450 GOSUB 620<br />

460 'convert last two characters<br />

470 L2$=MID$(TRS$,l,l)<br />

480 Yl(80l)=ASC(L2$)<br />

490 L2$=MID$(TR5$,2,1)<br />

500 Y(802)=ASC(L2$)<br />

510 'data is now formatted, write to disk<br />

520 FOR I=1 TO 202<br />

530 PRINT #2,X1(1)<br />

540 NEXT I<br />

550 FOR I=1 TO 802<br />

560 PRINT #2,Yl(I)<br />

570 NEXT I<br />

580 'close the data file<br />

590 CLOSE<br />

600 GOT0 680<br />

610 'subroutine for converting data:<br />

620 FOR I=1 TO 200<br />

630 L2$=MID$(TRG$,I,l) 'get ASCII character<br />

640 Yl(T5)=ASC(L2$) 'set value in array<br />

650 T5=T5+1<br />

660 NEXT I<br />

670 RETURN 'done with conversion<br />

680 END<br />

The previous program reads a trace from the spectrum analyzer, then stores it in the variable<br />

called TRCA. The state of the spectrum analyzer is stored in the variable LEARNS. These two<br />

variables are then saved in a file called TRACEA. Finally, the file is stored on a disk.<br />

Using the data stored in TRCA, the spectrum analyzer settings can be reset according to the<br />

saved state. Then, using the stored trace data, trace data can be viewed on the spectrum<br />

analyzer display.<br />

Line 40 gives the dimensions of the learn string using the GW BASIC DIM comm<strong>and</strong>. Learn<br />

strings for the spectrum analyzer require 202 bytes of storage space. Refer to the output learn<br />

string (OL) comm<strong>and</strong> description in Chapter 5 for more information.<br />

Line 90 uses TDF B to format the output in binary. Binary provides the fastest data transfer<br />

<strong>and</strong> requires the least amount of memory to store data. Each data point is transferred in<br />

binary as two 8-bit bytes. The data points are in the internal representation of measurement<br />

data. (See “Different Formats for Trace Data Transfers” at the end of this chapter for more<br />

information about trace data formats.)<br />

When the trace <strong>and</strong> state data is sent from the spectrum analyzer to the computer, it must be<br />

formatted. Lines 270 through 320 format the trace data.<br />

Programming Topics 3-l 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!