User`s guide

Table Of Contents
Chapter 6 95
Analyzing Data
Searching for Positions That Match Specified Criteria
6. Analyzing Data
Sample Program
Example 6-2 is a sample program that demonstrates how to search for peaks using the
Marker Search feature and analysis command. You can find the source file of this program,
named search.htb, on the sample program disk.
This program works in two steps: it uses Marker Search to search for the maximum
positive peak and displays the results; it then uses analysis command to search for all
positive peaks and displays the results.
The program is described in detail below:
Line 50 Assigns a GPIB address to the I/O pass.
Line 60 Stores a peak excursion value of 0.5 into the Excursion variable.
Lines 80 to 120 These lines configure the system to generate an SRQ when it cannot
perform Bandwidth Search due to an error.
Lines 130 to 140 These lines set the branch target for an SRQ interrupt to enable SRQ
interrupts.
Line 180 Sets the active trace to trace 1.
Line 190 Sets the search type for marker 1 to Peak.
Lines 200 to 210 These lines set the Excursion variable to the peak excursion value for
the peak search of marker 1 and set the polarity to Positive Peak.
Line 220 Performs Peak Search, and moves marker 1 to the maximum positive
peak.
Lines 230 to 240 These lines retrieve the frequency at marker 1.
Lines 250 to 260 These lines retrieve the response value at marker 1.
Lines 270 to 290 These lines display the results of searching for the maximum positive
peak.
Line 330 Sets the analysis range to the entire sweep range.
Line 340 Sets the search type of the analysis command to All Peaks.
Lines 350 to 360 These lines set the Excursion variable to the peak excursion value for
the peak search of the analysis command and set the polarity to
Positive Peak.
Line 370 Searches for all peaks.
Lines 380 to 390 These lines retrieve the number of data pairs contained in the search
results, and stores that number into the Point variable.
Line 400 Resizes the Result array based on the value of the Point variable.
Lines 380 to 390 These lines retrieve the response values and frequencies for all peaks.
Lines 430 to 470 These lines display the results of searching for all peaks.
Lines 490 to 530 These lines define an error handler that retrieves and displays the
number and message of an error that has occurred.