Agilent 8711C User’s Guide Supplement

About this Manual
We’ve added this manual to the Agilent website in an effort to help you support your product. This manual is the best copy we could find; it may be incomplete or contain dated information. If we find a more recent copy in the future, we will add it to the Agilent website.
Support for Your Product
Agilent no longer sells or supports this product. Our service centers may be able to perform calibration if no repair parts are needed, but no other support from Agilent is available. You will find any other available product information on the Agilent Test & Measurement website,
www.tm.agilent.com.
HP References in this Manual
This manual may contain references to HP or Hewlett-Packard. Please note that Hewlett-Packard's former test and measurement, semiconductor products and chemical analysis businesses are now part of Agilent Technologies. We have made no changes to this manual copy. In other documentation, to reduce potential confusion, the only change to product numbers and names has been in the company name prefix: where a product number/name was HP XXXX the current name/number is now Agilent XXXX. For example, model number HP8648A is now model number Agilent 8648A.
Option
lF7
User’s Guide Supplement
HP
871lC/12C/13C/14C/3OA
LAN Interface
HP part number: 08712-90062 Printed in USA
August 1998 Supersedes October 1997
Notice
Key Conventions
Firmware Revision
The information contained in this document is subject to change without notice. Hewlett-Packard makes no warranty of any kind with regard to this material, including but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Hewlett-Packard shah not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material.
This manual uses the following conventions:
[Front-Panel
K~YJ
This represents a key physically located on the instrument (a “hardkey”).
This indicates a “softkey, ’ a key whose label is determined
by the instrument’s Wnware, and is displayed on the right
side of the instrument’s screen next to the eight unlabeled
keys.
This manual documents analyzers with firmware revisions
C.04.52
and above. Some features will not be available or will require different keystrokes in analyzers with earlier hrmware revisions. For full compatibility, you can upgrade your firmware to the latest version. Contact your nearest Hewlett-Packard sales or service office for information.
@Copyright 1996, 1997, 1998 Hewlett-Packard Company

Acknowledgments

Portions of the GIF output routines are by John Silva (derived from Jef Poskanzer’s
package).
JavaTM
Lotus@ Corporation.
Microsoft@ is a U.S. registered trademark of Microsoft Corp. MS@ and MS-DOS@ are U.S. registered trademarks of Microsoft Corporation. MS Windows@, Windows@, Windows
registered trademarks of Microsoft Corporation.
Netscape
Corporation.
Pentium@ PostscriptrM
registered in certain jurisdictions.
ReflectionTM
UNIX@ is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited.
is a U.S. trademark of Sun Microsystems, Inc.
l-2-3@
is a U.S. registered trademark of
TCP/IP
are U.S. registered trademarks of Lotus Development
is a U.S. registered trademark of Intel Corporation.
is a trademark of Adobe Systems Incorporated which may be
is a U.S. trademark of Walker, Richer & Quinn, Inc.
software are copyright Phil
95@,
and Windows NT@ are U.S.
Netscape
Karn, KASQ.
PBMplus
Communications

Introducing the LAN Interface

The Option lF7 LAN Interface lets you connect your analyzer to an Ethernet network that uses
l
Save and recall the analyzer’s settings (instrument state).
l
Transfer
l
Transfer
0
Connect many analyzers to one computer.
l
Automate the control of your analyzers.
l
Program the analyzer using SCPI commands.
l
Print hardcopy directly to an HP LaserJet printer.
l
Access your analyzer’s Web pages. Here you’ll find links to:
BASIC
hles
TCP/IP.
With the LAN interface you can:
programs between your computer and your analyzer.
between your computer and analyzer using FTP.
Expert Assistance
o general information about the HP
87xx
family of analyzers o online documentation such as SCPI command references o specific information about your analyzer such as your current firmware
revision, installed options, even the analyzer’s current screen image. o general information about Hewlett-Packard, and how to obtain
assistance if you need it.
Most sites will hire a network administrator to install the LAN hardware and manage the assignment of IP addresses.
NOTE
Hewlett-Packard offers professional consulting services to help increase your computer and manufacturing productivity. HP system engineers will work with your factory management, engineering, and production groups to evaluate various automation solutions. For more information contact the nearest HP sales office. Refer to Chapter 7 for a table of Hewlett-Packard sales and service offices.
iv

Documentation Outline

This
User’s Guide Supplement
troubleshoot the LAN interface on your analyzer. This supplement contains the following chapters:
1.
Connactinfl md
2. Accrssinl the Analyzefs Web
3. Printing
4. Accessing the
6.
Accessing the
6.
Controlling the Analyzer via the LAN
7. General Troubleshooting
Glossary
Configuring the Analyzer
Paues
Analyzefs
Anelyzefs
File System
Dynamic Data Disk
describes how to connect, use and
Provides information about connecting the analyzer to the network. To effectively use this chapter, you should be familiar with your network setup and operation.
Describes how to use a Web browser to access built-in Web pages. Describes how to configure-and dump a hardcopy to-a network
printer. Describes how to access the analyzer’s file system using file transfer
protocol
IFTPI.
The directory structure of the analyzer is described
here. Describes the analyzer’s “data’ directory, the dynamic data disk.
Includes an example program. Shows you methods for programming the analyzer via the network
connection. Describes what to do if you have a problem using the analyzer on
your network. Definitions for networking and other terms used in this book.
V
Contents
1.
Connecting and Configuring the Analyzer
Connecting the Analyzer to the LAN .........
Setting Up a Network
Point-to-Point Connections
Configuring the Analyzer ...............
The Analyzer’s IP Address and The Gateway Address
The The Ethernet Address To Configure the Analyzer
Verifying Connectivity
Running Ping under Windows 95 Running Ping under UNIX
2.
Accessing the Analyzer’s Web Pages
Accessing the Analyzer with your Web Browser .....
Screen Snapshot Analyzer Configuration Product Documentation Product Overview Other Links
Subnet
................
.............
Hostname
...............
Mask
.................
...............
.............
................
..........
.............
..................
...............
..............
.................
...................
......
l-3 l-4 l-5 l-6 l-6 l-7 l-7
1-8
l-9 l-10 l-10 l-11
2-3 2-4 2-4 2-5 2-6 2-6
3. Printing
Configuring the Printer ...............
Configuring the Analyzer for Printing to a LAN Printer
If You Have Trouble Printing .............
4.
Accessing the Analyzer’s File System
Using FTP to Access the Analyzer ..........
Example 1: Copy a File to the Analyzer
Example 2: Retrieve a File from the Analyzer
Commonly Used FTP Commands ...........
Using GUI FTP Software ...............
Example: Transferring Files between the Analyzer and
your PC.
...................
.......
.....
3-3 3-4
.
3-6
4-3 4-5 4-7 4-8
4-10
4-10
Contents- 1
5.
Accessing the Analyzer’s Dynamic Data Disk
Saving and Recalling Analyzer States
Copying Programs to and from the Analyzer
To Copy an IBASIC Program to or from the Analyzer . To Copy and Run a Program with One Command
Copying a Screen Image to a Local File Copying Instrument Parameters in ASCII Text Format . . Retrieving Measurement Data in ASCII Format Importing Graphics or Data into PC Applications
Import a Screen Snapshot into a Word Processor
Program
Import Trace Data into a Spreadsheet Program
6.
Controlling the Analyzer via the LAN
The Command Parser Port
Entering Commands Directly using Telnet
Programming the Analyzer within a C Program
IBASIC
Controlling Multiple Analyzers using a Controlling the Analyzer using HP VEE Controlling the Analyzer with a Controlling the Analyzer using HP BASIC
Communication Across the LAN
...................
..............
JavaTM
.........
.......
........
......
........
Per1
Script
........
Applet
.......
7. General Troubleshooting
Troubleshooting the Initial Connection
Assess the Problem
Ping the Analyzer from your Computer or Workstation
Ping your Computer or Other Device from your Analyzer
Subnets
Solutions to Common Problems
Getting Service Support
and Gateways
Troubleshooting
If you cannot connect to the analyzer
If you cannot access the file system via ftp
If you cannot telnet to the command parser port
If you get an “operation timed-out” message
If all else fails
HP on-site service
Return to HP service
...................
................
................
Subnet
Problems
............
...............
.................
...............
.........
..........
........
......
...
.....
....
....
....
....
.....
...
.....
5-4
5-6
5-6 5-8
5-9 5-11 5-12 5-13
5-13 5-14
6-3
6-3
6-6 6-26 6-29 6-33 6-35 6-43
7-3
7-3
7-4
7-6
7-9 7-11 7-12 7-12 7-13 7-13 7-14 7-14 7-15 7-15 7-15
Contents-2
Glossary Index
Contents-3
Figures
l-l. The LAN ETHERTWIST Port
3-l. Selecting and Configuring the LAN Printer 5-
1.
screen.hgl
5-2. screen-m.hgl 5-3. Trace Data and Screen Snapshot Imported into a Spreadsheet
6-l. Sample HP VEE Screen 7-l. Example of a Successful Ping
7-2. Example of a Failed Ping 7-3. Example of a LAN with Two
.......................
......................
...............
.........
.................
...............
.................
Subnets
...........
Tables
4-l. FTP Commands 5-l. The Dynamic Data Disk Contents 7-l. Hewlett-Packard Sales and Service Offices
.....................
.............
.........
l-3
3-4
5-10
5-10
5-15
6-34
7-7 7-8 7-9
4-9
5-2
7-16
Contents-4
1

Connecting and Configuring the Analyzer

Connecting and Configuring the Analyzer

This chapter describes:
l
how to connect your analyzer to your network
l
how to set up a network
l
how to configure your analyzer
l
how to verify connectivity
In order to complete the steps in this chapter, you’ll need:
l
Option lF7 installed in your analyzer
l
A computer with a LAN interface, running an operating system that
supports
typical computer would be an IBM-compatible
lOBase-T
l
A computer program that talks over or telnet program, or a program that you write. This detail in the following chapters.
TCP/IP.
For example: UNIX@ or Microsoft Windows
Pentium@-based
LAN card, or an HP 5210 PA-RISC workstation.
TCP/Il?
This might be the built-in FTP
will
be covered in
95@.
A
PC with a
l
LAN cabling, and typically a LAN hub.
If you
l
l
l
only
wish to dump hardcopy to a LaserJet printer,
you’ll
need:
Option lF7 installed in your analyzer
An HP LaserJet printer with an HP JetDirect LAN interface card
LAN cabling, and typically, a LAN hub
Note to Novell Netware users
Older versions of Novell Netware used IPX networking protocol exclusively IPX protocol is not compatible with
Newer versions of Novell Netware, such as version provide a gateway to a information on using Novell Netware with
TCP/IP
protocol.
3.1x
and 4.xx allow for add-on products which
TCPllP
network. Consult your Novell network administrator for the latest
TCPllP
protocol.
l-2

Connecting the Analyzer to the LAN

Your analyzer has an your network using
RJ-45
connector (see Figure l-l), and connects to
lOBase-T
twisted pair cabling, also called Ethertwist.
Ethertwist cables resemble a standard modular phone line.
NOTE
If your network uses ThinLAN ThinLAN BNC connector to
HOBase-21,
lOBase-T
you will need to purchase an adapter which converts the
Ethertwist.
To connect the analyzer to your network:
1. Turn off the analyzer.
2. Connect the Ethertwist cable from your network to the LAN ETHERTWIST port on the rear of your analyzer and then turn on the analyzer.
LAN
ETHERTWIST
I

Setting Up a Network

If you do not already have a network, you will need to create one. A simple network consists of a central LAN hub with multiple Ethertwist cables, one
connected to the LAN port of each network device. This is often called a star
topology, with the LAN hub at the center.
Typical &port hub:
HP J2610B AdvanceStack lOBase-T Hub-W
Typical
Typical Ethertwist cables:
lb order cables, contact the nearest Hewlett-Packard sales or service office. See Chapter 7 for a table of sales and service offices.
16-port
HP
J2611B AdvanceStack lOBase-T Hub-16U
HP
92268A
HP
92268B
HP 922686 Twisted-pair “straight-through” cable, 16 meters HP
92268D
HP
92268N
hub:
Twisted-pair “straight-through” cable, 4 meters
Twisted-pan “straight-through” cable, 8 meters
Twisted-pair “straight-through” cable, 32 meters Twisted-pair “straight-through” cable, 300 meters
l-4
Connecting and Configuring the Analyzer
Setting Up a Network

Point-to-Point Connections

It is possible to connect a single computer to a single analyzer, and avoid using a LAN hub. lb do this, you must use a special “cross-over” cable or adapter, which acts like a LAN hub. If you try to create a point-to-point connection using a standard “straight through” cable, it will not work. For most applications, use of a LAN hub is simpler, and provides expandability.
NOTE
Point-to-point connections may not work when connecting to older laser printers. Older printers typically require a boot server for network use. To use a point-to-point connection with a printer, use an HP LaserJet 4 or newer.
l-5

Configuring the Analyzer

Before you configure your analyzer, you will need to contact your network administrator to obtain an IP address for your analyzer. You will also want to ask your network administrator about a unique hostname for your analyzer, a gateway IP address, and a subnet mask.
CAUTION
The Analyzer’s IP
Each device on your network must have a unique address so that all devices can communicate simultaneously over the same network. These unique addresses are called IP addresses, and are assigned by your network administrator. IP addresses are a set of 4 decimal numbers, separated by periods. For example: 192.170.128.21
You may also receive (or request) from your network administrator a
hostname for your analyzer.
For example:
The hostname is not required, but can be used on your computer so that you don’t have to remember the IP address. Typically, the hostname is found in the hosts file on your computer or returned by a name server.
Your network administrator will apply for a range of IP addresses from the Internet Network Information Center (InterNIC). InterNIC is responsible for registering domain names and assigning to networks that connect to the Internet. You may contact InterNIC via e-mail at hostmaster@internic.net, or by accessing their Web site at
http://rs.internic.net/.
It is important that no two devices are assigned the same IP address, or else conflicts will occur.
my87
11
Address and
Hostname
TCPLP
network numbers
l-6
Connecting and Configuring the Analyzer
Configuring the Analyzer
The
Gateway
Address
If your analyzer will be communicating with devices on different physical networks, you may need to have your network administrator assign a gateway IP address for you. The gateway IP address is the address of a routing device that connects your analyzer’s LAN with other
NOTE
See
“Subnets
and Gateways” in Chapter 7 for more information on gateway addresses.
LANs.
The Subnet
Mask
If your analyzer will be communicating with devices on different physical networks, you may need to have your network administrator assign a subnet mask number for you. The subnet mask tells your analyzer whether a remote device is on the same LAN as your analyzer. If your analyzer is attempting to communicate with another device, the subnet mask defines whether your analyzer needs to route communications through the gateway.
NOTE
See
“Subnets
and Gateways” in Chapter 7 for more information on
subnet
masks.
l-7
Connecting and Configuring the Analyzer
Configuring the Analyzer
The
Ethernet Address
Your analyzer has a unique built-in Ethernet address associated with the
LAN hardware inside the analyzer. The Ethernet address is a
assigned at the factory. The Ethernet address cannot be changed, and you
should not have to be concerned about it. In this document, the term “LAN
address” refers to the IP address.
4%bit
number
1-8
Connecting and Configuring the Analyzer
Configuring the Analyzer
To Configure the
1.
Press
NOTE
After each of the following steps, the analyzer will prompt you to cycle power for the new setting to take effect. It is not necessary to cycle the power after each step. It only needs to be done when you are finished entering all of the settings.
2. Set the
CSYSTEM
LAf Stata
OPTIONS) LAM to access the LAN menu.
Analyzer
once-
setting to ON if it isn’t already. If you do not wish to use your analyzer’s LAN, you can turn this to OFF. When OFF, networking is disabled, and more memory is available to
IBASIC
and the volatile RAM
disk.
3. Press
LAW Pur% Set;q WXXX EP
&d&es8 , and enter the IP address that your network administrator assigned to your analyzer. You may have also received a hostname (for example: the
hostname
into your analyzer, just the IP address. The
my8711).
You cannot enter
hostname
can be used on your computer, so that you don’t have to remember the IP address.
4. Press
Gatasua;p IP Ad&ess
, and enter the numbers assigned to you by your network administrator. If you were not assigned a gateway IP address, leave the setting at 0.0.0.0 (default value) to disable gateway routing.
5.
Press Subn&
#ask
, and enter the numbers assigned to you by your network administrator. If you were not assigned a subnet mask, leave the setting at 0.0.0.0 (default value) to disable subnet masking.
6. Once you have entered these settings, cycle the power on your analyzer, so that it can re-initialize its LAN interface with these new values.
l-9

Verifying Connectivity

You should now verify connectivity between your computer and your analyzer.
The ping utility is typically used to test connectivity.
Running Ping
under Windows 95
At the command prompt of a DOS window, type:
ping
<IPaddress>
or
ping
<hostname>
where
steps above, and <hostname> is the
For example, type ping
<IPaddress>
is the number you entered into your analyzer in the
my87
hostnarne
11.
assigned to your IP address.
You should see something like this:
Pinging
Reply from 15.4.43.5: bytes=32 Reply from 15.4.43.5: bytes=32 Reply from 15.4.43.5: bytes=32 Reply from 15.4.43.5: bytes=32
my8711
C15.4.43.53 with 32 bytes of data:
time=37ms TTL=252 time=3Oms TTL=252 time=3Oms TTL=252 time=3lms TTL=252
If you see something like this:
Request timed out. Request timed out. Request timed out. Request timed out.
your connection may have a problem. Refer to Chapter 7 for troubleshooting
help and information.
l-10
Connecting and Configuring the Analyzer
Running Ping
The ping program is typically found in the
under UNIX
“/et?
or
“/usr/etc”
directory, so
you must add the appropriate directory to your PATH, or type the full path:
/etc/ping <IP
or
/etc/ping <hostname>
address> 64 5
64 5
This command tells ping to send 5 packets of 64 bytes each. The output should look something like this:
PING hostname: 64 byte packets
64
bytes
64
bytes
64
bytes
64
bytes
64
bytes
---­5 packets transmitted, 5 packets received, 0% packet loss round-trip
from from from from from
hostname
15.4.43.5:
15.4.43.5:
15.4.43.5: icmp,seq=2. time=4.
15.4.43.5: icmp,seq=3. time=3.
15.4.43.5:
PING Statistics----
(ms) min/avg/max
icmp,seq=O. icmp-seq=l.
icmp_seq=4.
=
3/4/8
time=8. time=4.
time=3.
ms ms ms ms ms
If you do not see any output after about 20 seconds, interrupt the ping command using ^c (hold down the
this, ping should provide some statistics on how many packets were sent and
received. If the statistics look like this:
“Ctrl”
key, and press .c”). Once you do
----
hostname
4 packets transmitted, 0 packets received, 100% packet loss
your connection may have a problem. Refer to Chapter 7 for troubleshooting help and information.
PING Statistics----
l-11
2
Accessing the Analyzer’s Web Pages
Accessing the Analyzer’s Web Pages
Your analyzer has built-in Web pages that are accessible with a Web browser such as links to general product information, selected online documentation, benchmarks, Hewlett-Packard sites. You can also E-mail us with your comments and feedback on the HP
Before you can access your analyzer with a Web browser, you need to connect and configure your analyzer as described in Chapter 1.
Netscape
specihc
or Microsoft@ Internet Explorer. These Web pages contain
information about your analyzer, and general
87xx
family of analyzers.
2-2
Accessing the Analyzer with your Web Browser
lb access your analyzer, start your Web browser and connect to
“http://my8711”,
your analyzer. When you are connected to your analyzer, a Web page will appear with the
following information on it:
l
Get a current screen snapshot.
l
Examine your analyzer’s conhguration.
l
Browse selected product documentation.
l
Review the Product Summary.
l
Other links
Click on the hyperlinks (any underlined words) to browse through the analyzer’s pages.
where
“my8711”
is the
hostname
that has been assigned to
The rest of this chapter explains some of the areas you can browse in further
detail.
2-3
Accessing the Analyzer’s Web Pages
Accessing the Analyzer with your Web Browser

Screen Snapshot

Clicking on “Get a current screen snapshot” shows an exact copy of your analyzer’s current screen image. Using your Web browser’s “reload” function
assures you of having the most current image.
CAUTION
The screen image takes a few seconds to load. Do not push any buttons on the analyzer or send any programmin
g commands to it while the snapshot is
loading, or an inaccurate image may result.
\
NOTE
Before capturing the screen image with your Web browser, you may wish to customize the look of the
image using the more information.) In particular, you may want to choose
background, especially if you plan to print the page from your Web browser.
Analyzer
Clicking on “Examine your analyzer’s of information that is equivalent to pressing (SYSTEM OPTIONS]
Xnstm@#S
Calo~ O@fon~
menu on your analyzer.
fn~~~s+
Gee
your analyzer’s
Vidm
Configuration
conEguration”
I&J
on the analyzer. This screen provides the model and
brings up a screen
llser’s Guide
to create a white
%wvico
for
serial number of your analyzer, Ermware revision, installed options, and amount of memory.
2-4
Accessing the Analyzer’s Web Pages
Accessing the Analyzer with your Web Browser

Product Documentation

This section provides selected portions of your analyzer’s documentation online, as well as benchmark information and information about product upgrades and options.
The following list shows the links currently available on this page:
l
Optimizing your Measurements
l
Accessing Built-in Disks
0
Controlling I/O Ports
l
Accessing the Analyzer’s file system via the LAN
l
Accessing the Dynamic Data Disk via the LAN
l
Controlling the Analyzer via the LAN
l
HP
871xC
SCPI command reference
l
HP
8730A
SCPI command reference
l
IEE 488.2 common commands
l
Product Upgrades and Options
l
Transfer Speeds using
l
Transfer Speeds using LAN
l
Printing Speed
l
List of printed manuals
HP-II3
If there are additional portions of the analyzer’s documentation that you think would be helpful to have online, please contact us via E-mail. Click on
“Contact HP” and “Send us your feedback!’ from your analyzer’s Web page.
2-5
Accessing the Analyzer’s Web Pages
Product
The links in this area provide generic information about the HP and HP available options are among the information provided here.
Other
At the bottom of every Web page in the analyzer, you’ll find the following links:
TOP
Search Contact HP
Copyright
Overview
8730A
family of analyzers. New features, compatibility issues, and
Links
takes you to the top of the current page. takes you to the “Product Documentation” page. takes you to a page that provides links to HP Web sites, as
well as the opportunity to provide HP with feedback on your analyzer and its documentation.
takes you to copyright information.
871xC
2-6
3

Printing

Printing

Your analyzer can send hardcopy output directly to an HP LaserJet printer on your network. In order to print to a LAN printer, your analyzer must have the LAN state turned on, it must have its IP address set, and it must be connected to your network. Refer to Chapter 1 if you have not yet configured your analyzer as described.
Compatible Printers
The HP LaserJet 4 and HP LaserJet 5 families of printers are compatible with your analyzer for printing directly via a point-to-point connection or over your network. These newer printers allow you to enter the printer’s IP address directly from the front panel and do not require a boot server computer. Your printer should have a
Some older printers, such as an HP LaserJet Ill, do not allow you to enter an IP address from the front panel. They require a boot server computer on the network that configures (sets) the printer’s IP address.
JetDirect
LAN card installed.
3-2

Configuring the Printer

Refer to your printer’s documentation for instructions on how to set up your
printer for LAN usage. Typically, you will need to contact your network administrator to assign a unique IP address for your printer. Your printer software will turned on.
conEgure
the printer with the assigned IP address each time it is
3-3

Configuring the Analyzer for Printing to a LAN Printer

‘lb
set up your analyzer to print hardcopies to a LAN printer:
1.
Press
2. Use the front panel knob, or the a a keys to highlight the LaserJet LAN printer in the table. See Figure
3.
Press
(jHARD]
Sebct
Select
. See Figure
Copy
3-l.
Port .
3-l.
HARDCOPY DEVICE: File.
File Name
II
VICE TYPE
LANGUAGE HARDCOPY PORT
E
HP Plotter HPGL Parallel Port HP Plotter HP Plotter HP Printer HP Printer HP
Printer
Epson Compatible EPSDN Epson Compatible
- “INT:PLOTn’
File
File
File
File
HP LaserJet HP LaserJet HP LaserJet
“‘-“----“‘-“““““““““-‘------------------------------------;
HP LaserJet
.___________________-------------------------------------~
PCL!i/E PCL5/6 PCL5/6 PCLW6
HPGL. Internal Disk
HPGL HPGL
PCL
PCL
PCL
RS232 HP-18
Perellel Port
RS232
HP-IB
Parallel Port
EPSON HPGL
PCX
HPGL
PCX PCLS PCL5 PCLS HP-IB PCL5
RS232
Internal Disk Internal Disk
Non-V01 Non-V01
Parallel Port
1X3232 Ser ia 1
LAN
Serial
Ser ia 1
Set- ia 1
RAM Disk RAM Disk
Restore
Defaults
r--------I
Select
I
.-------
F-----------t
j
LAN
PPintr; /
IP
L---------
Print/Plot
HP-18
Addrl
Addr
Baud Rate
Xon/Xof
OTR/DSR
Step 3
/
Step 4
i
-,
-1
f
Step 2
3-4
Figure 3-1. Selecting and Configuring the LAN Printer
Printing
Configuring the Analyzer for Printing to a LAN Printer
4.
Press
LIW Printr fP Mdr
the network printer you wish to use. Use the
. See Figure
3-l.
Enter the IP address of
C&XV&T IWtq
key to clear
the current or default setting, and then input the IP address using the
analyzer’s numeric keypad. (You can also use a keyboard connected to the
rear panel DIN KEYBOARD connector to enter the IP address.)
5.
Press
PT&OT‘ WSIW
conEguration,
and use the
and the
Deitie
D&f fns PCX.5
key to set up the printer
H~~cop~ key to
deEne
the output. See your analyzer’s User’s Guide for information on configuring printers and
deEning
NOTE
You can print color screen dumps if you send the output to an HP Color LaserJet or HP Color LaserJet
5 printer. Press
output.
Define PC%5 CbloT‘
.
6. After you have completed the previous steps, you can send a hardcopy to your LAN printer by simply pressing
CHARDCOPY) Stat
.

If You Have Trouble Printing

q
Make sure the LAN state is set to ON (see Chapter
q
Make sure the analyzer’s LAN
q
Make sure the printer is configured properly. Refer to your printer’s
II?
address has been set (see Chapter 1).
documentation or your network administrator.
q
Verify connectivity to printer using the analyzer’s built-in ping diagnostic
utility (see Chapter 7).
l),
3-6
4
Accessing the Analyzer’s File System
Accessing the Analyzer’s File System
CAUTION
CAUTION
This chapter shows you how to access the analyzer’s transfer protocol (FTP). This chapter also contains two simple examples: one for copying a a
lile
from the analyzer to your computer. The last section of this chapter
contains a summary of commonly used ftp commands. This chapter assumes that your analyzer is physically connected to your local
area network. If it is not connected, refer to Chapter 1 for information on how to connect the system.
When you access the analyzer, you will have read and write access to the analyzer’s
are described in Chapter 5).
It is possible to have multiple FTP sessions open to your analyzer simultaneously. Files can be corrupted when more than one session is accessing the analyzer at a time. accessing the analyzer’s file system at a time.
This caution also applies to file system access performed via SCPI commands over the LAN, HP-IB, or
There is no password protection built into the analyzer. This means that files are not protected against either deletion or being written over.
file
to the analyzer from your computer, and one for copying
iile
system (except for some files in the dynamic “data” disk, which
‘lake
care to not have more than one session
IBASIC.
lile
system using file
4-2

Using FTP to Access the Analyzer

If you are using a
UNIX
workstation, you have built-in networking software that includes ftp. The same is true if you are operating under Windows 95.
lf
you are operating under Windows 3.1, you will need to have additional
networking software that includes ftp.
NOTE
There are versions of FTP programs available with a graphical user interface Software” later in this chapter for information on using these types of programs.
IGUI).
See “Using GUI
FTP
To access the analyzer’s file system using ftp:
1. Enter the following command on your computer or workstation: ftp
<hostname>
or
ftp
<IP
address>
For example, type f tp
2. When the connection is made, you will be prompted for a
my87
11.
login
name. Just
press the Return or Enter key on your computer.
3. lf you are prompted for a password, just press the Return or Enter key on your computer. There is no password protection built into your analyzer.
4. You should now have a prompt on your computer display that looks like this:
ftp>
4-3
Accessing the Analyzer’s File
Using
FTP
to Access the Analyzer
&stem
5. Type dir at the prompt. Your computer display should return something that looks like this:
200 Port command okay
150 Opening drwxrwxrwx drwxrwxrwx
drwxrwxrwx drwxrwxrwx
data connection
2 root 2 root 2 root 2 root
SYS SYS
SYS SYS
for
LIST
/
1024 1024 1024 1024
Ott Ott Ott Ott
9
1997
9
1997 9 1997 9
1997
int nvram ram data
226 File sent OK
You can read and write
files
to:
int-a DOS formatted floppy disk in the analyzer’s 3.5” floppy disk
drive nvram-the analyzer’s internal non-volatile memory ram-the analyzer’s internal volatile memory
The data directory is a dynamic data disk with files that are linked
directly to analyzer operations. See Chapter 5 for information on accessing
and using this directory.
6. Use the examples in this chapter to copy a file to the analyzer and to retrieve a
fle
from the analyzer. Also see “Commonly Used FTP
Commands” in this chapter for commonly used ftp commands.
4-4
Accessing the Analyzer's File System
Using FTP to Access the Analyzer
CAUTION
Example 1:
Copy a
File to
the Analyzer
You can copy files from your computer to your analyzer. For instance, you may want to develop an
IRASIC
program on your computer and then copy it
to the analyzer so that you can run it from the front panel of the analyzer.
This example copies a file,
“ib-prog”,
from your computer to the analyzer’s
nvram disk.
1. On your computer or workstation, change directories to the directory that contains the file “ib-prog.”
2. On your computer or workstation, access the analyzer by typing ftp
hostname.
enter a
Press Return or Enter twice (remember you don’t need to
login
name or password).
3. Change to the non-volatile RAM disk in the analyzer by typing cd nvram at the ftp prompt.
4. Specify the type of
ascii at the ftp prompt.
Binary
llles
can be corrupted if you attempt to transfer them in “ascii” mode.
lile
you will be transferring by typing either binary or
5. Type put ib,prog at the ftp prompt.
6. Type bye at the ftp prompt to exit ftp.
You can can now recall and run the program from the front panel of your analyzer.
1.
Press [SAVE RECALL)
2.
Press
Prkar Renu Progr?ams
Sslect DE&B Non-V61 RAM ~tgk
Use the front panel knob to highlight the
.
.
IB-PROG hle.
3. Press Recall Program
Bun.
4-5
Accessing the Analyzer’s File System
Using FTP to Access the Analyzer
NOTE
You can also download and automatically run Chapter 5 for information on accessing this disk.
IHASIC
programs by accessing the data disk. See
Copying Files from UNIX
When
copYing
files from a UNIX environment to the analyzer, files that do not meet the DOS file-naming criteria comply For example, if You copy a file from UNIX named
“ibasic-pabc”
(58
characters in filename, with 13 characters in
on the analyzer. There will be no feedback or indication from ftp that this has occurred.
extensiont
“ibasic-program.abcd”
will be truncated to
it will appear as
4-6
Accessing the Analyzer’s File System
UsinN
FTP to Access the Analyzer
Example 2:
You can copy files from your analyzer to your computer. For instance, you may want to retrieve saved measurement data from your analyzer (or a group of analyzers) for statistical analysis on your computer. In another scenario, you may have automated your measurement system with an saving data and/or instrument states to the analyzer’s RAM disk. Your remote computer could, asynchronously, be copying and then deleting the the RAM disk, assuring backup of data, and preventing the RAM disk from filling up.
You may also want to copy instrument states and calibrations to your computer as a backup, eliminating the need for backups on floppy disks.
This example copies a a directory on your computer or workstation.
1. On your computer or workstation, access the analyzer by typing ftp hostname. Press Return or Enter twice (remember you don’t need to
enter a
2. Change to the non-volatile RAM disk in the analyzer by typing cd nvram at the ftp prompt.
3. If necessary, use the
your computer where you want to put the file. For example: type
led /users/myname/87lx_data.
Retrieve a
flIe “STATE:!.STA”
login
name or password).
led
File from
from your analyzer’s nvram disk to
command to change to the local directory on
the Analyzer
IBASIC
program
hles
from
CAUTION
4. Specify the type of file you will be transferring by typing either binary or ascii at the ftp prompt.
Binary
5. Type get
6. Type bye at the ftp prompt to exit ftp.
7. Verify the
iiles
can be corrupted if you attempt to transfer them in “ascii” mode.
copied to.
state2.
ille
sta at the ftp prompt.
was copied by listing the contents of the directory it was
4-7

Commonly Used FTP Commands

The exact commands you use within ftp depend on the software. If you are not familiar with your ftp software, type see a list of commands.
The following table lists and provides a brief description of some commonly used ftp commands.
I‘?”
or “help” at the ftp prompt to
4-8
Table 4-1. FTP Commands
Accessing the Analyzer’s File System
Commonly Used FTP Commands
Command
ascii binarv Sets the file transfer
bye
cd remoredireaory delete remote-fib dir
[remote-direaoryl
get
remureA
help Provides a list of ftp commands. help commend imaoe Icd
[local-dkeaoryl
Is
[remote-direaory]
mget
mput
[remore-fihl
[low/-fibs]
[/oM/J%]
Sets the file transfer type to ASCII.
tvoe
to binarv.
Closes the connection to the host and exits ftp.
I
Sets the working directory on the host to Deletes remote-fib or empty remote-direaory. lists the contents of the specified
contents of the current remote directory ara listed. Copies
remureA,
the
lowlJ&
Provides a brief description of commend. Sets the file transfer tvoe to binarv.
Sets the local working directory to /owLdkeaory. lists the contents of the specified
the contents of the current remote directory ere listed. Copies multiple remore-fibs to the local system. Supports metacharacters such as Copies multiple
name.
low/-fibs
to
/ow/LfiY.
to the remote system. Supports metacharacters such as
Description
remore-direaory.
remore-dimaory.
If /ow/Lfih~ is unspecified, ftp uses the
remoteAieaory.
If remofe-direaory is unspecified, the
If the remore-diieaory is unspecified,
remore-&
I
name as
‘*‘. I+‘.
put
/ow/JiIs
[remote-fib]
quit Closes the connection to the host and exits ftp.
Copies
the
low/&
remote-&
to remote name.
fik
If remote-fib is unspecified, ftp uses the
low/-r%
name es
4-9

Using GUI FTP Software

There are versions of FTP programs available with a graphical user interface (GUI). These programs can make transferring your PC a simple “drag and drop” function.
NOTE
hles
between the analyzer and
The procedures in this section were developed using intended as examples only Other GUI directory format, and will probably have different steps.
Example:
Transferring
FTP
software may not be able to understand the analyzer’s
Files
and your PC
This example copies a
nvram disk.
1. Start the FTP program and
l
Set View
normal window.)
l
Under the Options menu, set Server Directory Format to List
Filenames Only.
hle,
“ib-prog” ,
conhgure
to
Split Window. (View both the command window and the
ReflectionTM FTP
for Windows
NT@.
They are
between the Analyzer
from your computer to the analyzer’s
as follows:
2. Type your analyzer’s
3. Click on Open.
4-10
hostname
in the Server Name box.
Accessing the Analyzer’s File System
4. You will be prompted for a user name. Since the analyzer does not require this (but the program does), you can type anything in the box. One character will
sufhce.
5. You will be prompted for a password. This is not required. Just click on OK.
6. To change to the non-volatile RAM disk in the analyzer, click inside the command window and then type cd nvram at the
ftp>
prompt.
7. Use the Client side of the window to change directories on your PC to the directory that contains the
hle “ib-prog”.
CAUTION
8. Click on the file
“ib-prog”
and “drag” it over to the Server side of the
window and “drop” it.
9. The file has been transferred to the non-volatile RAM disk on your analyzer.
10. lb drag and drop multiple fles, just hold down the @ key on your PC while selecting files with the mouse. Then when you drag and drop, your
entire selection will be transferred.
11. You can also transfer
hles
from the analyzer to your computer by
dragging files in the other direction.
Be sure to use the appropriate
hle
transfer method (binary or ASCII) for the file(s) you are transferring. If you are transferring files to or from the analyzer’s dynamic data disk, check
‘fable
5-l for
hle
types.
4-11
5
Accessing the Analyzer’s Dynamic Data Disk
Accessing the Analyzer’s Dynamic Data
Disk
Your analyzer has an ftp directory called “data,” which is a dynamic data disk. The you can put another analyzer’s instrument state into this directory and the analyzer will automatically recall this state. You can do the same with an
BASIC
automatically run. You can also pull a screendump from the analyzer directly into a file in either PCX or HP-GL format.
llIes
in this directory trigger analyzer operations. So, for example,
program: copy it to the analyzer’s data directory and it will
File
ttatortal
colrtal
data.sta’
trot-caLcall
The following
liles
make up the contents of the dynamic data disk:
Table
5-l.
The Dynamic Data Disk Contents
File Type Description
binary
binary This file contains the analyzer’s currant calibration and instrument state settings. The
binary
binary
This file contains the analyzer’s currant instrument state settings. Instrument state settings consist of all the stimulus and response parameters that sat up the analyzer to make a
speciiic
measurement including markers, limit lines, and memory traces. Instrument state information is saved and recalled for both measurement channels. You can either retrieve this information from the analyzer, or you can put another analyzar’s instrument state information into this file, which will cause the analyzer to immediately enter the new instrument state.
measurement calibration information is the measurement correction data that the analyzer creates when you make a calibration. Measurement calibration information is saved and recalled for both measurement channels. You can either retrieve this information from the analyzer, or you can put another analyzer’s calibration and instrument state information into this file, which will cause the analyzer to immediately enter the new
This file contains the measurement data for both measurement channels. You can either retrieve this information from the analyzer, or you can put data trace information from another analyzer into this file.
thr
use
WI?~ 87075C
currently resides on the analyzer’s non-volatile RAM disk. You can either retrieve this
information from the analyzer, or you can put test sat calibration data into this file.
rest sets 0174 This file contains the test set calibration data that
cal
and instrument state.
1 See ‘Saving and Recalling Analyzer States’ in this chapter for information on how to use this file
5-2
Table
Accessing the Analyzer’s Dynamic Data Disk
5-l.
The Dynamic Data Disk Contents (continued)
File
prop.bad
,*
prog-ren.besl’* prog-run.scpl**
screen.hp13
screen.pcw3
screen-m.hg13
screen-m.pcx3
screen-m.flif3
Penn-all.bft4
pit4
trecel.ern5
File Type
ASCII
ASCII ASCII
ASCII This file contains the current screen image in HP-GL format. It is available for uploading to a
1
binary
ASCII
binary
binary
ASCII
1
ASCII 1
I
ASCII
This file contains the currently loaded that is currantlv in this file or
This file accepts a copy of an This file accepts a copy of a file containing
commands.
file on vour comoutar. This file contains the currant screen image in PCX format. It is available for uploading to a
1
file on your computer. This file contains the current screen image, as wall as the currant softkay menu, in HP-GL
format. It is available for uploading to a file on your computer. This file contains the currant screen imaga, as well as the currant softkay menu, in PCX
format. It is available for uploading to a file on your computer. This file contains the currant screen image, as well as the currant softkay menu, in
format. It is available for uploading to a file on your computer. This file contains a listing of all of the instrument’s operating parameters in ASCII text format. This file contains the information in the current operating parameters screen in ASCII text
format.
1
This file contains the measurement channel 1 measurement date in ASCII spreadsheet format.
Description
IBASIC
program. You can either retrieve the program
COW
a new
uroaram
to this file.
IBASIC
program and immediately runs it.
SCPI
commands and immediately executes the
GIF
1
trace2.pm5 tracel.slp5 trace2.81
1 See “Copying Programs to and from the Analyzer” in this chapter for information on how to use this file
2 kbur analyzer must have 3 See “Copying a Screen Image to a Local 4 See 5 See “Retrieving Measurement
p5
“Copving
Instrument Parameters in ASCII Text Format” in this chapter for information on how to use this
ASCII ASCII
ASCII This file contains the measurement channel 2 measurement data in Touchstone format.
BASIC,
Option
Oata
This file contains the measurement channel 2 maesurament data in ASCII spreadsheet format. This file contains the measurement channel 1 measurement data in Touchstone format.
lC2,
to use this file
Fit<
in this chapter for information on how to use this fila
in ASCII Format” in this chapter for information on how to use this
file
fila
5-3

Saving and Recalling Analyzer States

This section describes how to use the state. sta, cal. sta, and data. sta
files
that reside in the data directory of the analyzer. See
description of each of these You may have a particular instrument state set up on an analyzer and would
like to set up that state on one or more additional analyzers. lb do this you
should:
hles.
‘fable 5-l
for a brief
1. Connect to the analyzer using your computer or workstation. See Chapter 4 for instructions on how to do this.
2. Type cd data at the ftp prompt.
3. Type dir at the ftp prompt to see the listing of files in this directory, as well as a short description of each of them.
4. Type binary at the ftp prompt to specify a binary file transfer.
5. Type get state. sta at the prompt to retrieve the current instrument state file from the analyzer. This copies the file state.sta (which contains the analyzer’s current instrument state information) to your computer.
6. Close the connection and exit ftp by typing bye or quit at the prompt.
7. Now you can put the instrument state into a different analyzer. Connect to the desired analyzer using ftp. For example, type ftp computer or workstation.
8. Type cd data at the ftp prompt.
9. Type put state. sta at the ftp prompt. This copies the contents of the
state.sta
to. The new analyzer will immediately reinitialize itself with the new instrument state.
The above procedure can be performed with the cal . sta and data. sta as well.
file from your computer to the new analyzer you are connected
ftp.
For example, type f tp
analyzer1
analyzer2
on
on your
files
5-4
Accessing the Analyzer’s Dynamic Data Disk
Saving and Recalling Analyzer States
NOTE
It is possible to have saved an instrument state file from the front panel of the analyzer that contains not only the instrument state settings, but the current calibration and measurement data as well. Putting this one file into the state. sta file will cause the analyzer to recall instrument state, cal
state, and measurement data.
CAUTION
When transferring these files between instruments with different model numbers and/or option configurations, it is possible that some instrument state settings will not be compatible. For example, if you try to put an instrument state with a stop frequency of 3 HP
8711C
will limit the frequency to 1.3
GHz
into an HP
GHz
(its high end limit). When you
8711C,
the
transfer this file over ftp, you will not receive any warning or indicator that this has occurred.
Copying Files from UNIX
When copying files from a UNIX environment to the analyzer, files that do not meet the DOS file-naming criteria to comply. For example, if you copy a file from UNIX named as
“ibasic-p.abc”
happened.
(53
characters in filename, with 53 characters in extension) will be truncated
“ibasic-program.abcd”
on the analyzer. There will be no feedback or indication from ftp that this has
it will appear
5-5

Copying Programs to and from the Analyzer

This section describes how to use the prog. bas, prog,run. scp
Iiles
that reside in the data directory of the analyzer. See
prog-run.
bas, and
lkble 5-l for a brief description of each of these files.
NOTE
Your analyzer must have Option
See Also
Refer to Chapter 6 for information on controlling the analyzer from a computer, and how to interact
with an
IBASIC
program running in the analyzer.
lC2 (IBASIC)
to use these program files.
To Copy an IBASIC
If you have Option controller. You can create
lC2 (IBASIC)
Program to or from
the
Analyzer
in your analyzer, your analyzer has a built-in
IBASIC
programs on your computer and copy them to your analyzer. Conversely, you can retrieve a copy of the currently loaded
IBASIC
program from your analyzer to your computer. From there you might
want to copy it into another analyzer, or edit it.
5-6
Accessing the Analyzer’s Dynamic Data Disk
Copying Programs to and from the Analyzer
To copy an
1. Connect to the analyzer using ftp. For example, type f tp
IBASIC
program
file
named
“ib-prog”
to the analyzer:
my8711
on your
computer or workstation. See Chapter 4 for instructions on how to do this.
2. Type cd data at the ftp prompt.
3. Type put ib,prog prog . bas at the prompt to put a copy of your program into the analyzer.
4. Close the connection and exit ftp by typing bye or quit at the prompt.
5.
lb run your
IBASIC
program press [SYSTEM OPTIONS)
XBMXC!
RW
on the
analyzer.
NOTE
You can eliminate this last step, and have your program run automatically ty using the dynamic data disk file named prog,run. bas. See “To Copy and Run a Program” later in this section.
!Ib
copy the currently loaded
IBASIC
program from your analyzer to your
computer:
1. Connect to the analyzer using ftp. For example, type
my87
11 on your
computer or workstation. See Chapter 4 for instructions on how to do this.
2. Type cd data at the ftp prompt.
3. Type dir at the ftp prompt to see the listing of files in this directory, as well as a short description of each of them.
4. Type get prog . bas at the prompt to retrieve the current
IBASIC
program file from the analyzer. This copies the program Ele prog.bas to your computer. You may want to give the
file
a unique name on your local
computer by typing something like this: get prog . bas newf ile.
5. Close the connection and exit ftp by typing bye or quit at the prompt.
5-7
Accessing the Analyzer’s Dynamic Data Disk
Copying Programs to and from the Analyzer
To Copy and
You can create an
Run a Program
IBASIC
program or a file with a list of SCPI commands
with One
Command
on your computer, and then copy and automatically run it by using the
prog-run.
lb copy and immediately run an
1. Connect to the analyzer using ftp. For example, type
bas and prog,run. scp files.
IBASIC
program called
ib-prog:
my871 1
on your
computer or workstation. See Chapter 4 for instructions on how to do this.
2. Type cd data at the ftp prompt.
3. Type put ib,prog
prog,run.bas
at the prompt. This copies your
program to the analyzer and immediately runs it.
4. You can also copy a
lile
with a list of SCPI commands to the prog,run. scp data file and the commands will be executed immediately. See your analyzer’s Programmer’s Guide for a list of SCPI commands.
The
lile
you copy to “prog-run.scp” should simply be a list of SCPI
commands. For example, a file containing these lines:
SENSl:FUNC ‘XFR:POW:RAT
CALCl:MARK:FUNC
MAX
2,O’;DET
NBAN;*WAI
DISP:WINDl:TRAC:Y:AUTO ONCE
sets the analyzer to measure transmission, places a marker on the
maximum point, and then autoscales the measurement trace.
NOTE
Avoid the use of queries, as there is no way to read back the analyzer’s response.
I
5-8
,

Copying a Screen Image to a Local File

This section describes how to copy screen images from the analyzer to a
fIe
on your computer. To copy a screen image to your computer:
1. Connect to the analyzer using ftp. For example, type
my871 1
on your
computer or workstation. See Chapter 4 for instructions on how to do this.
2. Type cd data at the ftp prompt.
3. Type dir at the ftp prompt to see the listing of files in this directory, as well as a short description of each of them.
4. Decide which screen image file you want to retrieve and then use the get command to transfer it to your computer. For example, type get screen .pcx image .pcx to retrieve the current screen image in PCX format, and place it into a file named image
NOTE
The look of the image you retrieve will depend on the selections in the menu on your analyzer, as well as the file you choose to retrieve from the data directory For example, Figure
5-I
was retrieved with the
includes the measurement graph and the marker table Figure 5-2 was retrieved with the analyzer’s hardcopy mode defined as Graph
“screen.hgl”
OrrXy
file using the analyzer’s default hardcopy mode, which
using the
“screen-m.hgV
.pcx
on your computer.
II&~zH Wtu?dc~~py
file.
5-9
Accessing the Analyzer’s Dynamic Data Disk
Copying a Screen Image to a local File
Figure
6-1. scrnn.hgl
Figure 6-2.
scram-m.hgl
5-10

Copying Instrument Parameters in ASCII Text Format

This section describes how to use the parm,all . txt and parm,screen. txt
fles that reside in the data directory of the analyzer. See
description of each of these files. Instrument parameters can be viewed on the analyzer by pressing
CSYSTEM
0PrIoNsJ Operating
Parameters . Several screens of information are available (the exact number depends upon your model number and option configuration). These screens describe all the current settings and configurations of the analyzer. You can copy all of these screens using
“par-m-all.txt”
G.le
on your computer.
or just the current screen with
“parm-screen.txt”
To copy instrument operating parameters:
lhble 5-l
to an ASCII
for a brief
1. Connect to the analyzer using ftp. For example, type
my87
11 on your
computer or workstation. See Chapter 4 for instructions on how to do this.
2. Type cd data at the ftp prompt.
3. Type get parm,all . txt or get parm,screen. txt at the prompt
to copy the desired parameters to your local computer. You can give the file a unique name on your local computer by typing: get
parrn-all
. txt newf ile.
4. Close the connection and exit ftp by typing bye or quit at the prompt.
Copying the
If you do not rename the above), it will be truncated to
There will be no feedback or indication from ftp that this has happened.
parm-soreen.txt
“parm-screen.txt”
file to B DOS environment
file when copying it to a DOS environment (as in step 3
“parm-scr.txt”
in order to comply with
DOS
file-naming conventions.
5-11

Retrieving Measurement Data in ASCII Format

This section describes how to use the
trace1
analyzer. See Table 5-l for a brief description of each of these Measurement data can be saved in ASCII formats that are compatible with
many personal computer software packages. The files with the extension in the data directory contain measurement data in a two-column format that is directly importable to Lotus@ spreadsheet programs. The directory contain measurement data in a format that is importable into CAE programs such as HP
lb retrieve measurement data:
1. Connect to the analyzer using ftp. For example, type
2. Type cd data at the ftp prompt.
3. Type get
4. Close the connection and exit ftp by typing bye or quit at the prompt.
. slp and
computer or workstation. See Chapter 4 for instructions on how to do this.
1 data in spreadsheet format. See other trace data computer by typing: get
trace2.
EEsof’s
trace1 .prn
hles.
slp
files
hles
Microwave Design System (MDS) and Series IV.
at the prompt to copy the measurement channel
You can give the
trace1 .prn
trace1 .prn, trace2 .pm,
that reside in the data directory of the
hles.
“.prn”
with the
Table
l-2-3@,
“.slp”
5-l for descriptions of the
hle
a unique name on your local
newf ile.
as well as other
extension in the data
my87
11 on your
5-12
Importing Graphics or Data into
PC Applications
Some of the newer PC word processor and spreadsheet programs allow you to import graphics and data from the Web. The following examples illustrate how to import a screen image from your analyzer into Microsoft@ Word 97, and how to import trace data from your analyzer into Microsoft@ Excel 97.
Import a
Screen Snapshot
into a Word
Processor
Program
This example steps you through importing a picture of the analyzer’s current screen into a word processor. (These steps were developed using Microsoft@
Word 97. Other word processing programs may or may not have the same
capability, and will probably have different steps.)
1. Place the cursor at the point in your imported graphic.
2. Click on Insert, Picture, From File. When the dialog box appears, type
http://my87ll/data/screen.pcxintheFile
3. Click on the Insert button in the dialog box.
file
where you want to place the
namebox.
5-13
Accessing
Importing Graphics or Data into PC Applications
the-
Analyzer’s Dynamic
Oata
Disk
Import
This example steps you through importing the analyzer’s current trace data into a spreadsheet program. (These steps were developed using Microsoft@ Excel 97. Other spreadsheet programs may or may not have the same
capability, and will probably have different steps.)
1. Click on File, Open. When the dialog box appears, type http :
2. Click on the Open button in the dialog box.
3. A “Text Import Wizard” will guide you through customizing how you want the data to appear in the spreadsheet. Figure 5-3 shows trace data (and a screen snapshot) imported into a spreadsheet program.
Trace Data
//my87ll/data/tracel.
into
a
Spreadsheet
sip
in the File name box.
Program
5-14
http.//ne!&71 l/data/trace1 .prn
Accessing the Analyzer’s Dynamic Data Disk
php66c
Figure 5-3. Trace Data and Screen Snapshot Imported into a Spreadsheet
5-15
6

Controlling the Analyzer via the LAN

Controlling the Analyzer via the LAN

To control your analyzer via LAN, you must use socket programming to send SCPI commands. Your analyzer is listening for SCPI commands at port 5025.
You can also control your analyzer by copying programs to the data directory via ftp (see Chapter 5, and see this chapter).
NOTE
“IBASIC
Communication Across the LAN” in
The example programs described in this chapter are on the “Example Programs with your analyzer.
DisK
that was shipped
6-2

The Command Parser Port

You can telnet to the analyzer’s command parser port and send SCPI programming interactively, or you can write a program that opens a socket and sends commands to it.
The analyzer listens for SCPI commands on port 23 and port 5025. Port 23 is intended for interactive use, using telnet. When you connect to port 23, a welcome message is displayed. Port 5025 is intended for program use. When you connect to port 5025, no welcome message is displayed.
Entering Commands
Directly using Telnet
Before connecting to your analyzer using telnet, you must have connected and configured your analyzer as described in Chapter 1.
Using telnet to send commands to your analyzer works in a similar way to communicating over HP-IB; you establish a connection with the analyzer, and then send and/or receive information via SCPI commands.
NOTE
In the current version of firmwaren there is no way to mirror or
SROs.
To do so requires XL/LAN, which has not yet been implemented.
As a workaround, you can use the HP can control your analyzer via
HP-B
E2050A
LAN to
HP-16
operations such as “device clear”
HP-M
gateway, which supports
SICULAN
and
6-3
Controlling the Analyzer via the LAN
The Command Parser Port
The syntax of the telnet command is:
Example
telnet
For example, type telnet
hostname
my8711.
A brief message should appear confirming the connection, and telling you the escape sequence for breaking the connection.
Trying. . . Connected to my8711.sr.hp.com. Escape character is Welcome to the HP
j-1’.
871xC
SCPI Parser
When you connect to the analyzer, there is no prompt. You can now begin typing analyzer 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
lb connect to the analyzer named
I),
telnet
and type quit. See the detailed example that follows.
“my8711”,
enter:
my8711
The computer responds with:
Trying. . . Connected to my8711.sr.hp.com Escape character is Welcome to the HP
‘-1’
.
871xC
SCPI Parser
The connection was successful. Because the analyzer does not provide a
prompt, start entering progr
amming
commands. Typical commands might be:
SENSl:FUNC
CALCl:MARK:FUNC
‘XFR:POW:RAT 2,O’:DET
MAX
NBAN;*OPC?
CALCl:MARK:POIN?
The small program above sets the analyzer to measure transmission, places
a marker on the maximum point, and then queries the analyzer for the amplitude of the marker.
6-4
Controlling the Analyzer via the LAN
The Command Parser Port
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
CALCl
: MARK : POIN? 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
“I”
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.
$
NOTE
If your telnet connection is in a mode called “line-by-line,” there is no local echo. This means you will not be able to see the characters you are typing on your computer’s display until after you press the Enter key
To remedy this, you need to change your telnet connection to ‘character-by-character” mode. This can be accomplished in most systems by escaping out of telnet to the typing mode char. If this does not work, consult your telnet program’s documentation for how to change to “character-by-character” mode.
I
telnet>
prompt, and then
I
6-5
Controlling the Analyzer via the LAN
The Command Parser Port
Programming
The following example program demonstrates simple socket programming. It is written in C, and compiles in the HP-UX UNIX environment. It should be portable to other UNIX environments with only minor changes.
In UNIX, LAN communication via sockets is very similar to reading or writing a
iile.
The only difference is the opensocket (1 routine, which uses a few network library routines to create the connection is created, the standard network communication.
In Windows, the routines send( > and fwrite ( > may not work on sockets.
The program reads the analyzer’s hostname from the command line, followed
by the SCPI command. It then opens a socket to the analyzer using port
5025, and sends the command. If the command appears to be a query, the
program queries the analyzer for a response, and prints the response.
This example program can also be used as a utility to talk to your analyzer
from the command prompt on your UNIX workstation or from within a script.
the Analyzer within a C
TCP/‘IP
fread0
recv ( >
network connection. Once this
and
fwrite0
must be used, since fread ( > and
Program
routines are used for
Windows95
PC, or
6-6
Controlling the Analyzer via the LAN
The Command Parser Port
/*
**************************************************************************** *
$Header:
*
$Revision:
*
$Date: 97/02/13 13:03:10
* * *
$Contributor:
* *
$Description:
* * * * * * *
$Written by:
* *
871xC
* *
query the center frequency:
* * *
Select Lin Mag format:
* * *
Take a sweep, wait for end of sweep,
* * *
Query X and Y values of marker 1 and marker 2 (assumes they are on>:
* * *
Check for errors (gets one error>:
* *
*
Send a list of commands from a file, and number them:
*
*
****************************************************************************
*
lanio.c,v 1.6
97/02/13 13:03:10
1.6 $ $
LSID, MID $ Functions to talk to an HP 8711C/l2C/l3C/l4C/3OA
analyzer via TCP/IP. A TCP/IP connection to port 5025 is established and
the resultant file descriptor is used to instrument using regular socket I/O mechanisms. $
Glenn Engel.
Examples:
lanio 15.4.43.5
'sens:freq:cent?'
lanio my8711.sr.hp.com
lanio
lanio
lanio
my8711
my8711 'calc:markl:x?;y?;
my8711 'syst:err?'
':abort;INIT:CONT OFF;:INITl;*wai; :calc:mark:max; x?'
cat scpi,cmds I lanio -n
roger Exp $
Modified for
'CALC:FORM
MLIN'
move mkr to peak and query x pos:
:calc:mark2:x?;y?'
my8711
Uses command-line arguments.
WIN32
by Roger Petersen
"talk"
to the
$
6-7
Controlling the Analyzer via the LAN
The Command Parser Port
* This program compiles and runs under * *
*
-
HP-UX 9.05 (UNIX), using HP cc or
+ cc
-Aa
+ gee -Wall -0 -0 lanio
-0 -0 lanio
1anio.c
1anio.c
* * * * * *
-
Windows 95, using Microsoft Visual C++ 4.0 Standard Edition
-
Windows NT 3.51, using Microsoft Visual C++ 4.0
+ Be sure to add + Compile both
WSOCK32.LIB
1anio.c
and getopt.c
+ Consider re-naming the files to lanio.cpp and getopt.cpp
* * Considerations:
* * * *
-
On UNIX systems,
This makes programming very convenient, since routines like
getc(>, fgets(), fscanf()
routines typically use the lower level
file I/O can be used on network sockets.
and
* * * *
-
In the Windows environment,
and
close0
sockets.
cannot be assumed to work correctly when applied to
Instead, the functions
file operations such as
*/
gee:
to your list of libraries!
fprintfo
send0
can be used. These
read0
and
and
recvo
write0
MUST be used.
calls.
read0, writeo,
/*
Support both
Win32 #ifdef -WIN32 t
define
WINSOCK
#endif
tifndef # ifndef
#
define
WINSOCK
,HPUX,SOURCE
,HPUX,SOURCE # endif tendif
#include #include #include
<stdio.h> Cstring.h> <stdlib.h>
#include <errno.h>
#ifdef WINSOCK
#include
Cwindows.h>
6-8
and HP-UX UNIX environment
/*
Visual C++ 4.0 will define this
/*
for fprintf and NULL
/*
for memcpy and memset
/*
for
/*
for strerror
malloco, at010 */
*/
*/
*/ */
*/
t
ifndef
#
include <winsock.h>
,WINSOCKAPI,
t endif
//
BSD-style socket functions
Controlling the Analyzer via the LAN
The Command Parser Port
#else /* UNIX with BSD sockets
t
include
#
include
#
include <netdb.h>
#
define SOCKET-ERROR (-1)
#
define INVALID-SOCKET
Csys/socket.h> <netinet/in.h>
/* /* /*
(-1)
typedef int SOCKET;
#endif /* WINSOCK */ #ifdef WINSOCK
/*
Declared in getopt.c.
See example programs disk. extern char *optarg; extern int optind;
extern int getopt(int
argc,
char * const #else
#
include
<unistd.h>
#endif
#define COMMAND-ERROR (1) #define NO,CMD-ERROR
(0)
*/
for connect and socket*/ for sockaddr,in for gethostbyname
argv[],
/*
for
getopt(3C) */
*/ */
const char* optstring);
*/
#define
SCPI-PORT
5025
#define INPUT,BUF,SIZE (64*1024)
/**************************************************************************
*
Display usage
**************************************************************************/
static void
usage(char *basename)
(
1s
fprintf(stderr,"Usage: fprintf(stderr,"
[-nqu]
%s
[-nqu]
<hostname> [<command>]\n", <hostname> < stdin\n",
basename);
basename);
6-9
Controlling the Analyzer via the LAN
The Command Parser Port
fprintf(stderr," fprintf(stderr," fprintf(stderr,"
-n, number output
-q, quiet; do NOT echo
-8,
show messages in error queue when done\n");
3
tifdef WINSOCK
int
init,winsock(void)
(
WORD
WVersionRequested;
WSADATA
wsaData;
int err;
WVersionRequested = MAKEWORD(1, 1); WVersionRequested = MAKEWORD(2, 0);
err = WSAStartup(wVersionRequested, if (err != 0)
/*
Tell the user that we couldn't find a
/*
winsock.dll.
fprintfcstderr,
(
*I
"Cannot initialize
return -1;
3
return 0;
3
lines\n");
lines\n");
BtwsaData);
useable */
Winsock l.l.\n");
int
close,winsock(void)
(
WSACleanupo;
return 0;
J
#endif /* WINSOCK */
/***************************************************************************
*
>
$Function: openSocket$
*
* $Description:
open a TCP/IP socket connection to the instrument $
* *
$Parameters:
$
6-10
Controlling the Analyzer via the LAN
The Command Parser Port
*
(const
* *
(int) portNumber
*
char *>
hostname
. . . . Network name of instrument.
This can be in dotted decimal notation.
. . . . . . . The TCP/IP port to talk to.
Use 5025 for the SCPI port.
*
* $Return:
(int)
. . . . . . . .
A file descriptor similar to
open(l).$
*
* $Errors:
returns -1 if anything goes wrong $
*
***************************************************************************/
SOCKET openSocket(const char
*hostname,
int
portNumber)
(
struct hostent
*hostPtr;
struct sockaddr-in peeraddr-in; SOCKET s;
0,
memset(&peeraddr-in,
sizeof(struct
sockaddr,in));
/************************************************/
/*
map the desired host name to internal form.
/***********************************************/
hostPtr
if
i
=
gethostbyname(hostname);
(hostPtr ==
fprintfcstderr,
NULL)
"unable to resolve
hostname '%s'\n",
return INVALID-SOCKET;
/*******************/
/*
create a socket
*/
/*******************/
s =
socket(AF,INET,
if (s
== INVALID-SOCKET)
SOCK-STREAM,
0);
(
fprintfcstderr,
hostname,
"unable to create socket to
strerror(errno));
return INVALID-SOCKET;
3 memcpy(&peeraddr,in.sin,addr.s,addr,
hostPtr->h,addr, hostPtr->h,length);
*/
hostname);
'x8': %s\n",
6-11
Controlling the Analyzer via the LAN
The Command Parser Port
peeraddr,in.sin,family peeraddr-in.sin,port
if
(connectcs,
(const
sizeof(struct
fprintfcstderr,
hostname,
=
AF,INET;
= htons((unsigned
short)portNumber);
struct sockaddr*)tpeeraddr,in,
sockaddr,in)) == SOCKET-ERROR)
"unable to create socket to
strerror(errno));
'l/is': %s\n",
return INVALID-SOCKET;
3
return s;
3
/***************************************************************************
*
>
$Function: commandInstrument$
*
* $Description:
send a SCPI command to the instrument.$
* *
$Parameters:
* * *
(SOCKET) . . . . . . . . .
(const char *command) . . SCPI command string.
$Return:
$
(char *> . . . . . .
file pointer associated with TCP/IP socket.
a pointer to the result string.
*
*
$Errors:
returns 0 if send fails $ *
***************************************************************************/
int
commandInstrument(SOCKET
sock,
const char *command)
(
int count;
/* fprintfcstderr,
if (strchr(command,
fprintfcstderr,
"Warning: missing newline on command
command);
3
6-12
"Sending
'\n'> ==
NULL)
\"Xs\".\n",
(
command);
1s.
*/
Might hang.\n",
=
count
send(sock,
if (count
==
command, strlen(command),
SOCKET-ERROR)
return COMMAND-ERROR;
3
Controlling the Analyzer via the LAN
The Command Parser Pert
0);
c
return
NO-CMD-ERROR;
3
/***************************************************************************
*
>
$Function: sendBlock$
*
* $Debcription:
send a SCPI command to the instrument.$
* *
$Parameters:
* * *
(SOCKET) . . . . . . .
(int)
(const char *command) . Pointer to block
* $Return:
$
file descriptor associated with TCP/IP socket.
. . . . . . . . . Block length
(char *> . . . . .
a pointer to the result string.
*
* $Errors:
returns 0 if send fails $ *
***************************************************************************/
int
sendBlock(SOCKET
r
i
sock, const char *block, int block-length-in-bytes)
int count;
=
count
send(sock,
if (count
fprintfcstderr,
== SOCKET-ERROR)
block, block-length-in-bytes,
(
"ERROR:
sendBlock(): send0 failed.\n");
0);
return COMMAND-ERROR;
3
return NO-CMD,ERROR;
3
/**************************************************************************
* recv,line(): **************************************************************************/
char * recv,line(SOCKET sock, char * result, int
similar to
fgetso,
but uses
recv0
maxlength)
6-13
c
#ifdef WINSOCK
int cur-length = 0; int count; char * ptr = result; int err = 1;
Controlling the Analyzer via the LAN
The Command Parser Port
while (cur-length C maxlength)
/*
Get a byte into ptr
count =
/*
If no chars to read, stop.
if (count < 1)
recv(sock,
break;
ptr, 1,
C
*/
3
cur-length += count;
/*
If we hit a
if
(*ptr
==
ptr++;
err = 0;
break;
3
ptr++;
newline,
'\n'> (
stop.
3
*ptr = if (err)
3
else
'\O';
(
return NULL;
C
return result;
(
0); */
*/
#else
/***********************************************************************
*
Simpler UNIX version, using file I/O.
*
This demonstrates how to use file I/O on sockets, in UNIX.
***********************************************************************/
FILE *
instFile
instFile;
=
fdopen(sock, "r+");
6-14
recv(>
version works too.
if
(instFile ==
r
Controlling the Analyzer via the LAN
The Command Parser Port
NULL)
fprintfcstderr,
"Unable
to create FILE * structure :
%S\n",
strerror(errn0));
exit(2);
J
return
fgetscresult,
maxlength,
instFile);
tendif
3
/***************************************************************************
*
>
$Function:
*
* $Description:
* *
*
$Parameters:
* * *
(SOCKET) . . . . . . . file descriptor associated with TCP/IP socket.
(char *result) . . . . . where to put the result.
(size-t) maxLength
*
* $Return:
*
* $Errors:
*
***************************************************************************/
long
queryResponse(SOCKET
(
long ch; char long int count;
queryResponse
$
read response from analyzer
(assumes query command was already sent)
$
. . .
maximum size of result array in bytes.
(long) . . . . . . . The number of bytes in result buffer.
returns 0 if anything goes wrong. $
sock, char *result,
size-t maxlength)
tmp_buf[8]; resultBytes =
0;
/*********************************************************
*
Read response from analyzer
********************************************************/
1,
count ch =
=
recv(sock,
tmp-buf
COI;
tmp-buf,
0); /*
read 1 char
*/
6-15
Controlling the Analyzer via the LAN
The Command Parser Port
if ((count < 1) I I (ch ==
EOF) 11
<
/*
*result =
'\O';
null terminate result for ascii
return 0;
3
/*
use a do-while so we can break out
do
(
if (ch ==
c
/*
'#'>
binary data encountered - figure out what it is long numDigits; long
numBytes
/*
char
count
ch =
= recv(sock,
tmp-buf[Ol;
if ((count C 1) I if (ch <
numDigits =
= 0;
length[lO]; */
tmp-buf,
I
(ch ==
'0'
II ch >
ch -
'0';
'9')
break; /* unexpected char
if (numDigits)
c
/*
read
count
resultCcount1 = 0;
numBigits
=
recv(iock,
bytes into result string.
result,
/*
numBytes= atol(result);
3
(ch == '\n'>>
*/
1,
0); /*
EOF))
break; /* End of file
read 1 char
(int)numDigitsi
null terminate
*/
*/
*/
*/
*/
*/
*/
0); -
if
(numBytes)
(
resultBytes =
/*
Loop until we get all the bytes we requested.
/*
Each call seems to return up to 1457 bytes (HP-UX 9.05)
do
(
6-16
0;
int rcount; rcount
= recv(sock,
resultBytes
result, (int)numBytes,
+= rcount;
*/
*/
0);
3
else
r
Controlling the Analyzer via the LAN
+=
result
1
while (
/************************************************************
resultBytes < numBytes >;
* For LAN dumps,
rcount;
/*
Advance pointer
there is always an extra trailing newline * Since there is no EOI line. For ASCII dumps this is
*
great but for binary dumps, it is not needed.
*******************************************************~***/
if
(resultBytes == numBytes)
c
char junk; count =recv(sock, &junk, 1,
0);
3 3 else
<
/*
indefinite block . . .
dump til we can an extra line feed do
I
if
(recv,line(sock,
if
(strlen(result)==l
resultBytes
result +=
)
while (I);
+=
strlen(result);
result, maxlength) == NULL) break;
&& *result ==
'\n')
strlen(result);
3
The Command Parser Port
*/
*/
break;
3
3
while
return
/*
ASCII response (not a binary block)
*result =
if
(recv,line(sock,
/*
REMOVE trailing
resultBytes
if
(result[resultBytes-11
result[resultBytesl
(char)ch;
=
strlen(result);
result+l, maxLength-
newline,
=
'\O';
if present. And terminate string.
==
'\n') resultBytes -=
(0);
resultBytes;
*/
== NULL) return 0;
*/
1;
6-17
Controlling the Analyzer via the LAN
The Command Parser Port
/***************************************************************************
*
>
$Function:
queryInstrument
$
*
* $Description:
send a SCPI command to the instrument, return a
response.$
* *
$Parameters:
* * * *
(SOCKET) . . . . . . . file descriptor associated with TCP/IP socket.
(const char *command) . . SCPI command string.
(char *result) . . . . . . where to put the result.
(size-t)
$
maxLength
. . . .
maximum size of result array in bytes.
*
* $Return:
(long) . . . . . . . The number of bytes in result buffer.
*
*
$Errors:
returns 0 if anything goes wrong. $ *
***************************************************************************/
long
queryInstrument(SOCKET
const char *command, char *result,
sock,
size-t maxlength)
c
int command-err;
/*********************************************************
*
Send command to analyzer
*********************************************************/
command-err =
commandInstrument(sock, command);
if (command-err) return COMMAND-ERROR;
return queryResponse(sock, result, maxlength);
3
/*************************************************************************
*
>
$Function: showErrors$
*
* $Description:
query the SCPI error queue, until empty.
6-18
Print results. $
Controlling the Analyzer via the LAN
The Command Parser Port
*
* $Return:
(void) *
*************************************************************************/
void
showErrors(SOCKET
sock)
(
const
char * command =
char
result-strC2561;
do
<
queryInstrument(sock,
/******************************************************************
*
Typical result-str: * *
*
-221,"Settings
+0
"No
error"
Don't bother decoding.
"SYST:ERR?\n";
command, result,str,
sizeof(result,str)-1);
conflict; Frequency span reduced."
******************************************************************/
if
(strncmp(result-str,
/*
Matched
+O,"No
H+O,U,
error"
3) == 0)
*/
(
break;
puts(result-str);
3
while
/***************************************************************************
*
>
$Function:
(1);
isQuery$
*
* $Description:
Test current SCPI command to see if it a query. $
* *
$Return:
(unsigned char) . . .
non-zero if command is a query.
0 if not. *
***************************************************************************/
unsigned char
isquery(
char* cmd
)
(
unsigned char q = 0 ; char *query
;
6-19
Controlling the Analyzer via the LAN
The Command Parser Port
/*********************************************************/
/*
if the command has a
/*
otherwise, simply send the command.
/*
Actually, we must a little more specific so that
/*
marker value queries are treated as commands.
/*
Example:
/*********************************************************/
if ( (query
(
/*
Make sure we don't have a marker value query, or
*
any command with a
*
This kind of command is not a query from our point of view.
*
The analyzer does the query internally, and uses the result.
*I
query++ ; while (*query)
<
smis:mq:cm
=
strchr(cmd,'?'))
/*
if (*query == '
query++
else break
;
;
'?'
in it, use queryInstrument.
(CALCI:MARRI:X?)
!= NULL)
'?'
followed by a
bump past
'> /*
attempt to ignore white spc
'?' */
'1'
character.
3
*/ */
*/ */ */
*/
if ( *query !=
(
q=l;
'1' >
3
3
return q
;
3
/***************************************************************************
*
>
$Function:
*
* $Description:
*
* $Return:
*
***************************************************************************/
main$
Read command line arguments, and talk to analyzer. Send query results to stdout. $
(int)
6-20
. . .
non-zero if an error occurs
int
main(int argc,
c
char
Controlling the Analyzer via the LAN
The Command Parser Port
*argv[])
SOCKET char char
instsock;
*charBuf
= (char *)
*basename;
malloc(INPUT-BUF,SIZE);
int chr; char
commandCl0241;
char *destination; unsigned char quiet = 0; unsigned char show-errs = 0; int number = 0;
basename =
strrchr(argv[Ol,
if (basename != NULL)
basename++
;
else
basename =
while ( ( chr =
argv
CO];
getopt(argc,argv,"qune"))
switch (chr)
<
case case case case case
'q': 'n': '8': 'u': '?':
quiet
= 1; break;
number = 1; break
show-errs
usagecbasename); exit(l)
3
'/');
= I; break
!= EOF )
;
;
;
/*
now look for
if (optind <
argc)
(
destination
strcpy(command, 'I");
if (optind <
(
while (optind <
/* strcat(command,
if (optind <
hostname
=
and optional <command>
argv[optind++] ;
*/
argc)
argc) (
<hostname> <command> provided; only one command string
argvCoptind++l);
argc) <
strcat(comma.nd, ' ");
*/
6-21
Controlling the Analyzer via the LAN
The Command Parser Port
3
else
strcat(command,
3
3
3
else
/*
Only
strcpy(command, "'I>;
<hostname>
(
"\n");
provided; input on <stdin>
*/
if (optind >
<
usage(basename);
exit(l);
argc)
3
3
3
.else
(
/*
no hostname!
usage(basename);
exit(l);
/**********************************************/
/*
open a socket connection to the instrument
/**********************************************/
#ifdef WINSOCK
if
(init,winsock()
exit(l);
*/
!= 0)
(
3
#endif /* WINSOCK */
instSock =
if
(instsock
fprintf(stderr, return I;
openSocket(destination, SCPI,PORT);
==
INVALID-SOCKET)
"Unable to open
(
3
/*
fprintf(stderr,
"Socket
opened.\n"); */
*/
socket.\n");
if
(strlen(cmmand) >
6-22
0)
/********************************************************/
/*
if the command has a
/*
otherwise, simply send the command.
I?'
in it, use queryInstrument.
/********************************************************/
if (
isQuery(command) >
<
long
bufBytes;
=
bufBytes
if
(!quiet)
r
t
queryInstrument(instSock,
fwrite(charBuf, bufBytes, fwrite("\n", fflush(stdout);
.
1
I, 1,
charBuf,
1,
stdout) ;
command,
INPUT,BUF,SIZE);
stdout);
3
else
(
commandInstrument(instSock, command);
3
3
else
(
/*
read a line from <stdin>
while (
gets(charBuf) !=
NULL
(
if (
!strlen(charBuf) )
continue
;
*/
>
Controlling the Analyzer via the LAN
The Command Parser Port
*/ */
if (
*charBuf
continue
==
;
strcat(charBuf, if
(!quiet)
<
if (number)
(
char
num[lO] ;
sprintf(num,"%d:
'#' I I *charBuf == '!' )
"\n");
",number);
6-23
Controlling the Analyzer via the LAN
The Command Parser Port
fwrite(num, strlen(num),
1, stdout);
3
fwrite(charBuf, strlen(charBuf), fflush(stdout);
1, stdout)
;
3
if ( isQuery(charBuf)
(
long
bufBytes;
/*
Put the query response into the same buffer as the
*
command string appended after the null terminator.
*/
=
bufBytes
if
(!quiet)
<
fwrite(" fwrite(charBuf fwrite("\n", fflush(stdout);
queryInstrument(instSock,
",
>
charBuf
INPUT-BUF,SIZE
2, 1, stdout)
+
strlen(charBuf)+l, bufBytes,
I, 1, stdout)
+
; ;
charBuf,
strlen(charBuf)
-strlen(charBuf) >;
+ 1,
1, stdout);
3
3
else
c
commandInstrument(instSock, charBuf);
J
if (number) number++;
3
3
if (show-errs) c
showErrors(instSock);
3
tifdef
#else
WINSOCK closesocket(instSock); close,winsocko;
close(instSock);
6-24
tendif /* WINSOCK */
return 0;
3
/*
End of
1anio.c */
Controlling the Analyzer via the LAN
The Command Parser Port
6-25

IBASIC Communication Across the LAN

You may need a way for an
BASIC
program running on the analyzer to signal
a remote computer that it has completed some operation.
IBASIC
currently cannot communicate directly across LAN using the ASSIGN
and OUTPUT or ENTER commands. However,
BASIC
can use the following
SCPI command to send a message to a remote computer via LAN:
DIAGnostic:COMMunicate:LAN:SEND <IP,ADDR>,<PORT,NUM>,<STRING>,
<TIMEOUT>
This command opens a socket to the remote computer, and sends the specified string. The
remote computer. The
use. The <STRING> is the message to be sent. The
speciiies
the timeout interval (0 to 75 seconds).
<IP,ADDR>
<PORT-NW0
argument specifies the IP address of the
argument specifies the port number to
<TIMEOUT>
argument
For example:
DIAGnostic:COMMunicate:LAN:SEND ‘15.4.40.49’,8001,‘Ready!‘,30
If the remote computer is not listening for a LAN connection at the specified port, this command will block, and wait for the remote computer to accept the connection. In this example, it will time out after 30 seconds. If no timeout interval is specified, it will time out after the default timeout of about
75 seconds (the standard
The following using
IBASIC.
BASIC
TCP/IP
timeout period).
example program demonstrates LAN communication
100
! ! This program demonstrates how
110 120
!
with a remote computer via LAN. This is done using a
!
130 140
150
SCPI command that sends a LAN message to the computer: ! ! 8003 is an arbitrary unused port number.
160 170
AIM Cmd$C2561
180
DIM
190
DIM Snum$[l6]
6-26
DIAG:COMM:LAN:SEND
Msg$[l28]
IBASIC
'15.4.40.49',8003,'Ready!'
can communicate
Controlling the Analyzer via the LAN
IBASIC Communication Across the LAN
200
210 220 230 240
250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600
!
! Initialize the instrument
! ASSIGN OUTPUT OUTPUT OUTPUT OUTPUT OUTPUT
@Na
ONa;"SYST:PRES;*WAI"
ONa;"SENSI:STAT ONa;"POWI:MODE ONa;"DISP:ANN:FREQl:MODE CSPAN"
QNa;"SENSI:FREQ:CENT 177e6;SPAN
! Put sweep in hold
OUTPUT
QNa;"ABOR;:INITI:CONT OFF;*WAI"
! Sync up with analyzer OUTPUT QNa;"*OPC?" ENTER
QNa;Opc
! ! ! Get serial number
OUTPUT ENTER
QNa;"DIAG:SNUM?"
(ONa;Snum$
Snum$=Snum$C2,111
! ! Begin infinite loop:
-
Take sweep
!
-
Compute bandwidth
!
-
Send signal to computer
! !
Loop: !
DISP "Taking sweep..."
Count=Count+l
! Take sweep, and wait for it to finish.
OUTPUT ENTER
ONa;"INITI;*OPC?"
QNa;Opc
! Autoscale trace to give feedback.
OUTPUT
QNa;~'DISP:WINDl:TRAC:Y:AUTO
! Perform a search for the -3 dB bandwidth of the filter ! This function uses several markers to find 4 key values.
OUTPUT
QNa;"CALCI:MARK:BWID -3;FUNC:RES?"
! Read the four values: ! frequency,
ENTER
ONa;Bwid,Center,f,Q,Loss
!
TO 800
ON;
*WAI"
FIXed"
! remove quotes
the bandwidth, center
Q
and the insertion loss.
! Freq sweep
200e6;*WAI"
ONCE"
6-27
610
620 630 640 650 660 670 680 690 700 710 720
. 730
740 750 760 770 780 790 800 810 820 830 840
Controlling the Analyzer via the LAN
IBASIC Communication Across the LAN
! Signal computer that we are done, ! so that it can come grab the
meas
results ! ! Create a string that looks like this: !
Ready!, "US36100007",6.159E+7,1.7248E+8,-1.6088<LF>
! Could send any string.
Could also save
meas
results to ! a file, and send filename, and computer could FTP the file. !
Msg$="'Ready! ,"tSnum$&"," Msg$=Msg$tval$(Bwid)&","bval$(Center,f)&","~val$(Loss) Msg$=Msg$tchr$(lO)&""'
! ! Send the message to the computer, via LAN !
Cmd$="DIAG:COMM:LAN:SEND
OUTPUT
@Na;Cmd$
DISP "Done with loop
'15.4.40.49',8003,"&Msg$
";Count;"
Continuing..." ! ! Pause, ! Computer will send
and wait for computer to grab data.
'PROG:STAT CONT'
when ready
!
PAUSE
GOT0
Loop
END
6-28
Controlling Multiple Analyzers using a Per1 Script
The following analyzers from your workstation.
The script downloads an program makes a measurement, and then signals the computer that it needs service. (See the previous section, to see how the
The computer receives this data, and then
#
!
/usr/bin/perl #
#
Per1
script to listen on a port, and print received messages.
#
# This script is based on the “server” example in the
# book “Programming #
#
require
require
‘sys/socket.ph’;
‘ctime.pl’;
Per1
script demonstrates how you can control a network of
IBASIC
tells
the
perl”
IBASIC
program accomplishes this.)
IBASIC
by
program to a group of analyzers. The BASIC
“IBASIC
signaI,
then queries the analyzer for measurement
program to continue.
O’Reilley &
# Not needed on HP-UX
#
Allow use of
Communication Across the LAN”
Associates, Inc.
ctimeo
to get date
# Get the port number from the command line (first
#
If no argument,
# Users can use ports above 1024 or so.
=
($port)
sport
$AF-INET $SOCK,STREAM $PF-INET
OARGV;
= 8003 unless
= 2;
= I;
=
$AF,INET;
default to a high-numbered port.
$port;
#
from
#
from
#
from
/usr/include/sys/socket.h /usr/include/sys/socket.h /usr/include/sys/socket.h
arg).
6-29
Controlling the Analyzer via the LAN
Controlling Multiple Analyzers using a
#
Is this line noise?
#
s= unsigned short, n =
# a4= # x8=
$sockaddr = 'S n a4
4 ascii characters, null padded,
8 null bytes
(?>
x8';
Per1
Script
No, it's the pack format:
short in network order
chop($this,hostname
($name, $alias, $proto)=
#
#
Create arguments for
#
0000 =
Wildcard address
=
'hostname');
bind0
getprotobyname('tcp');
and
connect0
#
$thisport
select(NEW,SOCK); $1 =
It
Open a network connection via a socket
= pack($sockaddr,
I;
$AF-INET, $port, "\O\O\O\O">;
select(stdout);
#
socket(SOCK,
die "cannot create socket:
bind(SOCK,
die "cannot bind socket:
listen(SOCK,
die "cannot listen socket:
$PF,INET, $SOCK,STREAM, $proto)
$!\n";
$thisport)
$!\n";
SOMAXCONN)
$!\n";
calls, below.
II I I
I I
printf "Listening on port %d.\n",
#
#
for ($con = I;;
$con++> C
#
1)
Wait for incoming connections
# $client-addr
accept(NEW-SOCK,
=
die "cannot accept socket:
#
We have a connection!
6-30
$port;
SOCK)
$!\n";
I I
Controlling the Analyzer via the LAN
Controlling Multiple Analyzers using a
#
printf("Accepted
%
Here we used to call
t
However, this causes problems if the parent doesn't
#
for the child -- zombie child processes are left behind!
#
To fix this,
#
code so that it doesn't wait for the parent.
connection
fork0
#$con!\n");
to fork a child process.
it might be better to
exec()
wait0
the child process
# This way, we can handle multipe overlapping messages. # Even if we don't
P
pending connections.
fork(), listen0
will allow multiple
# #
if
(($child
#
%
Get info about incoming connection, and print it
=
fork()) ==
0)
(
#
($af, $port,
Qipaddr
=
$ipaddr)
= unpack($sockaddr,
unpack('C4', $ipaddr);
$client,addr);
$IP-addr =sprintf("%d.%d.%d.%d",
QipaddrCO], (OipaddrCll, @ipaddr[2], OipaddrC31);
$Date= &ctime(time());
printf
"%d:
Got message from %s at %s", $con,
# "Mon Ott
21
21:52:22
PDT
1996\n"
$IP,addr, $Date;
Per1
Script
#
#
Read incoming message, and save it to a file
#
Append it to a file named
#
each analyzer its own data file.
data.IP,addr
giving
#
$file
# print "Routing input to
open(FILE-OUT,
print FILE-OUT while
print FILE-OUT
./data.$IP-add?';
=
'I
(<NEW-SOCK>) (
$file.\n";
'I>> $file") I I
$Date;
"$-'I;
die "Cannot open
3
close(NEW,SOCK); close(FILE-OUT);
#
Tell the instrument's
IBASIC
program to continue
$file: $!'I;
6-31
Controlling the Analyzer via the LAN
Controlling Multiple Analyzers using a Perl Script
system("lanio
3
exit 0;
$IP-addr
'PROGram:STATe CONT"');
6-32

Controlling the Analyzer using HP VEE

lb control your analyzer via LAN using HP VEE, click on the VEE menu titled
“I/O.’
Then select “lb/From Socket” and position the I/O object box on the
screen. Fill in the following Eelds:
Connect Port: Host Name: Timeout :
5025
my8711
15
For faster troubleshooting, you may want to set the timeout to a smaller number. If the your analyzer (example: 15.4.43.5). Using the
hostname
you enter doesn’t work, try using the IP address of
II?
address rather than the
hostname may also be faster. See Figure 6-l for an example of an HP VEE
screen.
NOTE
Since the current firmware revision does not support device clears via LAN. Future revisions may support this protocol.
SICLILAN,
there is no way to perform
SR[ls
or
6-33
Controlling the Analyzer via the LAN
Controlling the Analyzer using HP VEE
6-34
Figure
6-l.
Sample HP VEE Screen
php64c
Controlling the Analyzer with a JavaTM Applet
The following example program demonstrates simple socket programming with Java. It is written in Java progr
Java compilers versions 1.0 and above.
This program is on the example programs disk that was shipped with your analyzer. View the this program.
import java.awt.*; import java.io.*; import java.net.*; import
// // HP87xx // // // // // // // //
following:
:: :: ::
::
public class
java.applet.*;
This is a SCPI Demo to demonstrate how one can communicate with the
network analyzer with a JAVA capable browser. This is the Main class for the SCPI Demo. support the I/O commands and a the applet. To use this applet, either compile this applet with a Java compiler or use the existing compiled classes. Socks.class and ScpiDemo.html to a floppy. Insert the floppy into your instrument. Load up a browser on your computer and do the
1. Load this URL in your browser:
ftp://CYour
2. There should be two text windows show up in the browser: The top one is the SCPI response text area for any response
coming back from the instrument.
to enter a SCPI command.
If the command expects a response, it will show up in the top
window.
ScpiDemo
Thread
Socks URL
TextField TextArea
instrument's IP address or name>/int/ScpiDemo.html
extends
responseThread;
sck;
appletBase; scpicommand scpiResponse
README file
This applet will need Socks.class to
ScpiDemo.html
Type in a SCPI command and hit enter.
java.applet.Applet
=
new
TextFieldO;
= new
TextArea(l0, SO>;
amminglanguage, and will compile with
on the example programs disk before using
for a browser to load
copy
ScpiDemo.class,
The bottom one is for you
implements Runnable c
6-35
Controlling the Analyzer via the LAN
Controlling the Analyzer with a
JavaTM
Applet
Panel Panel
//
Initialize the applets
public void
southPane
Pi
init
(
= new
Panelo;
SetupSocketsO; SetupPanelsO;
//
Set up font type for both panels
Font font
= new
Font("TimesRoman",
Font.BOLD,l4);
scpiResponse.setFont(font); scpiCommand.setFont(font); scpiResponse.appendText("SCPI scpiResponse.appendText("
Demo Program:
_____________________
3
//
This routine is called whenever the applet is
public void
//
Open the sockets if not already opened
start0 (
sck.OpenSockets(); //
Start a response thread
StartResponseThread(true);
3
Response messages\n");
----------------\n")
actived
;
//
This routine is called whenever the applet is out of scope
//
i.e. minize browser
public void
//
Close all local sockets
stop0 C
sck.CloseSockets(); //
Kill the response thread
StartResponseThread(false);
3
//
Action for sending out scpi commands
//
This routine is called whenever a command is received from the
//
SCPI command panel.
public boolean
//
If this is the correct target
if
(evt.target //
action(Event
==
evt, Object what)
scpicommand) (
Get the scpi command
6-36
(
Controlling the Analyzer via the LAN
Controlling the Analyzer with a
String str = scpiCommand.getText();
//
Send it out to the Scpi socket
sck.ScpiHriteLine(str); //
Query for any error
sck.ScpiWriteLine("syst:err?");
return true;
3
return false;
3
//
Start/Stop a Response thread to display the response strings
private void StartResponseThread(boolean start)
if (start)
//
Start a response thread
responseThread responseThread.start();
(
= new
Threadcthis);
(
3
else
(
//
Kill the response thread
responseThread = null;
3
3
JavaTM
Applet
//
Response thread running
public void
String str =
//
Clear the error queue before starting the thread
//
in case if there's any error messages from the previous actions
while (
run0 (
"'I;
str.indexOf("No sck.ScpiHriteLine("syst:err?");
str =
sck.ScpiReadLine();
3
//
Start receiving response or error messages
while(true) (
str =
//
if (
sck.ScpiReadLineO;
If response messages is "No error", do no display it
str.indexOf("No
//
Display the error message in the Response panel
scpiResponse.appendText(str+"\n");
//
Initialize str to null
error") == -1 >
error") == -1 >
(
(
6-37
Controlling the Analyzer via the LAN
Controlling the Analyzer with a
//
query for any error messages
sck.ScpiWriteLine("syst:err?");
.u
f
JavaTM
Applet
3
3
//
Set up and open the SCPI sockets
private void
//
Get server url
appletBase = //
Open the sockets sck =
SetupSockets (
(URL)getCodeBase();
new
Socks(appletBase);
3
//
Set up the SCPI command and response panels
private void
//
Set up SCPI command panel
southPanel.setLayout(new GridLayout(1,
= new
F.setLayout(new p.add("West", p.add("Center", scpiCommand);
southPanel.add(p);
SetupPanels (
PanelO;
BorderLayout(
new
Label("SCP1
command:“));
1));
//
Set up the Response panel
setLayout(new add("Center",
BorderLayout(2,2));
ScpiResponse);
add("South", southPanel);
3
//
Socks class is responsible for open/close/read/write operations
//
from the predefined socket ports. For this example program,
//
the only port used is 5025 for the SCPI port.
class Socks extends
//
Socket Info
//
To add a new socket, add a constant here,
//
change
//
then, edit the constructor for the new socket.
MAX,NUM,OF,SOCKETS
java.applet.Applet (
6-38
Controlling the Analyzer via the LAN
Controlling the Analyzer with a
JavaTM
Applet
public final int private final int
//
Port number
//
5025 is the dedicated port number for
SCPI=O;
MAX,NUM,OF,SOCKETS=l;
private final int SCPI,PORT = 5025;
//
Socket info private URL appletBase; private private
SocketCl
sock
DataInputStream[] sockIn=new DataInputStreamCMAX,NUM~OF,SOCKETSI;
private PrintStreamO private private
//
Constructor
Socks(URL
int[l
boolean[] sockOpen
appletB)
port
= new
= new
sockOut
SocketCMAX-NUM,OF-SOCKETS];
= new
int[MAX,NUM,OF,SOCKETSI;
= new
boolean[MAX,NUM,OF,SOCKETS~;
<
appletBase = appletB; //
Set up for port array.
port[SCPIl
//
Initialize the sock array
for ( int i
sock[il sockIn[i] sockOut[i]
= SCPI,PORT;
0; i <
=
MAX-NUM-OF-SOCKETS;
= null;
= null;
= null;
sockOpen[i] = false;
3
3
HP87ll's
SCPI port
PrintStreamCMAX,NUM,OF,SOCKETSI;
i++ >
(
//***** Sockects //
Open the socket(s) if not already opened
public void
open/close routines
OpenSockets
c
try
<
//
Open each socket if possible
for ( int i
if (
sock[i]
0; i < MAX,NUM-OF-SOCKETS; i++ >
=
!sockOpen[i] > (
= new
Socket(appletBase.getHost(),port[il);
(
6-39
Controlling the Analyzer via the LAN
Controlling the Analyzer with a
sockIn[i]=new DataInputStream(sock[i].getInputStream()); sockOut[i]=new
if (
(sock[i]
(sockOut[il
sockOpen[i] = true;
3
3
3
3
catch (IOException e>
System.out.println("Sock,
s
//
Close the socket(s) if opened
public void
CloseSocket(int s>
<
try
<
if ( sockOpen[s] == true >
//
write blank line to exit servers elegantly
sockOut[sl.println(); sockOut[s].flush(); sockIn[s].close(); sockOut[sl.close(); sock[sl.close(); sockOpen[s] = false;
(
3
3
catch (IOException e>
System.out.println("Sock,
(
3
3
JavaTM
Applet
PrintStream(sockCi].getOutputStream());
!=
null) && (sockInCi1 != null)
!= null) >
Open Error
(
"+e.getMessage());
RR
(
Close Error
"+e.getMessage());
//
Close all sockets
public void
CloseSockets
c
for ( int
i=O;
CloseSocket(
3
3
6-40
i <
MAX-NUM,OF,SOCKETS;
i++ > c
Controlling the Analyzer with a
//
Return the status of the socket, open or close. public boolean SockOpen(int
.c
return
sockOpenCs1;
s>
3
Controlling the Analyzer via the LAN
JavaTM
Applet
//************* //MM
I/O routines for SCPI socket
//
Write an ASCII string with carriage return to SCPI socket
public void
(
if (
sockOut[SCPI].println(command); sockOut[SCPIl.flush();
Socket I/O routines.
ScpiWriteLine(String
SockOpen(SCP1) > (
command)
3
//
Read an ASCII string,
//
from SCPI socket
public String ScpiReadLineO
(
try
<
if (
j
SockOpen(SCP1) > (
return
sockInCSCPIl.readLineO;
terminated with carriage return
3
catch (IOException e)
System.out.println("Scpi
(
Read Line Error
“+e.getMessage());
3
return null;
3
//
Read a byte from SCPI socket
public byte ScpiReadByteO
<
try
C
if (
SockOpen(SCP1) > (
return
sockIn[SCPI].readByteo;
6-41
Loading...