User`s guide

Table Of Contents
98 Chapter 6
Analyzing Data
Bandwidth Search
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 160 Sets the search type for marker 1 to Peak.
Lines 170 to 180 These lines use the Marker Search feature to move the marker to the
maximum value position.
Line 190 Sets the bandwidth definition value to Threshold.
Lines 200 Sends the command to retrieve the results of Bandwidth Search.
Lines 210 Waits 0.5 seconds to prevent the retrieve before an SRQ is generated if
an error occurs on Bandwidth Search.
Lines 220 Retrieves the results of Bandwidth Search.
Lines 240 to 280 These lines display the results of Bandwidth Search.
Lines 310 to 350 These lines define an error handler that retrieves and displays the
number and message of an error that has occurred.
Example 6-2 Bandwidth Search (bandwid.htb)
10 DIM Buff$[9],Err_msg$[100]
20 REAL Threshold,Bwid,Cent,Q,Loss
30 INTEGER Err_no
40 !
50 ASSIGN @Agte507x TO 717
60 Threshold=-3
70 !
80 OUTPUT @Agte507x;"*ESE 60"
90 OUTPUT @Agte507x;"*SRE 32"
100 OUTPUT @Agte507x;"*CLS"
110 OUTPUT @Agte507x;"*OPC?"
120 ENTER @Agte507x;Buff$
130 ON INTR 7 GOTO Err
140 ENABLE INTR 7;2
150 !
160 OUTPUT @Agte507x;":CALC1:PAR1:SEL"
170 OUTPUT @Agte507x;":CALC1:MARK1:FUNC:TYPE MAX"
180 OUTPUT @Agte507x;":CALC1:MARK1:FUNC:EXEC"
190 OUTPUT @Agte507x;":CALC1:MARK1:BWID:THR ";Threshold
200 OUTPUT @Agte507x;":CALC1:MARK1:BWID:DATA?"
210 WAIT .5
220 ENTER @Agte507x;Bwid,Cent,Q,Loss
230 !
240 PRINT "## Bandwidth Search ##"
250 PRINT "Bandwidth : ",Bwid
260 PRINT "Center Frequency: ",Cent
270 PRINT "Q : ",Q
280 PRINT "Loss : ",Loss
290 !
300 GOTO No_err
310 Err: OFF INTR 7
320 OUTPUT @Agte507x;";:SYST:ERR?"
330 ENTER @Agte507x;Err_no,Err_msg$
340 PRINT "Error occurred!!"
350 PRINT " No:";Err_no,"Description: "&Err_msg$
360 No_err: OFF INTR 7
370 END