Technical data

Creating and Downloading User-Data Files 5
Agilent N8211A/N8212A Performance Upconverter Synthetic Instrument Module, 250 kHz to 20 / 40 GHz 147
User Flatness Correction Downloads Using C++ and VISA
This sample program uses C++ and the VISA libraries to download user–flatness correction
values to the signal generator. The program uses the LAN interface but can be adapted to
use the GPIB interface by changing the address string in the program.
You must include header files and resource files for library functions needed to run this
program. Refer to “Running C++ Programs” on page 59 for more information.
The FlatCal program asks the user to enter a number of frequency and amplitude pairs.
Frequency and amplitude values are entered via the keyboard and displayed on the console
interface. The values are then downloaded to the signal generator and stored to a file
named flatCal_data. The file is then loaded into the signal generator’s memory catalog and
corrections are turned on. The figure below shows the console interface and several
frequency and amplitude values. Use the same format, shown in the figure below, for
entering frequency and amplitude pairs (for example, 12ghz, 1.2db).
Figure 8 FlatCal Console Application
The program uses VISA library functions. The non–formatted viWrite VISA function is used
to output data to the signal generator. Refer to the Agilent VISA User’s Manual available on
Agilents website: http:\\www.agilent.com for more information on VISA functions.
The program listing for the FlatCal program is shown below. It is available on the CD–ROM
in the programming examples section as flatcal.cpp.
//************************************************************************************
// PROGRAM NAME:FlatCal.cpp
//
// PROGRAM DESCRIPTION:C++ Console application to input frequency and amplitude