Programming instructions

Programming Examples
LAN Programming Examples
Chapter 2 65
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 18 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 and 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 ESG Documentation CD-ROM as
vxisicl.cpp.
//****************************************************************************************
//
// PROGRAM NAME: vxisicl.cpp
//
// PROGRAM DESCRIPTION:Sample test program using SICL and the VXI-11 protocol
//
// NOTE: You must have the Agilent IO Libraries installed to run this program.
//
// This example uses the VXI-11 protocol to set the signal generator for a 1 gHz CW
// frequency. The signal generator is queried for operation complete and then queried
// for its ID string. The frequency and ID string are then printed to the display.
//
// IMPORTANT: Enter in your signal generators hostname in the instrumentName declaration
// where the "xxxxx" appears.
//
//****************************************************************************************
#include "stdafx.h"
#include <sicl.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
INST id; // Device session id
int opcResponse; // Variable for response flag
char instrumentName[] = "xxxxx"; // Put your instrument’s hostname here
char instNameBuf[256]; // Variable to hold instrument name