User`s manual
BASIC Program Example (DACBLOK1)
The DACBLOK1 program shows how to store a waveform segment
(i.e., points of an arbitrary waveform) into the AFG’s segment memory. The
waveform segment is stored as DAC codes in the Signed number format. This
program is the same program as SIGN_DAT beginning on page 227, except
the data is transferred to the AFG using the Definite Length Arbitrary Block
method. The example generates a 200 point -5 V to +5 V positive going ramp.
To transfer Definite Length Block Data to the AFG requires that the data sent
with the
[SOURce:]LIST[1][:SEGMent]:VOLTage:DAC command must be
contiguous. To do this, sent no carriage return (CR) and line feed (LF) before
all the data is transferred. The format in line 440 disables the CR and LF. The
CR and LF sent in line 460 tells the AFG that the data transfer is complete.
1 !RE-STORE"DACBLOK1"
2 !This program downloads arbitrary waveform data as signed
3 !(2’s complement) DAC codes. The data is sent in an IEEE-488.2
4 !definite length block in 16-bit integer format. The waveform is
5 !a 200 point, -5V to +5V ramp wave.
6 !
10 !Assign I/O path between the computer and E1445A.
20 ASSIGN @Afg TO 70910
30 ASSIGN @Afg1 TO 70910.;FORMAT OFF !path for binary data
40 COM @Afg,@Afg1
50 !
60 !Set up error checking
70 ON INTR 7 CALL Errmsg
80 ENABLE INTR 7;2
90 OUTPUT @Afg;"*CLS"
100 OUTPUT @Afg;"*SRE 32"
110 OUTPUT @Afg;"*ESE 60"
120 !
130 !Call the subprograms which reset the AFG and erase all waveform
140 !segments and sequences.
150 CALL Rst
160 CALL Wf_del
170 !
180 OUTPUT @Afg;"SOUR:FREQ1:FIX 200E3;"; !frequency
190 OUTPUT @Afg;":SOUR:FUNC:SHAP USER;"; !function
200 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 5.11875V" !amplitude
210 !
220 CALL Ramp_wave
230 !
240 OUTPUT @Afg;"SOUR:FUNC:USER RAMP_OUT" !waveform sequence
250 OUTPUT @Afg;"INIT:IMM" !wait-for-arm state
260 !
270 WAIT .1!allow interrupt to be serviced
280 OFF INTR 7
Continued on Next Page
232 High Speed Operation Chapter 7