110  ASSIGN @E5100 TO 717;FORMAT ON              ! INITIALIZATION
120  ASSIGN @Dt TO 717;FORMAT OFF                !
130  Scode=7                                     !
140  CLEAR @E5100                                !
150  CLEAR @Dt                                   !
160  !
170  DIM Dat(1:201,1:2)                          !
180  Nop=201                                     !
190  !
200  GOSUB Setup                                 ! CALL SUBROUTINES
210  GOSUB Cal                                   !
220  GOSUB Get_cal_data                          !
230  GOSUB Save_cal_data                         !
240  GOTO Ending                                 !
250  !
260 Setup:                                       ! MEASUREMENT SETUP
270  INPUT "CENTER? [MHz]",F_cent                !
280  F_cent=F_cent*1.E+6                         !
290  INPUT "SPAN? [kHz]",F_span                  !
300  F_span=F_span*1000                          !
310  OUTPUT @E5100;"PRES"                        !
320  OUTPUT @E5100;"CHAN1;ANAMODE GAINP;MEAS AR;FMT LOGM"
330  OUTPUT @E5100;"HOLD"                        !
340  OUTPUT @E5100;"POIN ";Nop                   !
350  OUTPUT @E5100;"CENS ";F_cent,F_span         !
360  RETURN                                      !
370  !
380 Cal:                                         ! CALIBRATION
390  INPUT "CONNECT THRU,THEN PRESS [Return]",Dum$
400  OUTPUT @E5100;"CALI RESP"                   !
410  OUTPUT @E5100;"STANC?"                      !
420  ENTER @E5100;Tmp                            !
430                                              !
440 Sweep_end:DISP "SWEEP COMPLETED"             !
450  OUTPUT @E5100;"RESPDONE?"                   !
460  ENTER @E5100;Tmp                            !
470                                              !
480  DISP "THRU CAL. COMPLETED."                 !
490  RETURN                                      !
500  !
510 Get_cal_data:                                ! GETTING CALIBRATION DATA
520   INPUT "PRESS [RETURN] TO GET CAL DATA FROM HP E5100A/B.",Dum$
530  OUTPUT @E5100;"FORM3"                       !
540  OUTPUT @E5100;"OUTPCALC01?"                 !
550  ENTER @E5100 USING "#,8A";Header$           !
560  ENTER @Dt;Dat(*)                            !
570  ENTER @E5100 USING "#,A";End$               !
580  RETURN                                      !
590  !
600 Save_cal_data:                               ! SAVING CALIBRATION DATA
610  INPUT "Enter File Name (with extension)",File$
620  CREATE BDAT File$,Nop,16                    !
630  ASSIGN @File TO File$                       !
640  OUTPUT @File;Dat(*)                         !
650  ASSIGN @File TO *                           !
660  RETURN                                      !
670  !
680 Ending:                                      ! ENDING PROGRAM
690  ASSIGN @Dt TO *                             !
700  !
710  END                                         !
5000   !*************************************************
5010   !* DESCRIPTION:  Agilent E5100A/B Sample Program
5020   !*
5030   !* AUTHOR:       Agilent Technologies Japan, Ltd.
5040   !* CREATED:      05/01/2008
5050   !* PROGRAM NAME: CALSTR_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   !*************************************************