Programming instructions
Downloading and Using Files
ARB Waveform Data Downloads
Chapter 4156
Waveform Downloading Using HP BASIC for Windows
The following program will
download a waveform using HP BASIC for Windows
into volatile ARB memory. The
waveform generated by this program is the same as the default SINE_TEST_WFM waveform file
available in the signal generator’s waveform memory. This code is similar to the code shown
for BASIC for UNIX but there is a formatting difference in line 130 and line 140.
To download into non-volatile memory, replace line 80 with:
210 OUTPUT @ESG 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 IQ waveform file.
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.
10 ! RE-SAVE "BASIC_Win_file"
20 Num_points=200
30 ALLOCATE INTEGER Int_array(1:Num_points*2)
40 DEG
50 FOR I=1 TO Num_points*2 STEP 2
60 Int_array(I)=INT(32767*(SIN(I*360/Num_points)))
70 NEXT I
80 FOR I=2 TO Num_points*2 STEP 2
90 Int_array(I)=INT(32767*(COS(I*360/Num_points)))
100 NEXT I
110 PRINT "Data Generated"
120 Nbytes=4*Num_points
130 ASSIGN @Esg TO 719
140 ASSIGN @Esgb TO 719;FORMAT MSB FIRST
150 Nbytes$=VAL$(Nbytes)
160 Ndigits=LEN(Nbytes$)
170 Ndigits$=VAL$(Ndigits)
180 WAIT 1
190 OUTPUT @Esg USING "#,K";"MMEM:DATA ""WFM1:data_file"",#"
200 OUTPUT @Esg USING "#,K";Ndigits$
210 OUTPUT @Esg USING "#,K";Nbytes$
220 WAIT 1
230 OUTPUT @Esgb;Int_array(*)
240 OUTPUT @Esg;END
250 ASSIGN @Esg TO *
260 ASSIGN @Esgb TO *
270 PRINT
280 PRINT "*END*"
290 END