Specifications

5.1.1.2 Application Code
The application code is contained below. To run the
application, first generate the executable file. Once this
is complete, it can be copied and executed on the ana-
lyzer or run on the PC. The application can also be run
from the development environment.
Option Explicit
Dim app As AgilentPNA835x.Application
Dim chan As AgilentPNA835x.Channel
Dim meas As AgilentPNA835x.Measurement
Dim result As Variant
Dim i As Integer
Dim num_points As Integer
Dim message As String
Private Sub Main()
' Connect to the PNA application on machine SLTSU044
Set app = CreateObject("AgilentPNA835x.Application",
"SLTSU044")
' Reset the analyzer to instrument preset
app.Reset
' Create S11 measurement
app.CreateMeasurement 1, "S11", 1
' Set chan variable to point to the active channel
Set chan = app.ActiveChannel
' Set meas variable to point to the active measurement
Set meas = app.ActiveMeasurement
' Setup the channel for a single trigger
chan.Hold True
app.TriggerSignal = naTriggerManual
chan.TriggerMode = naTriggerModeMeasurement
' Make the PNA application visible
app.Visible = True
' Set channel parameters
chan.NumberOfPoints = 11
chan.StartFrequency = (1000000000#)
chan.StopFrequency = (2000000000#)
' Send a manual trigger to initiate a single sweep
chan.Single True
' Store the data in the "result" variable
result = meas.GetData(naRawData,
naDataFormat_LogMag)
' Display the result
num_points = chan.NumberOfPoints
For i = 0 To num_points - 1
message = message & result(i) & vbCrLf
Next
If MsgBox(message, vbOKOnly, "S11(dB) - VBS COM
Example for PNA") Then
Set chan = Nothing
app.Quit
End If
End Sub
5.1.1.3 Application Output
The figure below shows the displayed results when the
application is executed.
11