User`s manual
BASIC Program Example (AFGGEN1)
1 !RE-STORE"AFGGEN1"
2 !This program outputs a ramp arbitrary waveform using the
3 !AFG’s frequency1 generator.
4 !
10 !Assign I/O path between the computer and E1445A.
20 ASSIGN @Afg TO 70910
30 COM @Afg
40 !
50 !Set up error checking
60 ON INTR 7 CALL Errmsg
70 ENABLE INTR 7;2
80 OUTPUT @Afg;"*CLS"
90 OUTPUT @Afg;"*SRE 32"
100 OUTPUT @Afg;"*ESE 60"
110 !
120 !Call the subprograms which reset the AFG and which clear
130 !segment and sequence memory.
140 CALL Rst
150 CALL Wf_del
160 !Set waveform parameters
170 OUTPUT @Afg;"SOUR:ROSC:SOUR INT1;";
180 OUTPUT @Afg;":TRIG:STAR:SOUR INT1;";
190 OUTPUT @Afg;":SOUR:FREQ1:RANG 10E6;";
200 OUTPUT @Afg;":SOUR:FREQ1:FIX 10E6;";
210 OUTPUT @Afg;":SOUR:FUNC:SHAP USER;";
220 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 5.1V" !set amplitude to 5.1V
230 !Call subprogram which defines waveform segment and sequence
240 CALL Ramp_wave
250 !Select output sequence and initiate waveform
260 OUTPUT @Afg;"SOUR:FUNC:USER RAMP_OUT"
270 OUTPUT @Afg;"INIT:IMM"
280 !
290 WAIT .1 !allow interrupt to be serviced
300 OFF INTR 7
310 END
320 !
330 SUB Ramp_wave
340 Ramp_wave: !Subprogram which defines a ramp waveform
350 COM @Afg
360 DIM Waveform(1:100) !Calculate waveform points
370 FOR I=1 TO 100
380 Waveform(I)=I*.0505
390 NEXT I
400 !
410 OUTPUT @Afg;"SOUR:LIST1:SEGM:SEL RAMP" !Define segment name
420 OUTPUT @Afg;" SOUR:LIST1:SEGM:DEF 100" !Define segment size
430 OUTPUT @Afg;" SOUR:LIST1:SEGM:VOLT";Waveform(*) !load waveform points
440 !
Continued on Next Page
102 Generating Arbitrary Waveforms Chapter 3