102 Chapter2
Programming Fundamentals
Using the LAN to Control the Analyzer
The computer responds with the following messages:
Trying...
Connected to 15.4.45.255.
Escape character is '^]'.
When you connect to the instrument, it will display a welcome message
and a command prompt.
The instrument is now ready to accept your SCPI commands. As you
type SCPI commands, query results appear on the next line. When you
are done, break the telnet connection using the escape character (in this
case Ctrl ]), and type quit.
The analyzer responds with the a welcome message and the SCPI
prompt. You can immediately enter programming (SCPI) commands.
Typical commands might be:
CONF:SPECTRUM
CALC:SPECTRUM:MARK:TRACE SPECTRUM
CALC:SPECTRUM:MARK:MAX
CALC:SPECTRUM:MARK:MAX?
The small program above sets the analyzer to measure a signal in the
frequency domain, places a marker on the maximum point, and then
queries the analyzer for the amplitude of the marker.
You need to press Enter after typing in each command. After pressing
Enter on the last line in the example above, the analyzer returns the
amplitude level of the marker to your computer and displays it on the
next line. For example, after typing CALC:SPECTRUM:MARK:MAX? and
pressing Enter, the computer would display:
+1.71000000000E+002
When you are done, close the telnet connection. Enter the escape
character to get the telnet prompt. The escape character (Ctrl and "]" in
this example) does not print.
At the telnet prompt, type quit or close.
The telnet connection closes and you see your regular prompt.
Connection closed.
Figure 2-2 shows a terminal screen using the example commands
above.