Agilent Technologies N5183A MXG User Manual

Page 307

Advertising
background image

Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide

297

Creating and Downloading User-Data Files

User File Data (Bit/Binary) Downloads (E4438C and E8267D)

C

the file data in bytes

bin:

the location of the file within the signal generator file system

my_file

the data file name as it will appear in the signal generator’s memory
catalog

#

indicates the start of the block data

3

B has three decimal digits

240

240 bytes (1,920 bits) of data to follow in C

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 299

.

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
2
3
4
5
6
7
8
9

int bytesToSend;

bytesToSend = numsamples;

char s[20];

char cmd[200];

sprintf(s, "%d", bytesToSend);

sprintf(cmd, ":MEM:DATA \"BIN:FILE1\", #%d%d", strlen(s), bytesToSend);

iwrite(id, cmd, strlen(cmd), 0, 0);

iwrite(id, databuffer, bytesToSend, 0, 0);

iwrite(id, "\n", 1, 1, 0);

file_name

A

C

:MEM:DATA “bin:my_file”,#324012%S!4&07#8g*Y9@7...

B

file location

Advertising
This manual is related to the following products: