Agilent Technologies E4406A VSA Series Programmer's Manual page 159

Transmitter tester
Hide thumbs Also See for E4406A VSA Series:
Table of Contents

Advertisement

scpiCommand.setFont(font);
scpiResponse.appendText("SCPI Demo Program:
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.
public boolean action(Event evt, Object what) {
// If this is the correct target
if (evt.target == scpiCommand) {
// Get the scpi command
String str = scpiCommand.getText();
// Send it out to the Scpi socket
sck.ScpiWriteLine(str);
String tempStr = str.toLowerCase();
// If command str is "syst:err?", don't need to send another one.
if ( (tempStr.indexOf("syst") == -1) ||
(tempStr.indexOf("err") == -1)
// Query for any error
sck.ScpiWriteLine("syst:err?");
}
return true;
}
return false;
}
// Start/Stop a Response thread to display the response strings
private void StartResponseThread(boolean start) {
if (start) {
// Start a response thread
responseThread = new Thread(this);
responseThread.start();
}
else {
// Kill the response thread
Chapter 3
Programming Examples
Using Java Programming Over Socket LAN
Response messages\n");
) {
159

Advertisement

Table of Contents
loading

Table of Contents