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.

Writing Your First Program<br />

When the spectrum analyzer has been connected to a computer via <strong>HP</strong>-IB or RS-232 interface,<br />

the computer can be used to send instructions to the spectrum analyzer. These instructions tell<br />

the spectrum analyzer such things as frequency span, resolution b<strong>and</strong>width, <strong>and</strong> sweep mode.<br />

If a properly selected sequence of instructions is sent to the spectrum analyzer, a measurement<br />

is made. Sequences of coded instructions are called programs.<br />

Composing the. Program<br />

Most spectrum analyzer programs contain several common statements, or “comm<strong>and</strong>s,” that<br />

address the spectrum analyzer, preset it, <strong>and</strong> select its sweep mode. As an example, we will<br />

write a short program that executes only these common comm<strong>and</strong>s.<br />

The following programs are for the <strong>HP</strong>-IB <strong>and</strong> the RS-232 interfaces. Note the quotation marks<br />

that contain spectrum analyzer comm<strong>and</strong>s in each line. Also note the semicolons at the end of<br />

each line, inserted at the end of each set of spectrum analyzer comm<strong>and</strong>s within the quotation<br />

marks. Using semicolons makes programs easier to read, prevents comm<strong>and</strong> misinterpretation,<br />

<strong>and</strong> is recommended by IEEE St<strong>and</strong>ard 728.<br />

Note In comm<strong>and</strong>s where quotation marks occur, the computer recognizes data as<br />

character data <strong>and</strong> not BASIC programming language comm<strong>and</strong>s.<br />

Program Example for the <strong>HP</strong>-IB Interface<br />

05 !File: "IBPROGl"<br />

20 CLEAR Analyzer<br />

30 OUTPUT Analyzer;"IP;"<br />

40 OUTPUT Analyzer;"SNGLS;TS;"<br />

50 LOCAL 7<br />

60 END<br />

Line 10 of our program assigns a variable called “Analyzer” to our spectrum analyzer at address<br />

718. This instruction is followed by the <strong>HP</strong> BASIC CLEAR comm<strong>and</strong>, which resets the spectrum<br />

analyzer on the <strong>HP</strong>-IB. With these two program lines, we have set up a clear communication<br />

path between the computer <strong>and</strong> the spectrum analyzer.<br />

Line 30 introduces the instrument preset (IP) comm<strong>and</strong>, which corresponds to the key<br />

on the spectrum analyzer. The IP comm<strong>and</strong> sets all of the analog parameters of the spectrum<br />

Note All softkey functions on the spectrum analyzer have corresponding<br />

programming comm<strong>and</strong>s. As you continue programming, you will learn the<br />

comm<strong>and</strong> names that correspond to the front-panel keys <strong>and</strong> softkeys.<br />

Line 40 activates the single-sweep mode. Most remotely controlled measurements require<br />

control of the sweep. Once SNGLS has activated the single-sweep mode, take sweep (TS)<br />

starts <strong>and</strong> completes one full sweep. TS maintains absolute control over the sweep, which is<br />

necessary for accurate computer data transfer <strong>and</strong> reduced program execution time.<br />

Before we end the program, we return the spectrum analyzer to front-panel control with line<br />

50, LOCAL 7. The LOCAL comm<strong>and</strong> corresponds to the (LOCAL) key on the front panel<br />

of the spectrum analyzer. (LOCAL 7 comm<strong>and</strong>s everything on the bus to go to local mode.)<br />

2-2 Writing a Program

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

Saved successfully!

Ooh no, something went wrong!