110    ASSIGN @E5100 TO 717         ! EXT CONTROLLER INITIALIZATION
120    Scode=7                      !
130    ABORT Scode                  !
140    !
150    INPUT "Center Frequency (MHz) ?",Center ! SWEEP CONDITION ENTRY
160    Center=Center*1.E+6          !
170    INPUT "SPAN (kHz) ?",Span    !
180    Span=Span*1000.              !
190    !
200    OUTPUT @E5100;"CLES"         !
210    OUTPUT @E5100;"*OPC?"        !
220    ENTER @E5100;Opc             !
230    !
240    OUTPUT @E5100;"PROG:STAT RUN"
250    !
260    OUTPUT @E5100;"OSNT 16384;OSPT 0" !
270    OUTPUT @E5100;"OSE 16384;*SRE 128"
280    ON INTR Scode GOTO Paused    !
290    !
300 Begin:                          !
310    WAIT .5                      !
320    ENABLE INTR Scode;2          !
330    LOOP                         !
340    END LOOP                     !
350 Paused:                         !
360    !
370    OUTPUT @E5100;"PROG:STR? 'Stat$'"
380    ENTER @E5100;Stat$           !
390    !
400    SELECT Stat$                 !
410    CASE """SETTING"""           !
420      OUTPUT @E5100;"PROG:NUMB'CENTER',";Center
430      OUTPUT @E5100;"PROG:NUMB'SPAN',";Span
440      GOSUB Continue             !
450    !
460    CASE """CALIBRATION"""       !
470      INPUT "CAL?",Cal$          !
480      OUTPUT @E5100;"PROG:STR 'Cal$','";Cal$;"'"
490      GOSUB Continue             !
500      !
510    CASE """CONNECT R"""         !
520      INPUT "Connect THRU, Then Press [ENTER]",A$
530      GOSUB Continue             !
540      !
550    CASE """CONNECT DEVICE"""    !
560      INPUT "Connect Device, Then Press [ENTER]",A$
570      GOSUB Continue             !
580      !
590    CASE """MEASUREMENT"""       !
600      DIM Ret(5)                 !
610      OUTPUT @E5100;"PROG:NUMB? 'RET'"
620      ENTER @E5100;Ret(*)        !
630      CLEAR SCREEN               !
640      PRINT "LOSS:",Ret(0),"[dB],BW:",Ret(1),"[Hz]"
650      PRINT "CENT Freq:",Ret(2),"[Hz],Q:",Ret(3)
660      PRINT "D.LF:",Ret(4),"[Hz],D.RF:",Ret(5),"[Hz]"
670      GOSUB Continue             !
680    !
690    END SELECT                   !
700    GOTO Begin                   !
710    !
720 Continue:                       !
730    OUTPUT @E5100;"CLES"         !
740    OUTPUT @E5100;"*OPC?"        !
750    ENTER @E5100;Opc             !
760    OUTPUT @E5100;"PROG:STAT CONT"
770    RETURN                       !
780    END                          ! END OF PROGRAM
5000   !*************************************************
5010   !* DESCRIPTION:  Agilent E5100A/B Sample Program
5020   !*
5030   !* AUTHOR:       Agilent Technologies Japan, Ltd.
5040   !* CREATED:      05/01/2008
5050   !* PROGRAM NAME: IBCTRL_E
5060   !* REVISION:     A.02.01
5070   !*
5080   !*     Copyright (c) Agilent Technologies,
5090   !*              All rights reserved.
5100   !*
5110   !*
5120   !*  Customer shall have the personal, non-
5130   !* transferable rights to use, copy or modify
5140   !* this SAMPLE PROGRAM for Customer's internal
5150   !* operations. Customer shall use the SAMPLE
5160   !* PROGRAM solely and exclusively for its own
5170   !* purpose and shall not license, lease, market
5180   !* or distribute the SAMPLE PROGRAM or
5190   !* modification or any part thereof.
5200   !*
5210   !*  Agilent Technologies shall not be liable for
5220   !* the quality, performance or behavior of the
5230   !* SAMPLE PROGRAM. Agilent Technologies especially
5240   !* disclaims that the operation of the SAMPLE
5250   !* PROGRAM shall be uninterrupted or error free.
5260   !* This SAMPLE PROGRAM is provided AS IS.
5270   !*
5280   !*  AGILENT TECHNOLOGIES DISCLAIMS THE IMPLIED
5290   !* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
5300   !* A PARTICULAR PURPOSE.
5310   !*
5320   !*  Agilent Technologies shall not be liable for
5330   !* any infringement of any patent, trademark,
5340   !* copyright or other proprietary rights by the
5350   !* SAMPLE PROGRAM or its use. Agilent Technologies
5360   !* does not warrant that the SAMPLE PROGRAM is
5370   !* free from infringements or such rights of third
5380   !* parties. However, Agilent Technologies will not
5390   !* knowingly infringe or deliver a software that
5400   !* infringes the patent, trademark, copyright or
5410   !* other proprietary right of a third party.
5420   !*
5430   !*************************************************