Agilent Technologies ES Switch User Manual


 
LAN Interface Supplement 6-37
Controlling the Analyzer via the LAN
Controlling the Analyzer with a Java™ Applet
p = new Panel();
p.setLayout(new BorderLayout());
p.add("West", new Label("SCPI command:"));
p.add("Center", scpiCommand);
southPanel.add(p);
// Set up the Response panel
setLayout(new BorderLayout(2,2));
add("Center", scpiResponse);
add("South", southPanel);
}
}
// 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 java.applet.Applet {
// Socket Info
// To add a new socket, add a constant here,
// change MAX_NUM_OF_SOCKETS
// then, edit the constructor for the new socket.
public final int SCPI=0;
private final int MAX_NUM_OF_SOCKETS=1;
// Port number
// 5025 is the dedicated port number for HP8711's SCPI port
private final int SCPI_PORT = 5025;
// Socket info
private URL appletBase;
private Socket[] sock = new Socket[MAX_NUM_OF_SOCKETS];
private DataInputStream[] sockIn=new DataInputStream[MAX_NUM_OF_SOCKETS];
private PrintStream[] sockOut = new PrintStream[MAX_NUM_OF_SOCKETS];
private int[] port = new int[MAX_NUM_OF_SOCKETS];