User`s guide

Table Of Contents
Chapter 4 71
Performing a Calibration
Sample Program
4. Performing a Calibration
Example 4-1 Calibration (cal.htb)
10 DIM File$[20],Ch$[9],Inp_char$[9]
20 INTEGER Cal_kit,Cal_type,Port(1:2)
30 !
40 ASSIGN @Agte507x TO 717
50 File$="Ex_4_1.sta"
60 Ch$="1"
70 !
80 Select_cal_kit(@Agte507x,Ch$)
90 !
100 CLEAR SCREEN
110 ON ERROR GOTO Type_select
120 Type_select: !
130 PRINT "## Calibration Type Selection ##"
140 PRINT " 1: Response (Open)"
150 PRINT " 2: Response (Short)"
160 PRINT " 3: Response (Thru)"
170 PRINT " 4: Full 1 Port"
180 PRINT " 5: Full 2 Port"
190 PRINT ""
200 PRINT "Input 1 to 5"
210 INPUT "Input number? (1 to 5)",Inp_char$
220 Cal_type=IVAL(Inp_char$,10)
230 IF Cal_type<1 OR Cal_type>5 THEN Type_select
240 OFF ERROR
250 !
260 SELECT Cal_type
270 CASE 1
280 Select_port(1,Port(*))
290 Cal_resp(@Agte507x,Ch$,"OPEN",Port(1))
300 CASE 2
310 Select_port(1,Port(*))
320 Cal_resp(@Agte507x,Ch$,"SHOR",Port(1))
330 CASE 3
340 Select_port(2,Port(*))
350 Cal_resp_thru(@Agte507x,Ch$,Port(1),Port(2))
360 CASE 4
370 Select_port(1,Port(*))
380 Cal_solt(@Agte507x,Ch$,1,Port(*))
390 CASE 5
400 Select_port(2,Port(*))
410 Cal_solt(@Agte507x,Ch$,2,Port(*))
420 END SELECT
430 !
440 OUTPUT @Agte507x;":MMEM:STOR:STYP CST"
450 OUTPUT @Agte507x;":MMEM:STOR """&File$&""""
460 END
470 !=============================================
480 ! Calibration Kit Selection Function
490 !=============================================
500 SUB Select_cal_kit(@Agte507x,Ch$)
510 DIM Cal_kit_lbl$(1:10)[20],Inp_char$[9]
520 INTEGER Cal_kit,I
530 CLEAR SCREEN
540 !
550 FOR I=1 TO 10
560 OUTPUT @Agte507x;":SENS1:CORR:COLL:CKIT ";I
570 OUTPUT @Agte507x;":SENS1:CORR:COLL:CKIT:LAB?"
580 ENTER @Agte507x;Cal_kit_lbl$(I)
590 NEXT I
600 ON ERROR GOTO Kit_select
610 Kit_select: !