User`s manual
BASIC Program Example (DACBLOK2)
The DACBLOK2 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 Unsigned number format.
This program is the same program as UNS_DAT beginning on page 230.
The data is transferred to the AFG using the Indefinite Length Arbitrary Block
method. The example generates a 200 point +5 V to -5 V negative going ramp.
To transfer Indefinite 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. Also, since EOL is a data terminating
string, it must not be sent before the data transfer is complete. The format in
line 440 disables the CR, LF, and EOL. The LF character and EOL string
sent in line 460 tells the AFG that the data transfer is complete.
1 !RE-STORE"DACBLOK2"
2 !This program downloads arbitrary waveform data as unsigned
3 !DAC codes. The data is sent in an IEEE-488.2 indefinite length
4 !block in 16-bit integer format. The waveform is a 200 point,
5 !+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
Continued on Next Page
236 High Speed Operation Chapter 7