This VBScript program does the following:
Clear measurements from the PNA
Create a new S22 measurement
Set an instrument state
Select a cal kit
Initiate an Unguided calibration
Display a prompt to connect each standard
Save the calibration to a newly created cal set
Note: This example illustrates an important step when calibrating a reflection measurement in the reverse direction. You MUST create a reverse (S22) measurement and have it be the active (selected) measurement on the channel that is being calibrated. This is not necessary for any calibrating any other measurement parameter.
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 PNA. To do this, copy the following code into a text editor file such as Notepad and save it on the PNA hard drive as Unguided.vbs. Learn how to setup and run the macro.
Set App = CreateObject("AgilentPNA835x.Application")
Rem Clear old measurements
Rem Create a new Measurement
Set Parser = App.SCPIStringParser
Parser.Parse "DISPlay:WINDow1:STATE ON"
Parser.Parse "CALCulate:PARameter:DEFine:EXT 'MyMeas',S22"
Parser.Parse "DISPlay:WINDow1:TRACe1:FEED 'MyMeas'"
Rem Initialize state
Set Chan = App.ActiveChannel
Chan.StartFrequency = 200e6
Chan.StopFrequency = 1.5e9
Chan.IFBandwidth = 1000
Rem Begin an unguided calibration
Rem Set the calibration method
Parser.Parse "SENSe:CORRection:COLLect:METHod REFL3"
Rem Turn off continuous sweep
Parser.Parse "INITiate:CONTinuous OFF"
Rem Select a cal kit
Parser.Parse "SENSe:CORRection:COLLect:CKIT:SELect 1"
Rem Measure the standards
MsgBox("Connect OPEN to port 2. Then press OK")
Parser.Parse ("sens:corr:coll:acq STAN1")
MsgBox("Connect SHORT to port 2. Then press OK")
Parser.Parse ("sens:corr:coll:acq STAN2")
MsgBox("Connect LOAD to port 2. Then press OK")
Parser.Parse ("sens:corr:coll:acq STAN3")
Rem All standards have been measured. Save the result
Rem Turn ON continuous sweep
Parser.Parse "INITiate:CONTinuous ON"
MsgBox("The calibration has been completed")