
Programming Guide 3-7
ESG Family Signal Generators Remote Data Transfer
ARB Waveform Data Downloads
Example Programs
Waveform Downloading Using HP BASIC for Windows
The following program
shows you how to download waveforms using HP BASIC for Windows
into volatile ARB
memory.
To download into nonvolatile ARB memory, replace line 80 with:
80 OUTPUT @ESG USING "#,K";":MMEM:DATA ""NVARBI:testfile"", #"
and replace line 130 with:
130 OUTPUT @ESG USING "#,K";":MMEM:DATA ""NVARBQ:testfile"", #"
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 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.
5 Npoints=20
10 ALLOCATE INTEGER Iwfm_data(1:Npoints),Qwfm_data(1:Npoints)
15 DEG
20 FOR I=1 TO Npoints
25 Iwfm_data(I)=INT(8191*(COS(I*360/Npoints))+8192)
30 Qwfm_data(I)=INT(8191*(COS(I*360/Npoints))+8192)
35 NEXT I
40 Nbytes=2*Npoints
45 Assign @ESG to 719
50 Assign @ESGb to 719; FORMAT MSB FIRST
60 Nbytes$=VAL$(Nbytes)
70 Ndigits$=VAL$(LEN$(Nbytes$))
80 OUTPUT @ESG USING "#,K";":MMEM:DATA ""ARBI:testfile"", #"
90 OUTPUT @ESG USING "#,K";Ndigits$
100 OUTPUT @ESG USING "#,K";Nbytes
110 OUTPUT @ESGb;Iwfm_data(*)
120 OUTPUT @ESG;
130 OUTPUT @ESG USING "#,K";":MMEM:DATA ""ARBQ:testfile"", #"
140 OUTPUT @ESG USING "#,K";Ndigits$
150 OUTPUT @ESG USING "#,K";Nbytes$
160 OUTPUT @ESGb;Qwfm_data(*)
170 OUTPUT @ESG;
180 Assign @ESG TO *
190 Assign @ESGb TO *
200 END
Comentários a estes Manuais