68 Chapter 2
Programming Examples
LAN Programming Examples
LAN Programming Examples
• “VXI-11 Programming Using SICL in C” on page 68
• “VXI-11 Programming Using VISA in C” on page 71
• “Setting Parameters and Sending Queries Using Sockets and C” on page 75
• “Setting the Power Level and Sending Queries Using PERL” on page 102
• “Generating a CW Signal Using Java” on page 103
The LAN programming examples in this section demonstrate the use of VXI-11 and Sockets LAN to control
the signal generator. For details on using FTP and TELNET refer to “Using FTP” on page 20 and “Using
TELNET LAN” on page 17 of this guide.
Before Using the Examples
To use these programming examples you must change references to the IP address and hostname to match
the IP address and hostname of your signal generator.
VXI-11 Programing
The signal generator supports the VXI-11 standard for instrument communication over the LAN interface.
Agilent IO Libraries support the VXI-11 standard and must be installed on your computer before using the
VXI-11 protocol. Refer to “Using VXI-11” on page 16 of this Programming Guide for information on
configuring and using the VXI-11 protocol.
The VXI-11 examples use TCPIP0 as the board address.
VXI-11 Programming Using SICL in C
The following program uses the VXI-11 protocol and SICL to control the signal generator. The signal
generator is set to a 1 GHz CW frequency and then queried for its ID string. Before running this code, you
must set up the interface using the Agilent IO Libraries IO Config utility.
The following program example is available on the PSG Documentation CD-ROM as vxisicl.cpp.
//****************************************************************************************
//
// PROGRAM NAME:vxisicl.cpp
//
// PROGRAM DESCRIPTION:Sample test program using SICL and the VXI-11 protocol