98 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
printf("Press the front panel Local key to return the\n");
printf("signal generator to manual operation.\n");
// Closes the sessions
printf("\n");
viClose(vi);
viClose(defaultRM);
}
Generating a Swept Signal Using VISA and Visual C++
This example sets up the signal generator for a frequency sweep from 1 to 2
GHz with 101 points and a .01 second dwell period for each point. A loop is
used to generator 5 sweep operations. The signal generator triggers each
sweep with the
:INIT
command. There is a wait introduced in the loop to
allow the signal generator to complete all operations such as set up and
retrace before the next sweep is generated.
visaex11.cpp
performs the
following functions:
— sets up the signal generator for a 1 to 2 GHz frequency sweep
— sets up the signal generator to have a dwell time of .01 seconds and 101
points in the sweep
— sleep function is used to allow the instrument to complete its sweep
operation
The following program example is available on the signal generator
Documentation CD-ROM as
visaex11.cpp
.
//*****************************************************************
// PROGRAM FILE NAME: visaex11.cpp
//
// PROGRAM DESCRIPTION: This program sets up the signal generator to
// sweep from 1-2 GHz. A loop and counter are used to generate 5
sweeps.
// Each sweep consists of 101 points with a .01 second dwell at each
point.
//
// The program uses a Sleep function to allow the signal generator
to
// complete it's sweep operation before the INIT command is sent.
// The Sleep function is available with the windows.h header file
which is
// included in the project.
//
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...