Keysight E4428C ESG RF Programming Manual page 279

Signal generators
Table of Contents

Advertisement

{
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;
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.
//
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
iwrite(id, cmd, strlen(cmd), 0, 0);
// Send part 4.
Be careful to use the correct command here.
// programming languages, there are two methods to send SCPI commands:
//
Method 1 = stop at the first '0' in the data
//
Method 2 = send a fixed number of bytes, ignoring '0' in the data.
// You must find and use the correct command for Method 2.
iwrite(id, iqbuffer, bytesToSend, 0, 0);
// Send a terminating carriage return
iwrite(id, "\n", 1, 1, 0);
printf("Loaded file using the E4438C, E8267C and E8267D format\n");
return 0;
}
Keysight Signal Generators Programming Guide
// calculate the number of bytes
This is in s from above.
Creating and Downloading Waveform Files
Programming Examples
In many
271

Advertisement

Table of Contents
loading

Table of Contents