118 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
ipromptf(id, "*IDN?\n", "%t", buf);// Query for id string
printf("Instrument ID: %s\n", buf);// Print id string to display
iclose(id);// Close the session
return 0;
}
VXI-11 Programming Using VISA and 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 –5 dBm power level and
queried for its ID string. Before running this code, you must set up the interface
using the Keysight IO Libraries IO Config utility.
vxivisa.cpp
performs the
following functions:
— sets signal generator to a –5 dBm power level
— queries signal generator for an ID string
— error checking
The following program example is available on the signal generator
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 Keysight 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
//
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...