Programming
1183
Case "3 Port"
Call ECal(vi, Ch, 3, Port) 'Perform full 3-port calibration.
Case "4 Port"
Call ECal(vi, Ch, 4, Port) 'Perform full 4-port calibration.
End Select
Call viClose(vi) 'Closes the resource manager session.
Call viClose(defrm) 'Breaks the communication and terminates the VISA system.
End
End Sub
Sub ECal(vi As Long, Ch As String, NumPort As String, Port() As String)
Dim Dummy As Variant
Dim i As Integer, j As Integer
Select Case NumPort
Case 1
MsgBox ("Connect Port " & Port(1) & ". then click [OK] button") 'Display the message box.
Call viVPrintf(vi, ":SENS" & Ch & ":CORR:COLL:ECAL:SOLT" & NumPort & " " & Port(1) & vbLf,
0) 'Execute the 1-port calibration.
Case 2
MsgBox ("Connect Port " & Port(1) & " and Port " & Port(2) & ". then click [OK] button") 'Display
the message box.
Call viVPrintf(vi, ":SENS" & Ch & ":CORR:COLL:ECAL:SOLT" & NumPort & " " & Port(1) & "," &
Port(2) & vbLf, 0) 'Execute the full 2-port calibration.
Case 3
MsgBox ("Connect Port " & Port(1) & "," & Port(2) & " and Port " & Port(3) & ". then click [OK]
button") 'Display the message box.
Call viVPrintf(vi, ":SENS" & Ch & ":CORR:COLL:ECAL:SOLT" & NumPort & " " & Port(1) & "," &
Port(2) & "," & Port(3) & vbLf, 0) 'Execute the full 3-port calibration.
Case 4
MsgBox ("Connect Port 1, 2, 3 and 4. then click [OK] button") 'Display the message box.
Call viVPrintf(vi, ":SENS" & Ch & ":CORR:COLL:ECAL:SOLT4 1,2,3,4" & vbLf, 0) 'Execute the full
4-port calibration.
End Select
Call ErrorCheck(vi) 'Checking the error.
End Sub