Technical data
92 Agilent N8211A/N8212A Performance Upconverter Synthetic Instrument Module, 250 kHz to 20 / 40 GHz
3 Programming Examples
Generating a CW Signal Using Java
The following program example is available on the N8211A/N8212A Documentation
CD-ROM as javaex.txt.
//**************************************************************************
// PROGRAM NAME: javaex.txt // Sample java program
to talk to the N8211A/N8212A 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 N8211A/N8212A 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(
new OutputStreamWriter(t.getOutputStream()));
BufferedReader in =
new BufferedReader(
new InputStreamReader(t.getInputStream()));
System.out.println("Setting frequency to 1 GHz...");