104
Chapter 9
Measurement Applications (Sample Programs)
Executing OPEN/SHORT/LOAD Correction
Sub Save_Corr_File(FileName As String, Freq As String)
Dim defrm As Long 'Session to Default Resource Manager
Dim Agte4981a As Long 'Session to instrument
Dim Corr_File_Object As Object
Dim FileS As Object
Dim Result As String * 500
Dim Res As Variant
Dim Nop As Integer, i As Integer
Dim Open1 As Double, Open2 As Double
Dim Short1 As Double, Short2 As Double
Dim Load(1 To 3, 1 To 3) As Double
Dim StdOpen As String
Dim StdLoad As String
Dim StdShort As String
Dim Cab_Len As Integer
Dim Sys_Fsh As Integer
Const TimeOutTime = 30000
'===================================
' Open Instrument
'===================================
ErrorCheck viOpenDefaultRM(defrm)
Call SelectMode(defrm, Agte4981a)
ErrorCheck viSetAttribute(Agte4981a, VI_ATTR_TMO_VALUE,
TimeOutTime)
' Reading and Saving Correction values for Open, Short and Load
measurements
Result = ""
' Open Correction Parameter
ErrorCheck viVPrintf(Agte4981a, ":CORR:CKIT:STAN1:FORMAT?" +
vbLf, 0) ' Read Primary and Secondary Load Types CP and D
ErrorCheck viVScanf(Agte4981a, "%t", Result)
StdOpen = Mid(Result, 1, 2)