This VBScript program performs a Guided ECal Calibration. While this example is good to use as a starting point for Guided ECal, the Guided comprehensive cal example has some advanced features that are not in this program.
The SCPI commands in this example are sent over a COM interface using the SCPIStringParser object. You do NOT need a GPIB connection to run this example.
This VBScript (*.vbs) program can be run as a macro in the VNA. To do this, copy the following code into a text editor file such as Notepad and save it on the VNA hard drive as Guided.vbs. Learn how to setup and run the macro.
' Performing a 2-port cal (Ports 1 and 2) scpi.Parse "sens:corr:coll:guid:ckit:port1 'N4691-60004 ECal'" scpi.Parse "sens:corr:coll:guid:ckit:port2 'N4691-60004 ECal'" ' Non-factory characterizations are specified as follows: 'scpi.Parse "sens:corr:coll:guid:ckit:port2 'N4691-60004 User 1 ECal'" ' When two or more ECal modules with the same model number are connected ' also specify the serial number as follows: 'scpi.Parse "sens:corr:coll:guid:ckit:port2 'N4691-60004 ECal 01234'" ' When Disk Memory ECal user characterizations are used, ' specify both the User char and the serial number as follows: 'scpi.Parse "sens:corr:coll:guid:ckit:port2 'N4691-60004 MyDskChar ECal 01234'" ' |
Sub SampleEcal() '*** The variables of the resource manager and the instrument I/O are declared. Dim ioMgr As VisaComLib.ResourceManager Dim GPIB As VisaComLib.FormattedIO488 ' ' *** The memory area of the resource manager 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
' Performing a 2-port cal (Ports 1 and 2) ' Specify the DUT connectors ' (for each connector of your DUT, one of the ECal module's ports must have ' that same connector, or else you cannot achieve the cal using that module). GPIB.WriteString "sens:corr:coll:guid:conn:port1 ""APC 3.5 female""", True GPIB.WriteString "sens:corr:coll:guid:conn:port2 ""APC 3.5 female""", True GPIB.WriteString "sens:corr:coll:guid:conn:port3 ""Not used""" GPIB.WriteString "sens:corr:coll:guid:conn:port4 ""Not used""" MsgBox "Connectors defined for Ports 1 and 2"
' Specify ECal modules ' SENSe:CORR:COLL:GUID:CKIT:CAT? to read the list of available Ecal module.
GPIB.WriteString "sens:corr:coll:guid:ckit:port1 'N4431B ECal 03605'", True GPIB.WriteString "sens:corr:coll:guid:ckit:port2 'N4431B ECal 03605'", True ' MsgBox "Cal kits defined for Ports 1 and 2"
' Initiate the calibration and query the number of steps GPIB.WriteString "sens:corr:coll:guid:init", True GPIB.WriteString "sens:corr:coll:guid:steps?", True numSteps = GPIB.ReadNumber MsgBox "Number of steps is " + CStr(numSteps)
' Measure the standards For i = 1 To numSteps step = "Step " + CStr(i) + " of " + CStr(numSteps) GPIB.WriteString "sens:corr:coll:guid:desc? " & CStr(i), True strPrompt = GPIB.ReadString MsgBox strPrompt, vbOKOnly, step GPIB.WriteString "sens:corr:coll:guid:acq STAN" & CStr(i), True Next
' Conclude the calibration GPIB.WriteString "sens:corr:coll:guid:save", True MsgBox "Cal is done!"
'*** End procedure GPIB.IO.Close End Sub |
Last modified:
5-Apr-2011 |
edited for ECal options |