User`s manual

320 OUTPUT @Afg;"SOUR:ROSC:SOUR INT1;"; !reference oscillator
330 OUTPUT @Afg;":TRIG:STAR:SOUR INT1;"; !frequency generator
340 OUTPUT @Afg;":SOUR:FREQ1:FIX 1E3;"; !frequency
350 OUTPUT @Afg;":SOUR:FUNC:SHAP SIN;"; !function
360 OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 1V" !amplitude
370 OUTPUT @Afg;"ARM:STAR:LAY2:SOUR HOLD" !hold off arm signal
380 OUTPUT @Afg;"INIT:IMM;*OPC?" !set wait-for-arm state
390 ENTER @Afg;Ready
400 OUTPUT @Afg;"ARM:STAR:LAY2:IMM" !arm AFG (output signal)
410 SUBEND
420 !
430 SUB Afg_ready
440 Afg_ready: !Subprogram which is called when the AFG enters the
450 !wait-for-arm state.
460 COM @Afg
470 !Read Status Byte Register and clear service request bit (RQS)
480 B=SPOLL(@Afg)
490 DISP "AFG is in the wait-for-arm state, press ’Continue’ to send ARM"
500 PAUSE
510 DISP ""
520 SUBEND
530 !
540 SUB Rst
550 Rst: !Subprogram which resets the E1445.
560 COM @Afg
570 OUTPUT @Afg;"*RST;*OPC?" !reset the AFG
580 ENTER @Afg;Complete
590 SUBEND
Comments Clearing the Operation Status Event Register (line 140) allows new
events to be latched into the register. Clearing the service request bit
(bit 6 (RQS)) in the Status Byte Register (line 480) when the
interrupt is serviced allows the bit to be set again when the next
summary bit is received.
STAT:OPC:INIT OFF (line 180) allows the *OPC? command (line 380)
to execute following
INIT:IMM, rather than waiting for the AFG to
return to the Idle state (Pending Operation Flag set false). Thus, when
the AFG enters the wait-for-arm state following
INIT:IMM, *OPC?
executes and allows time for the interrupt to be serviced (Afg_ready
called) before line 400 executes.
Refer to page 382 for more information on the
STATus:OPC:INITiate
command.
Visual BASIC and
Visual C/C++ Program
Versions
The Visual BASIC example program, OSG_RQS.FRM, is in directory
VBPROG” and the Visual C example program, OSG_RQS.C, is in
directory “VCPROG” on the CD that came with your Agilent E1445A.
438 AFG Status Chapter 9