150 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
c = *scan++;
posn = strchr(optstring, c); /* DDP */
if (posn == NULL || c == ':') {
fprintf(stderr, "%s: unknown option -%c\n", argv[0], c);
return('?');
}
posn++;
if (*posn == ':') {
if (*scan != '\0') {
optarg = scan;
scan = NULL;
} else {
optarg = argv[optind];
+;
}
}
return(c);
}
Sockets LAN Programming Using Java
In this example the Java program connects to the signal generator through
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
signal generator. For example,
String instrumentName = (your
signal generator’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
.
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...