Agilent Technologies ES Switch User Manual


 
6-36 LAN Interface Supplement
Controlling the Analyzer via the LAN
Controlling the Analyzer with a Java™ Applet
// Clear the error queue before starting the thread
// in case if there's any error messages from the previous actions
while ( str.indexOf("No error") == -1 ) {
sck.ScpiWriteLine("syst:err?");
str = sck.ScpiReadLine();
}
// Start receiving response or error messages
while(true) {
str = sck.ScpiReadLine();
// If response messages is "No error", do no display it
if ( str.indexOf("No error") == -1 ) {
// Display the error message in the Response panel
scpiResponse.appendText(str+"\n");
// Query for any error messages
sck.ScpiWriteLine("syst:err?");
}
}
}
// Set up and open the SCPI sockets
private void SetupSockets() {
// Get server url
appletBase = (URL)getCodeBase();
// Open the sockets
sck = new Socks(appletBase);
}
// Set up the SCPI command and response panels
private void SetupPanels() {
// Set up SCPI command panel
southPanel.setLayout(new GridLayout(1, 1));