410
OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 5V" !amplitude
420
OUTPUT @Afg;"SOUR:PM:DEV 0DEG"
!phase modulation angle
430
OUTPUT @Afg;"INIT:IMM"
!wait_for_arm state
440
OUTPUT @Afg;"STAT:OPC:INIT OFF;*OPC?"
!wait for INIT to complete
450
ENTER @Afg;Complete
460
SUBEND
470
!
480
SUB Phase_change(Phase)
490 Phase_change:
!Subprogram which changes the phase of the output signal
500
!by writing phase data to the registers on the AFG.
510
COM @Afg,Base_addr
520
CONTROL 16,25;3!access A24 space with READIO and WRITEIO
530
!
540
!Calculate phase increment
550
Phase1=Phase MOD 360
560
IF Phase1<0 THEN Phase1=360
570
Phase_data$=IVAL$(4096.*(16.*Phase1/360.)-65536.*(Phase1>=180.),16)
580
!
590
!Write the first byte of the phase increment to register B3.
600
!Write the second byte to register B1.
610
WRITEIO -16,BaIVAL("B3",16);IVAL(Phase_data$[1;2],16)
620
WRITEIO -16,BaIVAL("B1",16);IVAL(Phase_data$[3;2],16)
630
!
640
!Generate pulse which loads the new phase. Once the pulse is
650
!received, it takes 14 reference oscillator clock cycles before
660
!the new phase appears at the output.
670
WRITEIO -16,BaIVAL("8B",16);0
680
SUBEND
690
!
700
SUB Rst
710 Rst:
!Subprogram which resets the E1445.
720
COM @Afg,Base_addr
730
OUTPUT @Afg;"*RST;*OPC?"
!reset the AFG
740
ENTER @Afg;Complete
750
SUBEND
Comments
•
To simplify the program, SCPI commands are included to configure
the AFG, enable phase modulation, and start the waveform. Thus,
the only registers written to are the Phase Modulation and Phase
Load Strobe Registers. This program executes as intended when the
SCPI commands in subprogram Output_function are executed before
the registers are written to.
•
Phase modulation is only available with standard function sine
waves. Standard function sine waves are only available with the
DDS (
[SOURce:]FREQuency[1]
) subsystem.
Visual BASIC and
Visual C/C++ Program
Versions
The Visual BASIC example program, PHASCHNG.FRM, is in directory
“ VBPROG” and the Visual C example program, PHASCHNG.C, is in
directory “ VCPROG” on the CD that came with your Agilent E1445A.
Appendix C
Register-Based Programming 497
Summary of Contents for E1445A
Page 2: ......
Page 14: ...Notes 12 Agilent E1445A User s Manual Contents...
Page 18: ...Notes 16 Agilent E1445A Arbitrary Function Generator User s Manual...
Page 19: ...Notes Agilent E1445A Arbitrary Function Generator User s Manual 17...
Page 20: ...Notes 18 Agilent E1445A Arbitrary Function Generator User s Manual...
Page 54: ...Notes 52 Getting Started Chapter 1...
Page 84: ...Notes 82 Generating Standard Waveforms Chapter 2...
Page 204: ...Notes 202 Arming and Triggering Chapter 5...
Page 432: ...Figure 9 1 E1445A Status Groups and Associated Registers 430 AFG Status Chapter 9...
Page 446: ...Notes 444 AFG Status Chapter 9...
Page 464: ...Notes 462 Agilent E1445A Specifications Appendix A...
Page 534: ...Notes 532 Agilent E1445A User s Manual Index...