312 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
290 END
Creating and Downloading E443xB Waveform Data Using HP BASIC for
Windows
The following program shows you how to download waveforms using HP Basic
for Windows into volatile ARB memory. This program is similar to the following
program example as well as the previous examples. The difference between
BASIC for UNIX and BASIC for Windows is the way the formatting, for the most
significant bit (MSB) on lines 110 and 120, is handled.
To download into non–volatile ARB memory, replace line 160 with:
160 OUTPUT @ESG USING "#,K";":MMEM:DATA ""NVARBI:testfile"", #"
Program Comments
10:
Program file name
20:
Sets the number of points in the waveform.
30:
Allocates integer data array for I and Q waveform points.
40:
Sets HP BASIC to use degrees for cosine and sine functions.
50:
Sets up first loop for I waveform points.
60:
Calculate and interleave I waveform points.
70:
End of loop
80
Sets up second loop for Q waveform points.
90:
Calculate and interleave Q waveform points.
100:
End of loop.
120:
Calculates number of bytes in I/Q waveform.
130:
Opens an IO path to the signal generator using GPIB. 7 is the address of the GPIB card in the computer,
and 19 is the address of the signal generator. This IO path is used to send ASCII data to the signal
generator.
140:
Opens an IO path for sending binary data to the signal generator.
150:
Creates an ASCII string representation of the number of bytes in the waveform.
160 to 170:
Finds the number of digits in Nbytes.
190:
Sends the first part of the SCPI command, MEM:DATA along with the name of the file,
data_file
, that
will receive the waveform data. The name,
data_file,
will appear in the signal generator’s memory
catalog.
200 to 210:
Sends the rest of the ASCII header.
230:
Sends the binary data. Note that
PSGb
is the binary IO path.
240:
Sends an End–of–Line to terminate the transmission.
250 to 260:
Closes the connections to the signal generator.
290:
End the program.
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...