User`s manual

BASIC Program Example (GATE)
1 !RE-STORE"GATE"
2 !The following program gates the output of a 40 point triangle
3 !wave whose frequency is 1 MHz. When the signal on the “Gate In” BNC
4 !is high, the gate is active and the output is suspended at the last
5 !amplitude point triggered. When the signal is low, the gate is inactive
6 !and the waveform resumes.
7 !
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 Tri_wave
150 !
160 WAIT .1 !allow interrupt to be serviced
170 OFF INTR 7
180 END
190 !
200 SUB Tri_wave
210 Tri_wave: !Subprogram which outputs a triangle wave
220 COM @Afg
230 OUTPUT @Afg;"SOUR:ROSC:SOUR INT2;"; !reference oscillator
240 OUTPUT @Afg;":TRIG:STAR:SOUR INT2;"; !frequency2 generator
250 OUTPUT @Afg;" :TRIG:STAR:GATE:SOUR EXT;"; !gate source
260 OUTPUT @Afg;" :TRIG:STAR:GATE:POL NORM;"; !gate polarity
270 OUTPUT @Afg;" :TRIG:STAR:GATE:STAT ON;"; !enable gate
280 OUTPUT @Afg;":SOUR:FREQ2:FIX 1E6;"; !frequency
290 OUTPUT @Afg;":SOUR:FUNC:SHAP TRI;"; !function
300 OUTPUT @Afg;":SOUR:RAMP:POIN 40;"; !waveform points
310 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 5V" !amplitude
320 OUTPUT @Afg;"INIT:IMM" !wait-for-arm state
330 SUBEND
340 !
350 SUB Rst
360 Rst: !Subprogram which resets the E1445.
370 COM @Afg
380 OUTPUT @Afg;" *RST;*OPC? !reset the AFG
390 ENTER @Afg;Complete
400 SUBEND
410 !
Continued on Next Page
184 Arming and Triggering Chapter 5