376 Keysight Signal Generators Programming Guide
Creating and Downloading User–Data Files
User Flatness Correction Downloads Using C++ and VISA
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 74 for more information.
The FlatCal program asks the user to enter a number of frequency and amplitude pairs. Frequency
and amplitude values are entered through 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 6-3 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 Keysight VISA User’s Manual available on Keysight’s website:
http:\\www.keysight.com for more information on VISA functions.
The program listing for the FlatCal program is shown below. It is available on the Documentation
CD–ROM in the programming examples section as flatcal.cpp.