310 Keysight Signal Generators Programming Guide
Creating and Downloading Waveform Files 
Programming Examples 
250   OUTPUT @Esg;END
260   ASSIGN @Esg TO *
270   ASSIGN @Esgb TO *
280   PRINT 
290   PRINT "*END*"
300   END
Creating and Downloading E443xB Waveform Data Using HP Basic for UNIX
On the documentation CD, this programming example’s name is “e443xb_hpbasicUx2.txt.”
The following program shows you how to download waveforms using HP BASIC for UNIX. It is similar 
to the previous program example. The difference is the way the formatting for the most significant bit 
(MSB) on lines is handled. 
First, the I waveform data is put into an array of integers called Iwfm_data and the Q waveform 
data is put into an array of integers called Qwfm_data. The variable Nbytes is set to equal the 
number of bytes in the I waveform data. This should be twice the number of integers in Iwfm_data, 
since an integer is represented 2 bytes. Input integers must be between 0 and 16383.
In the Output commands, USING “#,K” formats the data. The pound symbol (#) suppresses the 
automatic EOL (End of Line) output. This allows multiple output commands to be concatenated as if 
they were a single output. The “K” instructs HP BASIC to output the following numbers or strings in 
the default format. 
Program Comments 
10: Program file name.
20 Sets the number of points in the waveform.
30: Defines arrays for I and Q waveform points. Sets them to be integer arrays.
40: Sets HP BASIC to use degrees for cosine and sine functions.
50: Sets up loop to calculate waveform points.
60: Calculates I waveform points.
70: Calculates Q waveform points.
80: End of loop.
160 and 210: The I and Q waveform files have the same name
90 to 300:
See the 
table on page306 for program comments.