Using Macros
Macros are executable programs that you write, load into the analyzer, and then run from the analyzer. You can have up to 25 macros set up to run on the analyzer.
How to Setup Macros |
|
Using front-panel hardkey [softkey] buttons |
Using Menus |
|
|
In the Macro Setup dialog box:
|
|
Macro setup allows you to create up to 25 macros that can be launched from the PNA application. An external keyboard is required to enter the Macro Title and the Run string parameters. To add a Macro, use a mouse or the front-panel 'down arrow' (NOT the 'Down' key) to select a blank line. Then click Edit. Macro Title Shows the titles that appear in the softkeys and menu when you press the Macro key. These titles are associated with the executable files and should be descriptive so you can easily identify them. Macro Executable Lists the complete path to the executable file. To follow the example of launching the Keysight PNA Series Home Page, the path to the executable could be "C:/Program Files/Internet Explorer/iexplore.exe. Macro Runstring Parameters Lists the parameters that get passed to the program that is referenced in the executable file. Again following the example of launching the PNA Series Home Page, you could assign the runstring parameters "http://www.Keysight.com/find/pna". Edit Invokes the Macro Edit dialog box. Delete Deletes the selected macro. Up Allows you to reorder the macros, moving the selected macro up one line. This order determines how they appear in the PNA Menu and in the softkeys and when you press the Macro front-panel key. Down Moves the selection down one line in the list of macros. |
Macro Title Add a title that appears in the softkeys and menu. Macro Executable Set the complete path to the macro executable file. Click Browse to navigate to the macro executable file and establish the complete path to the file. Macro run string parameters Optionally add parameters that are passed to the program referenced in the executable file. |
How to Run Macros |
|
Using front-panel |
Using Menus |
|
|
The following is an example Visual Basic Scripting (vbs) program that you can copy, install, and run on your PNA.
Note: Print these instructions if viewing in the analyzer. This topic will be covered by the Macro Setup dialog box.
-
Copy the following code into a Notepad file.
-
Save the file on the analyzer hard drive in the C:/Documents folder. Name the file FilterTest.vbs
-
Close Notepad
- Run the macro
Notepad is a text editor that is installed on all PCs that use a Microsoft Operating system. To launch Notepad on the analyzer:
-
Click View, then click Title Bars
-
Click the Start button on the windows taskbar
-
Point to Programs, Accessories.
-
Click Notepad
'Start copying here
'This program creates a S21 measurement, with Bandwidth
'markers for testing a 175MHz Bandpass filter
'It is written in VBscript using COM commands
Set PNA = CreateObject("AgilentPNA835x.Application")
PNA.Preset
Set chan=PNA.activechannel
Set meas=PNA.activemeasurement
Set limts = meas.LimitTest
Set trce = PNA.ActiveNAWindow.ActiveTrace
meas.ChangeParameter "S21",1
chan.StartFrequency = 45e6
chan.StopFrequency = 500e6
trce.ReferencePosition = 8
PNA.TriggerSignal = 3
'Do Test
for t=1 to 5
call measure
call compare
next
msgbox("Done Testing")
sub measure
msgbox("Connect Device " & t & " and press OK")
PNA.ManualTrigger True
meas.SearchFilterBandwidth
end sub
sub compare
BW = meas.FilterBW
if bw>6.5e7 then msgbox("Failed BW: " & BW)
Loss = meas.FilterLoss
if loss>5 then msgbox("Failed Loss: " & Loss)
end sub
'End copying here
Last Modified:
3-May-2012 |
Removed c models |
17-Feb-2009 |
Added 25 limit |
4-Sep-2008 |
Removed legacy content |