Specifications

84 Chapter 4
Preparation for Accurate Measurement
Calibration
10 Sub Main()
20 Dim buff As String, file As String
30 Dim Cal_kit As String, Cal_point As String
40 Dim Cal_a1 As Variant, Cal_a2 As Variant
50 Dim Cal_b1 As Variant, Cal_b2 As Variant
60 Dim Cal_c1 As Variant, Cal_c2 As Variant
70 Dim Open_g As Double, Open_c As Double
80 Dim Short_r As Double, Short_l As Double
90 Dim Load_r As Double, Load_l As Double
100 Dim Result As Integer, Nop_cal As Integer, Inp_char As
Integer
110 Dim iFileNo As Integer, i As Integer
120
130 Cal_kit = "DEF" 'DEF/USER
140 Cal_point = "FIX" 'FIX/FUS/USER
150
160 SCPI.Output "SENS:CORR1:CKIT " & Cal_kit
170 SCPI.Output "SENS:CORR1:COLL:FPO " & Cal_point
180
190 If Cal_kit = "USER" Then
200
210 SCPI.Output "SENS:CORR1:CKIT:LIST OFF"
220
230 Call Inp_data("Open_G(S)", Open_g)
240 Call Inp_data("Open_C(F)", Open_c)
250 SCPI.Output "SENS:CORR1:CKIT:STAN1:G " & CStr(Open_g)
260 SCPI.Output "SENS:CORR1:CKIT:STAN1:C " & CStr(Open_c)
270
280 Call Inp_data("Short_R(ohm)", Short_r)
290 Call Inp_data("Short_L(H)", Short_l)
300 SCPI.Output "SENS:CORR1:CKIT:STAN2:R " & CStr(Short_r)
310 SCPI.Output "SENS:CORR1:CKIT:STAN2:L " & CStr(Short_l)
320
330 Call Inp_data("Load_R(ohm)", Load_r)
340 Call Inp_data("Load_L(H)", Load_l)
350 SCPI.Output "SENS:CORR1:CKIT:STAN3:R " & CStr(Load_r)
360 SCPI.Output "SENS:CORR1:CKIT:STAN3:L " & CStr(Load_l)
370
380 End If
390
400 Result = Cal("Open")
410 If Result <> 0 Then GoTo Prog_end
420
430 Result = Cal("Short")
440 If Result <> 0 Then GoTo Prog_end
450
460 Result = Cal("Load")
470 If Result <> 0 Then GoTo Prog_end
480
490 Inp_char = MsgBox("Do you want to measure a Low-Loss
Capacitor?", vbYesNo + vbQuestion, "Calibration")
500 If Inp_char = vbYes Then
510 Result = Cal("Low-loss C")
520 If Result <> 0 Then GoTo Prog_end
530 End If
540
550 SCPI.Output "SENS:CORR1:COLL:SAVE"
560 buff = SCPI.Query("*OPC?")