This program performs an response calibration
Sub SampleResponseCal()
'*** The variables of the resource mGPIBger and the instrument I/O are declared.
Dim ioMgr As VisaComLib.ResourceManager
Dim GPIB As VisaComLib.FormattedIO488
'*** The memory area of the resource mGPIBger and the instrument I/O are acquired.
Set ioMgr = New VisaComLib.ResourceManager
Set GPIB = New VisaComLib.FormattedIO488
'*** Open the instrument.
Set GPIB.IO = ioMgr.Open("GPIB0::16::INSTR")
GPIB.IO.timeout = 10000
GPIB.WriteString "SYSTem:PRESet", True
'Select the measurement
GPIB.WriteString "CALCulate1:MEASure1:PARameter 'S21'", True
'Set the number of trace
GPIB.WriteString "CALCulate1:PARameter:MNUMber 1", True
'Set the calibration method
GPIB.WriteString "SENSe:CORRection:COLLect:METHod RESPonse", True
'Select a cal kit
GPIB.WriteString "SENSe:CORRection:COLLect:CKIT:SELect 1", True
'Measure the thru standard
MsgBox "Connect THRU between Ports 1 and 2; then press OK"
GPIB.WriteString "SENSe:CORRection:COLLect:ACQuire stan4", True
'All standards have been measured. Save the result
GPIB.WriteString "SENS:CORR:COLL:SAVE", True
'*** End procedure
GPIB.IO.Close
End Sub.