Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 265
Creating and Downloading Waveform Files
Programming Examples
// iqbuffer[index*2] = idata[index]; // Big endian order,
uncomment this line
// iqbuffer[index*2+1] = qdata[index]; // Big endian order,
uncomment this line
// } // Big endian order,
uncomment this line
// Open a connection to write to the instrument
INST id=iopen(instOpenString);
if (!id)
{
fprintf(stderr, “iopen failed (%s)\n”, instOpenString);
return -1;
}
// Declare variables to hold portions of the SCPI command
int bytesToSend;
char s[20];
char cmd[200];
bytesToSend = numsamples*4; // calculate the number of
bytes
sprintf(s, “%d”, bytesToSend); // create a string s with that
number of bytes
// The SCPI command has four parts.
// Part 1 = :MEM:DATA “filename”,#
// Part 2 = length of Part 3 when written to a string
// Part 3 = length of the data in bytes. This is in s from
above.
// Part 4 = the buffer of data
// Build parts 1, 2, and 3 for the I and Q data.
sprintf(cmd, “:MEM:DATA \”WFM1:FILE1\”, #%d%d”, strlen(s),
bytesToSend);
// Send parts 1, 2, and 3
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...