User`s manual
310 OUTPUT @Afg;":SOUR:FREQ2 10E6;"; !frequency
320 OUTPUT @Afg;":SOUR:FUNC:SHAP SQU;"; !function
330 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 1V" !amplitude
340 OUTPUT @Afg;"INIT:IMM" !wait_for_arm state
350 LOOP !loop continuously until frequency error occurs
360 END LOOP
370 SUBEND
380 !
390 SUB Disp_msg
400 Disp_msg: !Subprogram which is called when output frequency
410 !varies from 10 MHz by more than 1%.
420 COM @Afg
430 !Read Status Byte Register and clear service request bit (RQS)
440 B=SPOLL(@Afg)
450 LOOP
460 DISP "Output frequency error"
470 WAIT 1
480 DISP ""
490 WAIT 1
500 END LOOP
510 SUBEND
520 !
530 SUB Rst
540 Rst: !Subprogram which resets the E1445.
550 COM @Afg
560 OUTPUT @Afg;"*RST;*OPC?" !reset the AFG
570 ENTER @Afg;Complete
580 SUBEND
Comments • This program runs continuously until a frequency change greater
than 1% occurs between the programmed frequency and the output
frequency. Resetting the computer stops the program.
• Clearing the Questionable Signal Event Register (line 130) allows
new events to be latched into the Register. Clearing the service
request bit (bit 6 (RQS)) in the Status Byte Register (line 440) when
the interrupt is serviced allows the bit to be set again when the next
summary bit is received.
Visual BASIC and
Visual C/C++ Program
Versions
The Visual BASIC example program, QSSG_RQS.FRM, is in directory
“ VBPROG” and the Visual C example program, QSSG_RQS.C, is in
directory “VCPROG” on the CD that came with your Agilent E1445A.
434 AFG Status Chapter 9