Chapter 2 71
Programming Examples
LAN Programming Examples
VXI-11 Programming Using VISA in C
The following program uses the VXI-11 protocol and the VISA library to control the signal generator. The
signal generator is set to a 1 GHz CW frequency and queried for its ID string. Before running this code, you
must set up the interface using the Agilent IO Libraries IO Config utility. This example is available on the
PSG Documentation CD-ROM as vxivisa.cpp.
//****************************************************************************************
// PROGRAM FILE NAME:vxivisa.cpp
// Sample test program using the VISA libraries and the VXI-11 protocol
//
// NOTE: You must have the Agilent Libraries installed on your computer to run
// this program
//
// PROGRAM DESCRIPTION:This example uses the VXI-11 protocol and VISA to query
// the signal generator for its ID string. The ID string is then printed to the
// screen. Next the signal generator is set for a -5 dBm power level and then
// queried for the power level. The power level is printed to the screen.
//
// IMPORTANT: Set up the LAN Client using the IO Config utility
//
//****************************************************************************************
#include <visa.h>
#include <stdio.h>
#include "StdAfx.h"
#include <stdlib.h>
#include <conio.h>
#define MAX_COUNT 200
int main (void)
{