Create a Measurement using SCPI

This VBScript program creates a new S21 measurement and displays it on the PNA screen.

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 NewMeas.vbs. Learn how to setup and run the macro.

 See Other SCPI Example Programs

Dim app
Dim scpi
' Create / Get the PNA application.

Set app = CreateObject("AgilentPNA835x.Application")
Set scpi = app.ScpiStringParser

' A comment

'Preset the analyzer

scpi.Execute ("SYST:FPReset")
' Create and turn on window 1

scpi.Execute ("DISPlay:WINDow1:STATE ON")
'Define a measurement name, parameter

scpi.Execute ("CALCulate:PARameter:DEFine:EXT 'MyMeas',S21")
'Associate ("FEED") the measurement name ('MyMeas') to WINDow (1), and give the new TRACe a number (1).

scpi.Execute ("DISPlay:WINDow1:TRACe1:FEED 'MyMeas'")