2

Writing a Program

What You’ll Learn in This Chapter
This chapter introduces spectrum analyzer programming. The first section of this chapter,
“Writing Your First Program,
n
helps you write your first spectrum analyzer program and
introduces programming fundamentals. The second section, “Getting Information from the
Spectrum Analyzer,
n
shows how to get data out of the spectrum analyzer. A summary at the
end of this chapter reviews the programming guidelines introduced.
If the computer is not connected to the spectrum analyzer, follow the instructions in Chapter 1,
“Preparing for Use.
A general knowledge of the BASIC programming language and the spectrum analyzer is
recommended before reading this chapter. Refer to your software documentation manuals for
more information about BASIC. For reference, Chapter 5 of this manual provides spectrum
analyzer commands in alphabetical order.
Note All programming examples in this chapter for the HP-IB interface are written
in HP BASIC 4.0, using an HP 9000 Series 200 computer. For the RS-232
interface, examples are written in GW BASIC, using an HP Vectra personal
computer or compatible controller.
Writing a Program
2-l