Keysight E4428C ESG RF Programming Manual page 341

Signal generators
Table of Contents

Advertisement

C
the file data in bytes
:MEM:DATA "bin:my_file",#324012%S!4&07#8g*Y9@7...
file location
the location of the file within the signal generator file system
bin:
the data file name as it will appear in the signal generator's memory catalog
my_file
#
indicates the start of the block data
B has three decimal digits
3
240 bytes (1,920 bits) of data to follow in C
240
12%S!4&07#8g*Y9@7... the ASCII representation of some of the block data (binary data)
downloaded to the signal generator, however not all ASCII values are printable
In actual use, the block data is not part of the command line as shown above, but instead resides in
a binary file on the PC/UNIX. When the program executes the SCPI command, the command line
notifies the signal generator that it is going to receive block data of the stated size and to place the
file in the signal generator file directory with the indicated name. Immediately following the
command execution, the program downloads the binary file to the signal generator. This is shown in
the following section, "Command Format in a Program Routine"
Some commands are file location specific and do not require the file location as part of the file
name. An example of this is the bit file SCPI command shown in "Command for Bit File Downloads" on
page 335.
Command Format in a Program Routine
This section demonstrates the use of the download SCPI command within the confines of a C++
program routine. The following code sends the SCPI command and downloads user file data to the
signal generator's Binary memory catalog (directory).
Line
Code—Download User File Data
1
int bytesToSend;
2
bytesToSend = numsamples;
3
char s[20];
4
char cmd[200];
5
sprintf(s, "%d", bytesToSend);
6
sprintf(cmd, ":MEM:DATA \"BIN:FILE1\", #%d%d", strlen(s), bytesToSend);
7
iwrite(id, cmd, strlen(cmd), 0, 0);
8
iwrite(id, databuffer, bytesToSend, 0, 0);
9
iwrite(id, "\n", 1, 1, 0);
Line
Code Description—Download User File Data
1
Define an integer variable (bytesToSend) to store the number of bytes to send to the signal
generator.
Keysight Signal Generators Programming Guide
file_name
A
B
Creating and Downloading User–Data Files
User File Data (Bit/Binary) Downloads (E4438C and E8267D)
C
333

Advertisement

Table of Contents
loading

Table of Contents