Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 243
Creating and Downloading Waveform Files
Downloading Waveform Data
Using Advanced Programming Languages
This procedure uses code from the C++ programming example
Byte Swapping, Interleaving, and Downloading I and Q Data—Big and Little
For information on creating I/Q waveform data, refer to
There are two steps in the process of downloading an I/Q waveform:
1.
Open a connection session.
2.
Download the I/Q data.
1. Open a connection session with the signal generator.
The following code establishes a LAN connection with the signal generator or
prints an error message if the session is not opened successfully.
Line
Code Description—Download the I/Q data
6
Download the I/Q waveform data to the signal generator by using the function call (
agt_waveformload
) from
the Keysight Waveform Download Assistant. Some of the arguments are optional as indicated below, but if one
is used, you must use all arguments previous to the one you require.
Notice that with this function, you can perform the following actions:
— download complex I/Q data
— name the file (optional argument)
— set the sample rate (optional argument)
If you do not set a value, the signal generator uses its preset value, or if a waveform was
previously played, the value from that waveform.
— start or not start waveform playback after downloading the data (optional argument)
Use either the argument
play
or the argument
no_play
.
— whether to normalize and scale the I/Q data (optional argument)
If you normalize and scale the data within the body of the code, then use
no_normscale
,
but if you need to normalize and scale the data, use
norm_scale
. This normalizes the
waveform data to the DAC values and then scales the data to 70% of the DAC values.
— download marker data (optional argument)
If there is no marker data, the signal generator creates a default marker file, all marker set
to zero.
To verify the waveform data download, see
“Loading, Playing, and Verifying a Downloaded Waveform” on page 247
7–9
If the download fails, display an error message.
Line
Code Description—Open a Connection Session
1
2
3
4
5
6
7
char* instOpenString ="lan[hostname or IP address]";
//char* instOpenString ="gpib<primary addr>,<secondary addr>"
;
INST id=iopen(instOpenString);
if (!id)
{
fprintf(stderr, "iopen failed (%s)\n", instOpenString);
return -1;
}
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...