Agilent Technologies E4406A VSA Satellite Radio User Manual


 
172 Chapter 3
Programming Examples
Using Java Programming Over Socket LAN
Panel p;
// Initialize the applets
public void init() {
SetupSockets();
SetupPanels();
// Set up font type for both panels
Font font = new Font("TimesRoman", Font.BOLD,14);
scpiResponse.setFont(font);
scpiCommand.setFont(font);
scpiResponse.appendText("SCPI Demo Program: Response messages\n");
scpiResponse.appendText("--------------------------------------------\n");
}
// This routine is called whenever the applet is actived
public void start() {
// Open the sockets if not already opened
sck.OpenSockets();
// Start a response thread
StartResponseThread(true);
}
// This routine is called whenever the applet is out of scope
// i.e. minize browser
public void stop() {
// Close all local sockets
sck.CloseSockets();
// Kill the response thread
StartResponseThread(false);
}
// Action for sending out scpi commands
// This routine is called whenever a command is received from the
// SCPI command panel.