EasyManuals Logo
Home>Agilent Technologies>Inverter>E4428C

Agilent Technologies E4428C Programming Guide

Agilent Technologies E4428C
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #138 background imageLoading...
Page #138 background image
128 Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
Sockets LAN Programming Using Java
In this example the Java program connects to the signal generator 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 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.
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. Type exit at the command prompt to end the program.
Generating a CW Signal Using Java
The following program example is available on the signal generator Documentation CD- ROM as
javaex.txt.
//**************************************************************************
// PROGRAM NAME: javaex.txt // Sample java
program to talk to the signal generator via SCPI-over-sockets
// This program requires Java version 1.1 or later.
// Save this code as ScpiSockTest.java
// Compile by typing: javac ScpiSockTest.java
// Run by typing: java ScpiSockTest
// The signal generator is set for 1 GHz and queried for its id string
//**************************************************************************
import java.io.*;
import java.net.*;
class ScpiSockTest
{
public static void main(String[] args)
{
String instrumentName = "xxxxx"; // Put instrument hostname here
try
{
Socket t = new Socket(instrumentName,5025); // Connect to instrument
// Setup read/write mechanism
BufferedWriter out =
new BufferedWriter(

Table of Contents

Other manuals for Agilent Technologies E4428C

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies E4428C and is the answer not in the manual?

Agilent Technologies E4428C Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4428C
CategoryInverter
LanguageEnglish

Related product manuals