This example cycles through the state settings on the first ECal module it finds on the USB bus.
The state settings include all of the ECal states on Port A, Port B and the AB thru path. The first state on a port-pair path such as AB is the thru state that is used during calibrations. The second state on that path is the "confidence state" which is the equivalent of an attenuator that is used by the ECal Confidence Check feature.
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 *.vbs.
Learn how to setup and run the macro.
See ECal State commands
See Other SCPI Example Programs
Set app = CreateObject("AgilentPNA835x.Application")
Set scpi = app.ScpiStringParser
' These are 1-based indices as opposed to 0-based,
' so if this query returns 0 it indicates there appear
' to be no ECal modules connected.
moduleIndexList = Split( scpi.Parse("SENS:CORR:CKIT:ECAL:LIST?"), ",")
If CInt(moduleIndexList(0)) = 0 Then
MsgBox "No ECal module was found"
pathNumStates = CInt( scpi.Parse("CONT:ECAL:MOD1:PATH:COUN? " + path) )
For stateNum = 1 To pathNumStates
stateNumStr = CStr(stateNum)
If Len(path) = 1 Then
pathDescr = "port " + path
pathDescr = "path " + path
isOK = MsgBox("Click OK to switch to state number " + stateNumStr + " of " + pathDescr, vbOKCancel)
If isOK = vbCancel Then WScript.Quit(0)
scpi.Parse "CONT:ECAL:MOD1:PATH:STAT " + path + "," + stateNumStr