7-52 Chapter7
Programming Examples
Measurement Calibration Examples
18 !
19 ! Initialize Arrays and Variables
20 !
21 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
22 !
23 INTEGER Hdr,Length
24 COMPLEX S11x,S21x,S12x,S22x,D
25 COMPLEX Calcoe(1:1601,1:12) ! Cal Coefficients
26 COMPLEX S11r(1:1601) ! Pre-Raw Data
27 COMPLEX S21r(1:1601) ! Pre-Raw Data
28 COMPLEX S12r(1:1601) ! Pre-Raw Data
29 COMPLEX S22r(1:1601) ! Pre-Raw Data
30 COMPLEX S11a(1:1601) ! Corrected Data
31 COMPLEX S21a(1:1601) ! Corrected Data
32 COMPLEX S12a(1:1601) ! Corrected Data
33 COMPLEX S22a(1:1601) ! Corrected Data
34 !
35 ! Initialize output commands
36 !
37 DIM Out_cmd$(1:12)[10]
38 DATA “OUTPCALC01”,”OUTPCALC02”,”OUTPCALC03”,”OUTPCALC04”
39 DATA “OUTPCALC05”,”OUTPCALC06”,”OUTPCALC07”,”OUTPCALC08”
40 DATA “OUTPCALC09”,”OUTPCALC10”,”OUTPCALC11”,”OUTPCALC12”
41 READ Out_cmd$(*)
42 !
43 ! Setup Network Analyzer
44 !
45 ASSIGN @Nwa TO 716 ! Assign an I/O path for the analyzer
46 ASSIGN @Nwdat TO 716;FORMAT OFF! Binary mode to read and write data
47 ABORT 7 ! Generate an IFC (Interface Clear)
48 CLEAR @Nwa ! SDC (Selected Device Clear) analyzer
49 CLEAR SCREEN
50 !
51 OUTPUT @Nwa;”RAWOFFS?;” ! Query whether raw offsets are on
52 ENTER @Nwa;I
53 IF I=1 THEN
54 PRINT “Raw offsets must be turned off prior to calibration.”
55 PRINT “Turning them off now.”
56 OUTPUT @Nwa;”RAWOFFSOFF;”
57 END IF
58 !
59 !
60 Check_for_cal: ! Turn on two-port cal, check and read
61 REPEAT
62 LOCAL @Nwa
63 INPUT “Set up a 2-port cal, hit return when ready”,A
64 OUTPUT @Nwa;”CORR?;”
65 ENTER @Nwa;I
66 UNTIL I=1
67 !
68 ! Read the Calibration Coefficients
69 !
70 DISP “Reading in Calibration Coefficient Arrays: Please wait.”
71 GOSUB Read_cal_co
72 !
73 ! Setup TAKE4 Mode,
74 !
75 OUTPUT @Nwa;”Corroff;take4on;hold;”