310 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Creating and Downloading Waveform Files
Programming Examples
Creating and Downloading Waveform Data Using HP BASIC for UNIX
On the documentation CD, this programming example’s name is
“
hpbasicUx.txt
.”
The following program shows you how to download waveforms using HP Basic
for UNIX. The code is similar to that shown for HP BASIC for Windows, but
there is a formatting difference in line 130 and line 140.
To download into non–volatile memory, replace line 190 with:
190 OUTPUT @PSG USING "#,K";":MMEM:DATA ""NVWFM:testfile"", #"
As discussed at the beginning of this section, I and Q waveform data is
interleaved into one file in 2’s compliment form and a marker file is associated
with this I/Q waveform file.
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.
Program Comments (Continued)
Summary of Contents for X-Series
Page 4: ...4 ...
Page 10: ...10 Contents ...