Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 269
Creating and Downloading Waveform Files
Programming Examples
char s2[256];
sprintf(s2, "mmem:data \"%s\", #%d%d", instDestFile, lenLen,
lenToSend);
iwrite(id, s2, strlen(s2), 0, 0);
// Send file in BUFFER_SIZE chunks
long numRead;
do
{
numRead = fread(buf, sizeof(char), BUFFER_SIZE, file);
iwrite(id, buf, numRead, 0, 0);
} while (numRead == BUFFER_SIZE);
// Send the terminating newline and EOM
iwrite(id, "\n", 1, 1, 0);
delete [] buf;
}
else
{
fprintf(stderr, "Could not allocate memory for copy
buffer\n");
}
fclose(file);
iclose(id);
return 0;
}
Importing and Downloading Using VISA—Big Endian Order
On the documentation CD, this programming example’s name is
“
DownLoad+.txt
.”
This C++ programming example (compiled using Microsoft Visual C++ 6.0)
assumes that the data is in big endian order and performs the following
functions:
— error checking
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...