110    ASSIGN @E5100 TO 800         ! IBASIC INITIALIZATION
120    Scode=8                      !
130    CLEAR @E5100                 !
140    !
150    Stat$="SETTING"              !
160    Cal$=""                      !
170    Center=0                     !
180    Span=0                       !
190    !
200    OUTPUT @E5100;"DISAHIHB"     ! MEASUREMENT SETUP
210    OUTPUT @E5100;"PRES"         !
220    OUTPUT @E5100;"CHAN1;ANAMODE GAINP;MEAS AR;FMT LOGM"
230    OUTPUT @E5100;"HOLD"         !
240    !
250    EXECUTE "ANAOCH1"            ! SETUP WAVEFORM ANALYSIS
260    EXECUTE "ANARFULL"           !
270    EXECUTE "ANAODATA"           !
280    !
290    PAUSE                        !
300    !
310    OUTPUT @E5100;"CENS ";Center,Span
320    !
330    Stat$="CALIBRATION"          !
340    PAUSE                        !
350    !
360    IF Cal$="Y" OR Cal$="y" THEN GOSUB R_cal
370    !
380    LOOP                         !
390      Stat$="CONNECT DEVICE"     !
400      DISP "CONNECT DEVICE"      !
410      PAUSE                      !
420    !
430      Stat$="MEASUREMENT"        !
440      DISP "NOW MEASURING..."    !
450      EXECUTE "SING"             !
460    !
470      WRITEIO 8,0;-3             !
480      EXECUTE "OUTPFILT?"        !
490      DIM Ret(5)                 !
500      FOR I=0 TO 5               !
510        Ret(I)=READIO(8,I)       !
520      NEXT I                     !
530    !
540      PAUSE                      !
550    END LOOP                     !
560    !
570    STOP                         !
580    !
590 R_cal:                          !
600    Stat$="CONNECT R"            !
610    DISP "Connect THRU"          !
620    PAUSE                        !
630    DISP                         !
640    OUTPUT @E5100;"CALI RESP"    !
670    OUTPUT @E5100;"STANC?"       !
680    ENTER @E5100;Tmp             !
690    !
730    OUTPUT @E5100;"RESPDONE?"    !
740    ENTER @E5100;Tmp             !
760    RETURN                       !
770    !
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: IB_CTRL
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   !*************************************************