User`s manual
BASIC Program Example (SINEWAVE)
1 !RE-STORE"SINEWAVE"
2 !The following program generates a 1 kHz, 5 Vp sine wave.
3 !
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
130 CALL Rst
140 CALL Sine_wave
150 !
160 WAIT .1 !allow interrupt to be serviced
170 OFF INTR 7
180 END
190 !
200 SUB Sine_wave
210 Sine_wave: !Subprogram which outputs a sine wave
220 COM @Afg
230 OUTPUT @Afg;"SOUR:FREQ1:FIX 1E3;"; !frequency
240 OUTPUT @Afg;":SOUR:FUNC:SHAP SIN;"; !function
250 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 5V" !amplitude
260 OUTPUT @Afg;"INIT:IMM" !wait-for-arm state
270 SUBEND
280 !
290 SUB Rst
300 Rst: !Subprogram which resets the E1445.
310 COM @Afg
320 OUTPUT @Afg;"*RST;*OPC?" !reset the AFG
330 ENTER @Afg;Complete
340 SUBEND
350 !
360 SUB Errmsg
370 Errmsg: !Subprogram which displays E1445 programming errors
380 COM @Afg
390 DIM Message$[256]
400 !Read AFG status byte register and clear service request bit
410 B=SPOLL(@Afg)
420 !End of statement if error occurs among coupled commands
430 OUTPUT @Afg;""
440 OUTPUT @Afg;"ABORT" !abort output waveform
450 REPEAT
Continued on Next Page
Chapter 2 Generating Standard Waveforms 59