EasyManuals Logo

Agilent Technologies E4406A VSA Series User Manual

Agilent Technologies E4406A VSA Series
420 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #161 background imageLoading...
Page #161 background image
Chapter 3 161
Programming Examples
Using Java Programming Over Socket LAN
}
// 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 E4406A 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];
private boolean[] sockOpen = new boolean[MAX_NUM_OF_SOCKETS];
// Constructor
Socks(URL appletB)
{
appletBase = appletB;
// Set up for port array.
port[SCPI] = SCPI_PORT;
// Initialize the sock array
for ( int i = 0; i < MAX_NUM_OF_SOCKETS; i++ ) {
sock[i] = null;
sockIn[i] = null;
sockOut[i] = null;
sockOpen[i] = false;
}
}
//***** Sockects open/close routines
// Open the socket(s) if not already opened
public void OpenSockets()
{
try {
// Open each socket if possible
for ( int i = 0; i < MAX_NUM_OF_SOCKETS; i++ ) {
if ( !sockOpen[i] ) {
sock[i] = new Socket(appletBase.getHost(),port[i]);
sockIn[i] = new DataInputStream(sock[i].getInputStream());

Table of Contents

Other manuals for Agilent Technologies E4406A VSA Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E4406A VSA Series and is the answer not in the manual?

Agilent Technologies E4406A VSA Series Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4406A VSA Series
CategoryTest Equipment
LanguageEnglish

Related product manuals