88 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
}else{
printf("Source RF state is : off\n");
}
// Close the sessions
viClose(vi);
viClose(defaultRM);
}
Generating a CW Signal Using VISA and C
This example uses VISA library functions to control the signal generator. The
signal generator is set for a CW frequency of 500 kHz and a power level of
−
2.3
dBm. Launch
Microsoft Visual C++ 6.0, add the required files, and enter the code into your
.cpp source file.
visaex4.cpp
performs the following functions:
— verifies the GPIB connections and interface are functional
— resets the signal generator
— queries the instrument (CW frequency, power level, frequency mode, and
RF state)
— reads responses into the rdBuffer (CW frequency, power level, and
frequency mode)
— turns signal generator RF state off
— verifies RF state off
The following program example is available on the signal generator
Documentation CD-ROM as
visaex4.cpp
.
//*****************************************************************
// PROGRAM FILE NAME: visaex4.cpp
//
// PROGRAM DESCRIPTION: This example demonstrates query commands.
The signal generator
// frequency and power level.
// The RF state of the signal generator is turn on and then the state
is queried. The
// response will indicate that the RF state is on. The RF state is
then turned off and
// queried. The response should indicate that the RF state is off.
The query results are
// printed to the to the display window.
//
//*****************************************************************
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...