This VBScript program shows how to send commands that allow you to view specific 'custom' windows, and sweep specific channels, during a UI (Cal Wizard) or remote calibration.
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 CalWindow.vbs. Learn how to setup and run the macro.
These commands are used to show and sweep specific windows and channels:
The following command sweeps the Cal Windows before remote acquisition:
See Other COM Example Programs
Set pna = CreateObject("AgilentPNA835x.Application")
' get a handle to the preset channel 1 so that we can later cal it
' Creates a new S21 measurement in channel 2 and New window(2)
' this will be the channel and window to show during cal
Set calMgr = pna.GetCalManager
Set guidedCal = calMgr.GuidedCalibration
' show window 2 during cal
' sweep channel 2 during calibration of chan 1
' make Channel1 the active channel
' activating the measurement also activates the channel
guidedCal.Initialize 1, True
' Do 2-port cal
' Select the connectors
guidedCal.ConnectorType(1) = "APC 3.5 female"
guidedCal.ConnectorType(2) = "APC 3.5 male"
' Select the Cal Kit for each port being calibrated.
guidedCal.CalKitType(1) = "85052D"
guidedCal.CalKitType(2) = "85052D"
' Initiate the calibration and query the number of steps
numSteps = guidedCal.GenerateSteps
' Measure the standards, compute and apply the cal
value = MsgBox("Number of steps is " + CStr(numSteps))
' Measure the standards
For i = 1 to NumSteps
step = "Step " + CStr(i) + " of " + CStr(numSteps)
strPrompt = guidedCal.GetStepDescription(i)
' Sweep the Cal window prior to standard acquisition
' prompt to connect standard
value = MsgBox(strPrompt, vbOKOnly, step)
' measure standard
' Conclude the calibration
MsgBox ("Cal is complete!")
' clear the Cal window and channel flags