Technical data
Programming Examples 3
Agilent N8211A/N8212A Performance Upconverter Synthetic Instrument Module, 250 kHz to 20 / 40 GHz 91
posn++;
if (*posn == ':') {
if (*scan != '\0') {
optarg = scan;
scan = NULL;
} else {
optarg = argv[optind];
optind++;
}
}
return(c);
}
Sockets LAN Programming Using Java
In this example the Java program connects to the N8211A/N8212A via sockets LAN. This
program requires Java version 1.1 or later be installed on your PC. To run the program
perform the following steps:
1 In the code example below, type in the hostname or IP address of your
N8211A/N8212A. For example, String instrumentName = (your
N8211A/N8212A’s hostname).
2 Copy the program as ScpiSockTest.java and save it in a convenient directory on
your computer. For example save the file to the C:\jdk1.3.0_2\bin\javac
directory.
3 Launch the Command Prompt program on your computer. Click Start > Programs >
Command Prompt.
4 Compile the program. At the command prompt type: javac
ScpiSockTest.java.
The directory path for the Java compiler must be specified. For example: C:\
>jdk1.3.0_02\bin\javac ScpiSockTest.java
5 Run the program by typing java ScpiSockTest at the command prompt.
6 Ty p e exit at the command prompt to end the program.