Specifications
104 Chapter 4
Preparation for Accurate Measurement
Fixture Compensation
470 MsgBox "All compen-data measurement completion", vbOKOnly,
"Compensation"
480
490 SCPI.Output "FORM:DATA ASC"
500 SCPI.Output "DATA:CMP1?"
510 SCPI.Enter Comp_a, "#"
520 SCPI.Output "DATA:CMP2?"
530 SCPI.Enter Comp_b, "#"
540
550 SCPI.Output "SWE:POIN?"
560 SCPI.Enter Nop_comp
570
580 iFileNo = FreeFile
590 file = "COMP_COEF"
600 Open file For Output As iFileNo
610 For i = 0 To Nop_comp - 1
620 Write #iFileNo, Val(Comp_a(2 * i)), Val(Comp_a(2 * i +
1))
630 Next i
640
650 For i = 0 To Nop_comp - 1
660 Write #iFileNo, Val(Comp_b(2 * i)), Val(Comp_b(2 * i +
1))
670 Next i
680 Close #iFileNo
690 MsgBox "Saving Compensation Coefficient File Completion",
vbOKOnly, "Compensation"
700
710 Prog_end: End
720
730 End Sub
740
750 Function Fixt_comp(Standard As String) As Integer
760 Dim Inp_char As Integer
770 Dim bool As Long
780
790 Inp_char = MsgBox("Connect " & Standard & _
800 " standard to electrode plate on the test
fixture.", _
810 vbOKCancel, "Compensation")
820
830 If Inp_char = vbOK Then
840 Select Case Standard
850 Case "Open"
860 bool = CompenMeasure(CompenOpen)
870 Case "Short"
880 bool = CompenMeasure(CompenShort)
890 End Select
900 If bool = 0 Then
910 MsgBox Standard & " Compensation aborted!", vbOKOnly,
"Compensation"
920 Fixt_comp = -1
930 Else
940 Fixt_comp = 0
950 End If
960 Else
970 Fixt_comp = -1
980 End If