User`s manual

190 !
200 SUB Phase_mod
210 Phase_mode: !Subprogram which outputs a sine wave
220 COM @Afg
230 OUTPUT @Afg;“SOUR:FREQ1:FIX 60;”; !frequency
240 OUTPUT @Afg;“:SOUR:PM:SOUR INT;”; !phase modulation source
250 OUTPUT @Afg;“:SOUR:PM:STAT ON;”; !enable phase modulation
260 OUTPUT @Afg;“:SOUR:FUNC:SHAP SIN;”; !function
270 OUTPUT @Afg;“:SOUR:VOLT:LEV:IMM:AMPL 5V” !amplitude
280 OUTPUT @Afg;“SOUR:PM:DEV 0DEG” !phase modulation
290 OUTPUT @Afg;INIT:IMM !wait-for-arm state
300 DISP “Press ’Continue’ to shift phase 180 degrees”
310 PAUSE
320 OUTPUT @Afg;“SOUR:PM:DEV 180DEG” !shift phase 180 degrees
330 DISP “”
340 SUBEND
350 !
360 SUB Rst
370 Rst: !Subprogram which resets the E1445.
380 COM @Afg
390 OUTPUT @Afg;"*RST;*OPC?" !reset the AFG
400 ENTER @Afg;Complete
410 SUBEND
420 !
430 SUB Errmsg
440 Errmsg: !Subprogram which displays E1445 programming errors
450 COM @Afg
460 DIM Message$[256]
470 !Read AFG status byte register and clear service request bit
480 B=SPOLL(@Afg)
490 !End of statement if error occurs among coupled commands
500 OUTPUT @Afg;""
510 OUTPUT @Afg;"ABORT" !abort output waveform
520 REPEAT
530 OUTPUT @Afg;"SYST:ERR?" !read AFG error queue
540 ENTER @Afg;Code,Message$
550 PRINT Code,Message$
560 UNTIL Code=0
570 STOP
580 SUBEND
Visual BASIC and
Visual C/C++ Program
Versions
The Visual BASIC example program, PHS_MOD.FRM, is in directory
“VBPROG” and the Visual C example program, PHS_MOD.C, is in
directory “VCPROG” on the CD that came with your Agilent E1445A.
Chapter 2 Generating Standard Waveforms 77